20
20
# - https://github.com/actions/setup-node
21
21
# - https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#yarn2-configuration
22
22
# - https://github.com/actions/upload-artifact
23
+ # - https://github.com/andstor/file-existence-action
23
24
# - https://github.com/codecov/codecov-action
24
25
# - https://github.com/hmarr/debug-action
25
26
# - https://vercel.com/guides/how-can-i-use-github-actions-with-vercel
@@ -39,6 +40,7 @@ permissions:
39
40
packages : read
40
41
env :
41
42
CACHE_PATH : node_modules
43
+ COVERAGE_REPORT : ./coverage/lcov.info
42
44
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
43
45
HUSKY : 0
44
46
REF : ${{ github.head_ref || github.ref_name }}
@@ -301,13 +303,19 @@ jobs:
301
303
- id : test
302
304
name : Run tests
303
305
run : yarn test:cov --segfault-retry=3
306
+ - id : coverage-report-check
307
+ name : Check coverage report existence
308
+ uses : andstor/file-existence-action@v2.0.0
309
+ with :
310
+ files : ${{ env.COVERAGE_REPORT }}
304
311
- id : codecov
305
312
name : Upload coverage report to Codecov
313
+ if : steps.coverage-report-check.outputs.files_exists == 'true'
306
314
uses : codecov/codecov-action@v3.1.1
307
315
with :
308
316
env_vars : GITHUB_JOB,GITHUB_REF,GITHUB_REF_TYPE,GITHUB_RUN_ID,GITHUB_SHA,GITHUB_WORKSPACE
309
317
fail_ci_if_error : true
310
- file : ./coverage/lcov.info
318
+ file : ${{ env.COVERAGE_REPORT }}
311
319
flags : ${{ format('node{0}', matrix.node-version) }}
312
320
override_branch : ${{ env.REF }}
313
321
override_build : ${{ github.run_id }}
0 commit comments