77 - main # change this if your default branch is named differently
88 workflow_dispatch :
99
10+ permissions : {}
11+
1012jobs :
1113 analyze :
1214 runs-on : ubuntu-latest
1315 steps :
14- - uses : actions/checkout@v2
16+ - uses : actions/checkout@v4
1517
1618 - name : Set up node
17- uses : actions/setup-node@v1
19+ uses : actions/setup-node@v4
1820 with :
1921 node-version : ' 20.x'
22+ cache : yarn
23+ cache-dependency-path : yarn.lock
24+
25+ - name : Restore cached node_modules
26+ uses : actions/cache@v4
27+ with :
28+ path : ' **/node_modules'
29+ key : node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
2030
21- - name : Install dependencies
22- uses : bahmutov/npm- install@v1.7.10
31+ - name : Install deps
32+ run : yarn install --frozen-lockfile
2333
2434 - name : Restore next build
25- uses : actions/cache@v2
35+ uses : actions/cache@v4
2636 id : restore-build-cache
2737 env :
2838 cache-name : cache-next-build
@@ -41,13 +51,13 @@ jobs:
4151 run : npx -p nextjs-bundle-analysis@0.5.0 report
4252
4353 - name : Upload bundle
44- uses : actions/upload-artifact@v2
54+ uses : actions/upload-artifact@v4
4555 with :
4656 path : .next/analyze/__bundle_analysis.json
4757 name : bundle_analysis.json
4858
4959 - name : Download base branch bundle stats
50- uses : dawidd6/action-download-artifact@v2
60+ uses : dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
5161 if : success() && github.event.number
5262 with :
5363 workflow : analyze.yml
7383 run : ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare
7484
7585 - name : Upload analysis comment
76- uses : actions/upload-artifact@v2
86+ uses : actions/upload-artifact@v4
7787 with :
7888 name : analysis_comment.txt
7989 path : .next/analyze/__bundle_analysis_comment.txt
8292 run : echo ${{ github.event.number }} > ./pr_number
8393
8494 - name : Upload PR number
85- uses : actions/upload-artifact@v2
95+ uses : actions/upload-artifact@v4
8696 with :
8797 name : pr_number
8898 path : ./pr_number
0 commit comments