-
Notifications
You must be signed in to change notification settings - Fork 75
54 lines (42 loc) · 1.43 KB
/
bundle-size-pr.yml
File metadata and controls
54 lines (42 loc) · 1.43 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
name: Bundle size
on:
pull_request:
env:
NX_PARALLEL: 4
jobs:
bundle-size:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'microsoft' }}
permissions:
contents: 'read'
actions: 'read'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@afb73a62d26e41464e9254689e1fd6122ee683c1 # v5.0.1
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
cache: yarn
node-version: '24'
- run: yarn install --immutable
- name: Measure affected packages
run: yarn nx affected --target=bundle-size --nxBail
- name: Compare results with "main" branch
id: compare
continue-on-error: true
run: npx monosize compare-reports --branch main --output markdown --quiet > ./monosize.md
- name: Save PR number
run: echo ${{ github.event.number }} > pr.txt
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: monosize-report
retention-days: 1
if-no-files-found: error
path: |
monosize.md
pr.txt
- name: Fail if threshold exceeded
if: steps.compare.outcome == 'failure'
run: exit 1