11name : Checks
2+
23on :
3- push :
4- branches :
5- - main
64 pull_request :
7- branches :
8- - main
5+ types :
6+ - opened
7+ - synchronize
8+ - reopened
9+ - ready_for_review
10+
11+ concurrency :
12+ group : ${{ github.workflow }}-${{ github.ref }}
13+ cancel-in-progress : true
914
1015jobs :
1116 prep :
1217 if : github.event.pull_request.draft == false
1318 runs-on : ubuntu-latest
1419
1520 steps :
16- - name : Cancel Previous Runs
17- uses : styfle/cancel-workflow-action@0.8.0
18- with :
19- access_token : ${{ github.token }}
20-
2121 - name : Checkout
22- uses : actions/checkout@v2
23-
24- - name : Read .nvmrc
25- run : echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_ENV
22+ uses : actions/checkout@v6
2623
27- - name : Use Node.js ${{ env.NVMRC }}
28- uses : actions/setup-node@v1
24+ - name : Use Node.js
25+ uses : actions/setup-node@v6
2926 with :
30- node-version : ${{ env.NVMRC }}
27+ node-version-file : ' .nvmrc '
3128
3229 - name : Cache node_modules
33- uses : actions/cache@v2
30+ uses : actions/cache@v5
3431 id : cache-node-modules
3532 with :
3633 path : node_modules
37- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
34+ key : ${{ runner.os }}-build-${{ hashFiles('**/package.json') }}
3835
3936 - name : Install
40- run : yarn install
37+ run : corepack enable && yarn install
4138
4239 lint :
4340 needs : prep
4441 runs-on : ubuntu-latest
4542
4643 steps :
4744 - name : Checkout
48- uses : actions/checkout@v2
45+ uses : actions/checkout@v6
4946
50- - name : Read .nvmrc
51- run : echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_ENV
52-
53- - name : Use Node.js ${{ env.NVMRC }}
54- uses : actions/setup-node@v1
47+ - name : Use Node.js
48+ uses : actions/setup-node@v6
5549 with :
56- node-version : ${{ env.NVMRC }}
50+ node-version-file : ' .nvmrc '
5751
5852 - name : Cache node_modules
59- uses : actions/cache@v2
53+ uses : actions/cache@v5
6054 id : cache-node-modules
6155 with :
6256 path : node_modules
63- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
57+ key : ${{ runner.os }}-build-${{ hashFiles('**/package.json') }}
6458
6559 - name : Install
66- run : yarn install
60+ run : corepack enable && yarn install
6761
6862 - name : Lint
6963 run : yarn lint
@@ -74,54 +68,48 @@ jobs:
7468
7569 steps :
7670 - name : Checkout
77- uses : actions/checkout@v2
78-
79- - name : Read .nvmrc
80- run : echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_ENV
71+ uses : actions/checkout@v6
8172
82- - name : Use Node.js ${{ env.NVMRC }}
83- uses : actions/setup-node@v1
73+ - name : Use Node.js
74+ uses : actions/setup-node@v6
8475 with :
85- node-version : ${{ env.NVMRC }}
76+ node-version-file : ' .nvmrc '
8677
8778 - name : Cache node_modules
88- uses : actions/cache@v2
79+ uses : actions/cache@v5
8980 id : cache-node-modules
9081 with :
9182 path : node_modules
92- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
83+ key : ${{ runner.os }}-build-${{ hashFiles('**/package.json') }}
9384
9485 - name : Install
95- run : yarn install
86+ run : corepack enable && yarn install
9687
9788 - name : Test
9889 run : yarn test
9990
10091 build :
101- needs : test
92+ needs : prep
10293 runs-on : ubuntu-latest
10394
10495 steps :
10596 - name : Checkout
106- uses : actions/checkout@v2
107-
108- - name : Read .nvmrc
109- run : echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_ENV
97+ uses : actions/checkout@v6
11098
111- - name : Use Node.js ${{ env.NVMRC }}
112- uses : actions/setup-node@v1
99+ - name : Use Node.js
100+ uses : actions/setup-node@v6
113101 with :
114- node-version : ${{ env.NVMRC }}
102+ node-version-file : ' .nvmrc '
115103
116104 - name : Cache node_modules
117- uses : actions/cache@v2
105+ uses : actions/cache@v5
118106 id : cache-node-modules
119107 with :
120108 path : node_modules
121- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
109+ key : ${{ runner.os }}-build-${{ hashFiles('**/package.json') }}
122110
123111 - name : Install
124- run : yarn install
112+ run : corepack enable && yarn install
125113
126114 - name : Test
127- run : yarn build
115+ run : yarn test
0 commit comments