11name : Checks
2- on :
3- push :
4- branches :
5- - main
2+
3+ on :
64 pull_request :
7- branches :
8- - main
5+ types :
6+ - opened
7+ - synchronize
8+ - reopened
9+ - ready_for_review
910
10- env :
11- NODE : 16
11+ concurrency :
12+ group : ${{ github.workflow }}-${{ github.ref }}
13+ cancel-in-progress : true
1214
1315jobs :
1416 prep :
1517 if : github.event.pull_request.draft == false
1618 runs-on : ubuntu-latest
1719
1820 steps :
19- - name : Cancel Previous Runs
20- uses : styfle/cancel-workflow-action@0.8.0
21- with :
22- access_token : ${{ github.token }}
23-
2421 - name : Checkout
25- uses : actions/checkout@v2
22+ uses : actions/checkout@v6
2623
27- - name : Use Node.js ${{ env.NODE }}
28- uses : actions/setup-node@v1
24+ - name : Use Node.js
25+ uses : actions/setup-node@v6
2926 with :
30- node-version : ${{ env.NODE }}
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 : Use Node.js ${{ env.NODE }}
51- uses : actions/setup-node@v1
47+ - name : Use Node.js
48+ uses : actions/setup-node@v6
5249 with :
53- node-version : ${{ env.NODE }}
50+ node-version-file : ' .nvmrc '
5451
5552 - name : Cache node_modules
56- uses : actions/cache@v2
53+ uses : actions/cache@v5
5754 id : cache-node-modules
5855 with :
5956 path : node_modules
60- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
57+ key : ${{ runner.os }}-build-${{ hashFiles('**/package.json') }}
6158
6259 - name : Install
63- run : yarn install
60+ run : corepack enable && yarn install
6461
6562 - name : Lint
6663 run : yarn lint
@@ -71,48 +68,48 @@ jobs:
7168
7269 steps :
7370 - name : Checkout
74- uses : actions/checkout@v2
71+ uses : actions/checkout@v6
7572
76- - name : Use Node.js ${{ env.NODE }}
77- uses : actions/setup-node@v1
73+ - name : Use Node.js
74+ uses : actions/setup-node@v6
7875 with :
79- node-version : ${{ env.NODE }}
76+ node-version-file : ' .nvmrc '
8077
8178 - name : Cache node_modules
82- uses : actions/cache@v2
79+ uses : actions/cache@v5
8380 id : cache-node-modules
8481 with :
8582 path : node_modules
86- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
83+ key : ${{ runner.os }}-build-${{ hashFiles('**/package.json') }}
8784
8885 - name : Install
89- run : yarn install
86+ run : corepack enable && yarn install
9087
9188 - name : Test
9289 run : yarn test
9390
9491 build :
95- needs : test
92+ needs : prep
9693 runs-on : ubuntu-latest
9794
9895 steps :
9996 - name : Checkout
100- uses : actions/checkout@v2
97+ uses : actions/checkout@v6
10198
102- - name : Use Node.js ${{ env.NODE }}
103- uses : actions/setup-node@v1
99+ - name : Use Node.js
100+ uses : actions/setup-node@v6
104101 with :
105- node-version : ${{ env.NODE }}
102+ node-version-file : ' .nvmrc '
106103
107104 - name : Cache node_modules
108- uses : actions/cache@v2
105+ uses : actions/cache@v5
109106 id : cache-node-modules
110107 with :
111108 path : node_modules
112- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
109+ key : ${{ runner.os }}-build-${{ hashFiles('**/package.json') }}
113110
114111 - name : Install
115- run : yarn install
112+ run : corepack enable && yarn install
116113
117114 - name : Test
118- run : yarn build
115+ run : yarn test
0 commit comments