-
Notifications
You must be signed in to change notification settings - Fork 3
69 lines (65 loc) · 1.73 KB
/
pr-analysis.yml
File metadata and controls
69 lines (65 loc) · 1.73 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
name: Pull request analysis
on:
pull_request:
pull_request_target:
jobs:
build-head:
name: Build head
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v5
with:
ref: ${{github.event.pull_request.head.ref}}
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v5
with:
node-version: 22
cache: pnpm
- name: Install dependencies
run: pnpm i
- name: Build
run: pnpm analyze
- name: Upload stats.json
uses: actions/upload-artifact@v4
with:
name: head-stats
path: .analysis/stats-0.json
build-base:
name: Build base
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.base_ref }}
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v5
with:
node-version: 22
cache: pnpm
- name: Install dependencies
run: pnpm i
- name: Build
run: pnpm analyze
- name: Upload stats.json
uses: actions/upload-artifact@v4
with:
name: base-stats
path: .analysis/stats-0.json
# run the action against the stats.json files
compare:
name: 'Compare base & head bundle sizes'
runs-on: ubuntu-latest
needs: [build-base, build-head]
permissions:
pull-requests: write
steps:
- uses: actions/download-artifact@v5
- uses: twk3/rollup-size-compare-action@v1.2.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
current-stats-json-path: ./head-stats/stats-0.json
base-stats-json-path: ./base-stats/stats-0.json