Skip to content

Commit 1252f61

Browse files
authored
chore: Update the codecov action. (#280)
* chore: Update the codecov action. * fix: Generate JUnit XML test results for Codecov Configure mocha to use multi-reporters so test-results.xml is generated during test runs. This fixes the "file not found" error in CI when uploading test results to Codecov.
1 parent ada6fe3 commit 1252f61

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,12 @@ jobs:
121121

122122
- name: Upload test results to Codecov
123123
if: '!cancelled()'
124-
uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1
124+
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5
125125
with:
126126
use_oidc: true
127127
files: test-results.xml
128128
fail_ci_if_error: true
129+
report_type: test_results
129130

130131
- name: Check dependencies
131132
run: npm run checkDependencies

build/.mocha-multi-reporters.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"reporterEnabled": "./build/ci/scripts/spec_with_pid.js,mocha-junit-reporter",
2+
"reporterEnabled": "spec,mocha-junit-reporter",
33
"mochaJunitReporterReporterOptions": {
44
"includePending": true
55
}

build/.mocha.unittests.js.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"spec": "./out/**/*.unit.test.js",
33
"loader": ["./build/mocha-esm-loader.js"],
44
"require": ["./out/test/unittests.js"],
5-
"reporter": "spec",
5+
"reporter": "mocha-multi-reporters",
6+
"reporter-option": "configFile=build/.mocha-multi-reporters.config",
67
"ui": "tdd",
78
"recursive": true,
89
"colors": true,

0 commit comments

Comments
 (0)