File tree Expand file tree Collapse file tree 2 files changed +34
-55
lines changed Expand file tree Collapse file tree 2 files changed +34
-55
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- name : size-build
1
+ name : size
2
2
on :
3
- pull_request :
3
+ # this action will error unless run in a pr context
4
+ pull_request_target :
4
5
branches :
5
6
- main
6
7
7
8
env :
8
9
BUNDLE_SIZE : true
9
10
10
- permissions :
11
- contents : read
11
+ permissions : {}
12
12
13
13
jobs :
14
14
# Build current and upload stats.json
15
+ # You may replace this with your own build method. All that
16
+ # is required is that the stats.json be an artifact
15
17
build-head :
16
18
runs-on : ubuntu-latest
19
+ permissions :
20
+ contents : read
17
21
steps :
18
22
- uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
23
+ with :
24
+ ref : ${{ github.event.pull_request.head.sha }}
19
25
- run : corepack enable
20
26
- uses : actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
21
27
with :
34
40
path : ./packages/*/stats.json
35
41
36
42
# Build base for comparison and upload stats.json
43
+ # You may replace this with your own build method. All that
44
+ # is required is that the stats.json be an artifact
37
45
build-base :
38
46
runs-on : ubuntu-latest
47
+ permissions :
48
+ contents : read
39
49
steps :
40
50
- uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
41
51
with :
56
66
with :
57
67
name : base-stats
58
68
path : ./packages/*/stats.json
69
+
70
+ # run the action against the stats.json files
71
+ compare :
72
+ runs-on : ubuntu-latest
73
+ needs : [build-base, build-head]
74
+ permissions :
75
+ pull-requests : write
76
+ issues : write
77
+ strategy :
78
+ matrix :
79
+ package : [nuxi, nuxt-cli, create-nuxt]
80
+ steps :
81
+ - name : ⏬ Download stats.json
82
+ uses : actions/download-artifact@v5
83
+
84
+ with :
85
+ title : ${{ matrix.package }} size comparison
86
+ github-token : ${{ secrets.GITHUB_TOKEN }}
87
+ current-stats-json-path : ./head-stats/${{ matrix.package }}/stats.json
88
+ base-stats-json-path : ./base-stats/${{ matrix.package }}/stats.json
You can’t perform that action at this time.
0 commit comments