77 prepare :
88 name : Prepare
99 runs-on : ubuntu-latest
10+ strategy :
11+ matrix :
12+ node-version : [18.x, 20.x, 22.x]
1013 steps :
11- - uses : actions/checkout@v3
12- - name : Use Node.js
13- uses : actions/setup-node@v3
14+ - uses : actions/checkout@v4
15+ - name : Install Corepack via Node
16+ uses : actions/setup-node@v4
1417 with :
1518 node-version-file : ' .nvmrc'
19+ - name : Install Yarn
20+ run : corepack enable
21+ - name : Install Node.js ${{ matrix.node-version }} and restore Yarn cache
22+ uses : actions/setup-node@v4
23+ with :
24+ node-version : ${{ matrix.node-version }}
1625 cache : ' yarn'
17- - name : Install Yarn dependencies
26+ - name : Install dependencies via Yarn
1827 run : yarn --immutable
1928
2029 build :
2130 name : Build
31+ needs : prepare
2232 runs-on : ubuntu-latest
23- needs :
24- - prepare
33+ strategy :
34+ matrix :
35+ node-version : [22.x]
2536 steps :
26- - uses : actions/checkout@v3
27- - name : Use Node.js
28- uses : actions/setup-node@v3
37+ - uses : actions/checkout@v4
38+ - name : Install Corepack via Node
39+ uses : actions/setup-node@v4
2940 with :
3041 node-version-file : ' .nvmrc'
42+ - name : Install Yarn
43+ run : corepack enable
44+ - name : Install Node.js ${{ matrix.node-version }} and restore Yarn cache
45+ uses : actions/setup-node@v4
46+ with :
47+ node-version : ${{ matrix.node-version }}
3148 cache : ' yarn'
32- - run : yarn --immutable --immutable-cache
49+ - name : Install dependencies via Yarn
50+ run : yarn --immutable --immutable-cache
3351 - run : yarn build
3452 - name : Require clean working directory
3553 shell : bash
@@ -41,17 +59,26 @@ jobs:
4159
4260 lint :
4361 name : Lint
62+ needs : prepare
4463 runs-on : ubuntu-latest
45- needs :
46- - prepare
64+ strategy :
65+ matrix :
66+ node-version : [22.x]
4767 steps :
48- - uses : actions/checkout@v3
49- - name : Use Node.js
50- uses : actions/setup-node@v3
68+ - uses : actions/checkout@v4
69+ - name : Install Corepack via Node
70+ uses : actions/setup-node@v4
5171 with :
5272 node-version-file : ' .nvmrc'
73+ - name : Install Yarn
74+ run : corepack enable
75+ - name : Install Node.js ${{ matrix.node-version }} and restore Yarn cache
76+ uses : actions/setup-node@v4
77+ with :
78+ node-version : ${{ matrix.node-version }}
5379 cache : ' yarn'
54- - run : yarn --immutable --immutable-cache
80+ - name : Install dependencies via Yarn
81+ run : yarn --immutable --immutable-cache
5582 - run : yarn lint
5683 - name : Validate RC changelog
5784 if : ${{ startsWith(github.head_ref, 'release/') }}
@@ -69,20 +96,26 @@ jobs:
6996
7097 test :
7198 name : Test
99+ needs : prepare
72100 runs-on : ubuntu-latest
73- needs :
74- - prepare
75101 strategy :
76102 matrix :
77103 node-version : [18.x, 20.x, 22.x]
78104 steps :
79- - uses : actions/checkout@v3
80- - name : Use Node.js ${{ matrix.node-version }}
81- uses : actions/setup-node@v3
105+ - uses : actions/checkout@v4
106+ - name : Install Corepack via Node
107+ uses : actions/setup-node@v4
108+ with :
109+ node-version-file : ' .nvmrc'
110+ - name : Install Yarn
111+ run : corepack enable
112+ - name : Install Node.js ${{ matrix.node-version }} and restore Yarn cache
113+ uses : actions/setup-node@v4
82114 with :
83115 node-version : ${{ matrix.node-version }}
84116 cache : ' yarn'
85- - run : yarn --immutable --immutable-cache
117+ - name : Install dependencies via Yarn
118+ run : yarn --immutable --immutable-cache
86119 - run : yarn test
87120 - name : Require clean working directory
88121 shell : bash
@@ -94,25 +127,32 @@ jobs:
94127
95128 compatibility-test :
96129 name : Compatibility test
130+ needs : prepare
97131 runs-on : ubuntu-latest
98- needs :
99- - prepare
100132 strategy :
101133 matrix :
102134 node-version : [18.x, 20.x, 22.x]
103135 steps :
104- - uses : actions/checkout@v3
105- - name : Use Node.js ${{ matrix.node-version }}
106- uses : actions/setup-node@v3
136+ - uses : actions/checkout@v4
137+ - name : Install Corepack via Node
138+ uses : actions/setup-node@v4
139+ with :
140+ node-version-file : ' .nvmrc'
141+ - name : Install Yarn
142+ run : corepack enable
143+ - name : Install Node.js ${{ matrix.node-version }} and restore Yarn cache
144+ uses : actions/setup-node@v4
107145 with :
108146 node-version : ${{ matrix.node-version }}
109147 cache : ' yarn'
110- - run : rm yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn
148+ - name : Install dependencies via Yarn
149+ run : rm yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn
111150 - run : yarn test
151+ - name : Restore lockfile
152+ run : git restore yarn.lock
112153 - name : Require clean working directory
113154 shell : bash
114155 run : |
115- git restore yarn.lock
116156 if ! git diff --exit-code; then
117157 echo "Working tree dirty at end of job"
118158 exit 1
0 commit comments