Skip to content

Commit c071fd9

Browse files
committed
ci(workflows): [ci] add lcov.info file check to codecov job
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
1 parent ed64d9c commit c071fd9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/ci.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
# - https://github.com/actions/setup-node
2121
# - https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#yarn2-configuration
2222
# - https://github.com/actions/upload-artifact
23+
# - https://github.com/andstor/file-existence-action
2324
# - https://github.com/codecov/codecov-action
2425
# - https://github.com/hmarr/debug-action
2526
# - https://vercel.com/guides/how-can-i-use-github-actions-with-vercel
@@ -39,6 +40,7 @@ permissions:
3940
packages: read
4041
env:
4142
CACHE_PATH: node_modules
43+
COVERAGE_REPORT: ./coverage/lcov.info
4244
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4345
HUSKY: 0
4446
REF: ${{ github.head_ref || github.ref_name }}
@@ -301,13 +303,19 @@ jobs:
301303
- id: test
302304
name: Run tests
303305
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 }}
304311
- id: codecov
305312
name: Upload coverage report to Codecov
313+
if: steps.coverage-report-check.outputs.files_exists == 'true'
306314
uses: codecov/codecov-action@v3.1.1
307315
with:
308316
env_vars: GITHUB_JOB,GITHUB_REF,GITHUB_REF_TYPE,GITHUB_RUN_ID,GITHUB_SHA,GITHUB_WORKSPACE
309317
fail_ci_if_error: true
310-
file: ./coverage/lcov.info
318+
file: ${{ env.COVERAGE_REPORT }}
311319
flags: ${{ format('node{0}', matrix.node-version) }}
312320
override_branch: ${{ env.REF }}
313321
override_build: ${{ github.run_id }}

0 commit comments

Comments
 (0)