@@ -190,6 +190,7 @@ jobs:
190190 with :
191191 name : ios-bundle
192192 path : ios/main.jsbundle
193+ retention-days : 7
193194
194195 ship-js-bundle-size-check :
195196 runs-on : ubuntu-latest
@@ -262,6 +263,7 @@ jobs:
262263 name : coverage-unit-${{ matrix.shard }}
263264 path : ./tests/coverage/
264265 if-no-files-found : error
266+ retention-days : 7
265267 - name : Require clean working directory
266268 shell : bash
267269 run : |
@@ -272,6 +274,8 @@ jobs:
272274 echo "No changes detected"
273275 fi
274276
277+ # We need to merge both unit and component view tests into a single coverage report so the PR coverage
278+ # threshold calculation is accurate.
275279 merge-unit-and-component-view-tests :
276280 runs-on : ubuntu-latest
277281 needs : [unit-tests, component-view-tests]
@@ -321,6 +325,11 @@ jobs:
321325 [ -f "$file" ] && cp "$file" ./tests/coverage-cv-merged/
322326 done
323327
328+ mkdir -p tests/coverage-unit-merged
329+ for file in ./tests/coverage/coverage-unit-*/coverage-unit-*.json; do
330+ [ -f "$file" ] && cp "$file" ./tests/coverage-unit-merged/
331+ done
332+
324333 find ./tests/coverage/coverage-* -name 'coverage-*.json' -exec mv {} ./tests/coverage/ \;
325334 - run : yarn test:merge-coverage
326335 - run : yarn test:validate-coverage
@@ -329,23 +338,41 @@ jobs:
329338 name : lcov.info
330339 path : ./tests/merged-coverage/lcov.info
331340 if-no-files-found : error
341+ retention-days : 7
332342 - uses : actions/upload-artifact@v4
333343 with :
334344 name : cv-test-stats
335345 path : ./cv-test-stats.json
336346 if-no-files-found : error
347+ retention-days : 7
337348 - uses : actions/upload-artifact@v4
338349 with :
339350 name : unit-test-stats
340351 path : ./unit-test-stats.json
341352 if-no-files-found : error
342- - name : Generate CV test HTML coverage report
343- run : yarn nyc report --temp-dir ./tests/coverage-cv-merged --report-dir ./tests/coverage-cv-lcov --reporter html
353+ retention-days : 7
354+ - name : Generate CV test coverage report
355+ run : yarn nyc report --temp-dir ./tests/coverage-cv-merged --report-dir ./tests/coverage-cv-lcov --reporter html --reporter json-summary
344356 - uses : actions/upload-artifact@v4
345357 with :
346358 name : cv-test-coverage-html
347359 path : ./tests/coverage-cv-lcov/
348360 if-no-files-found : error
361+ retention-days : 7
362+ - uses : actions/upload-artifact@v4
363+ with :
364+ name : cv-test-coverage-summary
365+ path : ./tests/coverage-cv-lcov/coverage-summary.json
366+ if-no-files-found : error
367+ retention-days : 7
368+ - name : Generate unit test coverage summary
369+ run : yarn nyc report --temp-dir ./tests/coverage-unit-merged --report-dir ./tests/coverage-unit-lcov --reporter json-summary
370+ - uses : actions/upload-artifact@v4
371+ with :
372+ name : unit-test-coverage-summary
373+ path : ./tests/coverage-unit-lcov/coverage-summary.json
374+ if-no-files-found : error
375+ retention-days : 7
349376 - name : Require clean working directory
350377 shell : bash
351378 run : |
@@ -397,6 +424,7 @@ jobs:
397424 name : coverage-cv-${{ matrix.shard }}
398425 path : ./tests/coverage/
399426 if-no-files-found : error
427+ retention-days : 7
400428
401429 needs_e2e_build :
402430 uses : ./.github/workflows/needs-e2e-build.yml
0 commit comments