5858 runs-on : ubuntu-latest
5959 outputs :
6060 cache-key : ${{ steps.cache-key.outputs.result }}
61- version : ${{ steps.version.outputs.result }}
61+ test-files : ${{ steps.test-files.outputs.files_exists }}
62+ typecheck-files : ${{ steps.typecheck-files.outputs.files_exists }}
6263 version-typescript : ${{ steps.version-typescript.outputs.result }}
64+ version : ${{ steps.version.outputs.result }}
6365 steps :
6466 - id : debug
6567 name : Print environment variables and event payload
9799 - id : version-typescript
98100 name : Get TypeScript version
99101 run : echo "result=$(jq .devDependencies.typescript package.json -r)" >>$GITHUB_OUTPUT
102+ - id : test-files
103+ name : Check for test files
104+ uses : andstor/file-existence-action@v3.0.0
105+ with :
106+ files : ' **/__tests__/*.spec.+(mts|tsx)'
107+ - id : typecheck-files
108+ name : Check for typecheck files
109+ uses : andstor/file-existence-action@v3.0.0
110+ with :
111+ files : ' **/__tests__/*.spec-d.mts'
100112 commitlint :
101113 needs : preflight
102114 runs-on : ubuntu-latest
@@ -245,50 +257,47 @@ jobs:
245257 matrix :
246258 typescript-version :
247259 - ${{ needs.preflight.outputs.version-typescript }}
248- - 5.5.4
249- - 5.4.5
250- - 5.0.4
260+ - 5.6.3
261+ env :
262+ TYPESCRIPT_VERSION : ${{ matrix.typescript-version }}
263+ VITEST_REPORT : ./.vitest-reports/typecheck.blob.json
264+ if : ${{ fromJson(needs.preflight.outputs.typecheck-files) }}
251265 steps :
252266 - id : checkout
253267 name : Checkout ${{ env.REF_NAME }}
254268 uses : actions/checkout@v4.2.2
255269 with :
256270 persist-credentials : false
257271 ref : ${{ env.REF }}
258- - id : test-files-check
259- name : Check for typecheck files
260- uses : andstor/file-existence-action@v3.0.0
261- with :
262- files : ' **/__tests__/*.spec-d.ts'
263272 - id : node
264- if : steps.test-files-check.outputs.files_exists == 'true'
265273 name : Setup Node.js
266274 uses : actions/setup-node@v4.1.0
267275 with :
268276 cache : yarn
269277 cache-dependency-path : yarn.lock
270278 node-version-file : .nvmrc
271279 - id : cache
272- if : steps.test-files-check.outputs.files_exists == 'true'
273280 name : Restore dependencies cache
274281 uses : actions/cache@v4.1.2
275282 with :
276283 key : ${{ needs.preflight.outputs.cache-key }}
277284 path : ${{ env.CACHE_PATH }}
278285 - id : typescript
279- if : steps.test-files-check.outputs.files_exists == 'true'
280- name : Install typescript@${{ matrix.typescript-version }}
281- run : yarn add -D typescript@${{ matrix.typescript-version }}
286+ name : Install typescript@${{ env.TYPESCRIPT_VERSION }}
287+ run : yarn add -D typescript@${{ env.TYPESCRIPT_VERSION }}
282288 - id : print-typescript-version
283- if : steps.test-files-check.outputs.files_exists == 'true'
284289 name : Print TypeScript version
285290 run : jq .devDependencies.typescript package.json -r
286291 - id : typecheck
287- if : steps.test-files-check.outputs.files_exists == 'true'
288292 name : Run typecheck
289- env :
290- NODE_OPTIONS : --experimental-strip-types --experimental-transform-types
291293 run : yarn typecheck
294+ - id : report
295+ name : Upload report
296+ uses : actions/upload-artifact@v4.4.3
297+ with :
298+ name : |
299+ ${{ format('typecheck-{0}-{1}-{2}.blob.json', env.TYPESCRIPT_VERSION, github.event.repository.name, env.SHA) }}
300+ path : ${{ env.VITEST_REPORT }}
292301 test :
293302 needs :
294303 - commitlint
@@ -299,25 +308,22 @@ jobs:
299308 fail-fast : false
300309 matrix :
301310 node-version :
311+ - 23
302312 - 22
303313 env :
304314 COVERAGE_SUMMARY : ./coverage/coverage-summary.json
315+ NODE_VERSION : ${{ matrix.node-version }}
305316 PCT : .total.branches.pct + .total.functions.pct + .total.lines.pct + .total.statements.pct
306317 VITEST_REPORT : ./.vitest-reports/test.blob.json
318+ if : ${{ fromJson(needs.preflight.outputs.test-files) }}
307319 steps :
308320 - id : checkout
309321 name : Checkout ${{ env.REF_NAME }}
310322 uses : actions/checkout@v4.2.2
311323 with :
312324 persist-credentials : false
313325 ref : ${{ env.REF }}
314- - id : test-files-check
315- name : Check for test files
316- uses : andstor/file-existence-action@v3.0.0
317- with :
318- files : ' **/__tests__/*.spec.+(ts|tsx)'
319326 - id : node
320- if : steps.test-files-check.outputs.files_exists == 'true'
321327 name : Setup Node.js v${{ matrix.node-version }}
322328 uses : actions/setup-node@v4.1.0
323329 with :
@@ -326,37 +332,31 @@ jobs:
326332 check-latest : true
327333 node-version : ${{ matrix.node-version }}
328334 - id : cache
329- if : steps.test-files-check.outputs.files_exists == 'true'
330335 name : Restore dependencies cache
331336 uses : actions/cache@v4.1.2
332337 with :
333338 key : ${{ needs.preflight.outputs.cache-key }}
334339 path : ${{ env.CACHE_PATH }}
335340 - id : test
336- if : steps.test-files-check.outputs.files_exists == 'true'
337341 name : Run tests
338- env :
339- NODE_OPTIONS : --experimental-strip-types --experimental-transform-types
340342 run : |
341343 yarn test:cov --coverage.thresholds.100=false \
342344 && echo "coverage=$(jq '${{ env.PCT }}' ${{ env.COVERAGE_SUMMARY }} -r)" >>$GITHUB_OUTPUT
343345 - id : report
344- if : steps.test-files-check.outputs.files_exists == 'true'
345346 name : Upload report
346347 uses : actions/upload-artifact@v4.4.3
347348 with :
348- name : ${{ format('vitest-report-{0}-{1}.json', github.event.repository.name, env.SHA) }}
349+ name : |
350+ ${{ format('test-{0}-{1}-{2}.blob.json', env.NODE_VERSION, github.event.repository.name, env.SHA) }}
349351 path : ${{ env.VITEST_REPORT }}
350352 - id : coverage-summary
351- if : steps.test-files-check.outputs.files_exists == 'true'
352353 name : Upload coverage summary
353354 uses : actions/upload-artifact@v4.4.3
354355 with :
355356 name : |
356- ${{ format('coverage-summary-{0}-{1}.json', github.event.repository.name, env.SHA) }}
357+ ${{ format('coverage-summary-{0}-{1}-{2} .json', env.NODE_VERSION , github.event.repository.name, env.SHA) }}
357358 path : ${{ env.COVERAGE_SUMMARY }}
358359 - id : codecov
359- if : steps.test-files-check.outputs.files_exists == 'true'
360360 name : Upload coverage report to Codecov
361361 uses : codecov/codecov-action@v4.6.0
362362 env :
@@ -377,12 +377,8 @@ jobs:
377377 token : ${{ secrets.CODECOV_TOKEN }}
378378 verbose : true
379379 - id : coverage-failure
380- if : |
381- steps.test-files-check.outputs.files_exists == 'true'
382- && ${{ toJson(steps.test.outputs.coverage) }} != 400
380+ if : ${{ toJson(steps.test.outputs.coverage) != 400 }}
383381 name : Coverage threshold failure (${{ steps.test.outputs.coverage }})
384- env :
385- NODE_OPTIONS : --experimental-strip-types --experimental-transform-types
386382 run : yarn test:cov:reports
387383 build :
388384 needs :
@@ -443,6 +439,8 @@ jobs:
443439 - test
444440 - typescript
445441 runs-on : ubuntu-latest
442+ env :
443+ NODE_NO_WARNINGS : 1
446444 steps :
447445 - id : checkout
448446 name : Checkout ${{ env.REF_NAME }}
0 commit comments