Skip to content

Commit 36a4ab4

Browse files
feat: add codecov integration with test results upload
- Add lcov reporter to nyc configuration for codecov compatibility - Add codecov upload steps to CI workflow for coverage and test results - Configure fail_ci_if_error: false to not block CI on codecov issues Project already has .github/codecov.yml with project and patch coverage checks configured.
1 parent 574e270 commit 36a4ab4

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,20 @@ jobs:
9292
- name: Run tests
9393
run: npm test
9494

95+
- name: Upload coverage to Codecov
96+
uses: codecov/codecov-action@v5
97+
with:
98+
token: ${{ secrets.CODECOV_TOKEN }}
99+
files: coverage/lcov.info
100+
fail_ci_if_error: false
101+
102+
- name: Upload test results to Codecov
103+
if: '!cancelled()'
104+
uses: codecov/test-results-action@v1
105+
with:
106+
token: ${{ secrets.CODECOV_TOKEN }}
107+
files: test-report.xml
108+
95109
- name: Check dependencies
96110
run: npm run checkDependencies
97111
continue-on-error: true

src/test/coverage.node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function setupCoverage() {
1414
return;
1515
}
1616
const htmlReport = process.env.VSC_JUPYTER_INSTRUMENT_CODE_FOR_COVERAGE_HTML ? ['html'] : [];
17-
const reports = htmlReport.concat(['text', 'text-summary']);
17+
const reports = htmlReport.concat(['text', 'text-summary', 'lcov']);
1818
const NYC = require('nyc');
1919
const nyc = new NYC({
2020
cwd: path.join(EXTENSION_ROOT_DIR_FOR_TESTS),

0 commit comments

Comments
 (0)