56
56
&& !startsWith(github.event.head_commit.message, 'release:')
57
57
runs-on : ubuntu-latest
58
58
outputs :
59
+ cache-key : ${{ steps.cache-key.outputs.result }}
59
60
version : ${{ steps.version.outputs.result }}
60
61
version-typescript : ${{ steps.version-typescript.outputs.result }}
61
62
steps :
@@ -78,11 +79,14 @@ jobs:
78
79
- id : yarn
79
80
name : Install dependencies
80
81
run : yarn ${{ github.actor == 'dependabot[bot]' && '--no-immutable' || '--immutable' }}
82
+ - id : cache-key
83
+ name : Get cache key
84
+ run : echo "result=${{ runner.os }}-${{ github.run_id }}" >>$GITHUB_OUTPUT
81
85
- id : cache
82
86
name : Cache dependencies
83
87
84
88
with :
85
- key : ${{ runner.os }}-${{ github.run_id }}
89
+ key : ${{ steps.cache-key.outputs.result }}
86
90
path : ${{ env.CACHE_PATH }}
87
91
- id : version
88
92
name : Get package version
@@ -112,7 +116,7 @@ jobs:
112
116
name : Restore dependencies cache
113
117
114
118
with :
115
- key : ${{ runner.os }}-${{ github.run_id }}
119
+ key : ${{ needs.preflight.outputs.cache-key }}
116
120
path : ${{ env.CACHE_PATH }}
117
121
- id : lint
118
122
name : Check commitlint status
@@ -144,6 +148,7 @@ jobs:
144
148
needs :
145
149
- commitlint
146
150
- gitguardian
151
+ - preflight
147
152
runs-on : ubuntu-latest
148
153
steps :
149
154
- id : checkout
@@ -163,7 +168,7 @@ jobs:
163
168
name : Restore dependencies cache
164
169
165
170
with :
166
- key : ${{ runner.os }}-${{ github.run_id }}
171
+ key : ${{ needs.preflight.outputs.cache-key }}
167
172
path : ${{ env.CACHE_PATH }}
168
173
- id : format
169
174
name : Check code formatting
@@ -172,6 +177,7 @@ jobs:
172
177
needs :
173
178
- commitlint
174
179
- gitguardian
180
+ - preflight
175
181
runs-on : ubuntu-latest
176
182
steps :
177
183
- id : checkout
@@ -191,7 +197,7 @@ jobs:
191
197
name : Restore dependencies cache
192
198
193
199
with :
194
- key : ${{ runner.os }}-${{ github.run_id }}
200
+ key : ${{ needs.preflight.outputs.cache-key }}
195
201
path : ${{ env.CACHE_PATH }}
196
202
- id : lint
197
203
name : Check lint status
@@ -200,6 +206,7 @@ jobs:
200
206
needs :
201
207
- commitlint
202
208
- gitguardian
209
+ - preflight
203
210
runs-on : ubuntu-latest
204
211
steps :
205
212
- id : checkout
@@ -219,7 +226,7 @@ jobs:
219
226
name : Restore dependencies cache
220
227
221
228
with :
222
- key : ${{ runner.os }}-${{ github.run_id }}
229
+ key : ${{ needs.preflight.outputs.cache-key }}
223
230
path : ${{ env.CACHE_PATH }}
224
231
- id : spelling
225
232
name : Check spelling
@@ -262,7 +269,7 @@ jobs:
262
269
name : Restore dependencies cache
263
270
264
271
with :
265
- key : ${{ runner.os }}-${{ github.run_id }}
272
+ key : ${{ needs.preflight.outputs.cache-key }}
266
273
path : ${{ env.CACHE_PATH }}
267
274
- id : typescript
268
275
if : steps.test-files-check.outputs.files_exists == 'true'
@@ -280,6 +287,7 @@ jobs:
280
287
needs :
281
288
- commitlint
282
289
- gitguardian
290
+ - preflight
283
291
runs-on : ubuntu-latest
284
292
strategy :
285
293
fail-fast : false
@@ -301,6 +309,12 @@ jobs:
301
309
302
310
with :
303
311
files : ' **/__tests__/*.spec.+(ts|tsx)'
312
+ - id : yarn-ignore-node
313
+ if : |
314
+ steps.test-files-check.outputs.files_exists == 'true'
315
+ && startsWith(matrix.node-version, '16')
316
+ name : Set env.YARN_IGNORE_NODE
317
+ run : echo "YARN_IGNORE_NODE=1" >>$GITHUB_ENV
304
318
- id : node
305
319
if : steps.test-files-check.outputs.files_exists == 'true'
306
320
name : Setup Node.js v${{ matrix.node-version }}
@@ -314,7 +328,7 @@ jobs:
314
328
name : Restore dependencies cache
315
329
316
330
with :
317
- key : ${{ runner.os }}-${{ github.run_id }}
331
+ key : ${{ needs.preflight.outputs.cache-key }}
318
332
path : ${{ env.CACHE_PATH }}
319
333
- id : test
320
334
if : steps.test-files-check.outputs.files_exists == 'true'
@@ -368,7 +382,7 @@ jobs:
368
382
name : Restore dependencies cache
369
383
370
384
with :
371
- key : ${{ runner.os }}-${{ github.run_id }}
385
+ key : ${{ needs.preflight.outputs.cache-key }}
372
386
path : ${{ env.CACHE_PATH }}
373
387
- id : local-binaries
374
388
name : Add local binaries to $PATH
0 commit comments