-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (72 loc) · 2.41 KB
/
bundle-stats.yml
File metadata and controls
79 lines (72 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Bundle stats
on:
workflow_call:
secrets:
S3_KEY_ID:
required: true
description: S3 key ID
S3_SECRET_KEY:
required: true
description: S3 secret key
inputs:
main:
description: Is workflow running in main branch
type: boolean
default: false
pr_number:
description: Pull request number
type: string
required: false
bundle_stats_s3_dir:
description: S3 dir to store bundle-stats
type: string
required: true
working_directory:
description: Working directory
type: string
required: true
jobs:
bundle-stats:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download bundle-stats
uses: actions/download-artifact@main
with:
name: bundle-stats
path: ${{ inputs.working_directory }}/.bundle-stats
- name: Download bundle-stats (baseline)
if: inputs.main == true
uses: actions/download-artifact@main
with:
name: bundle-stats-baseline
path: ${{ inputs.working_directory }}/.bundle-stats-baseline
- name: Upload bundle-stats to s3
uses: ./.github/actions/upload-to-s3
with:
source_path: ${{ inputs.working_directory }}/.bundle-stats
dest_path: ${{ inputs.bundle_stats_s3_dir }}
s3_key_id: ${{ secrets.S3_KEY_ID }}
s3_secret_key: ${{ secrets.S3_SECRET_KEY }}
- name: Upload bundle-stats (baseline) to s3
if: inputs.main == true
uses: ./.github/actions/upload-to-s3
with:
source_path: ${{ inputs.working_directory }}/.bundle-stats-baseline/baseline.json
dest_path: ${{ inputs.bundle_stats_s3_dir }}/baseline.json
s3_key_id: ${{ secrets.S3_KEY_ID }}
s3_secret_key: ${{ secrets.S3_SECRET_KEY }}
- name: Create Comment
if: inputs.pr_number != ''
uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
number: ${{ inputs.pr_number }}
header: bundle-stats
recreate: true
message: |
📊 **Bundle Stats URL:** https://languages-learner-static.website.yandexcloud.net${{ inputs.bundle_stats_s3_dir }}/bundle-stats.html