diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 940b443b8f..6a9f7ce905 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,6 +91,23 @@ jobs: - name: Run tests run: npm test + env: + VSC_JUPYTER_INSTRUMENT_CODE_FOR_COVERAGE: true + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage/lcov.info + fail_ci_if_error: true + + - name: Upload test results to Codecov + if: '!cancelled()' + uses: codecov/test-results-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: test-report.xml + fail_ci_if_error: true - name: Check dependencies run: npm run checkDependencies diff --git a/src/test/coverage.node.ts b/src/test/coverage.node.ts index ef2160d581..882e86ce9d 100644 --- a/src/test/coverage.node.ts +++ b/src/test/coverage.node.ts @@ -14,7 +14,7 @@ export function setupCoverage() { return; } const htmlReport = process.env.VSC_JUPYTER_INSTRUMENT_CODE_FOR_COVERAGE_HTML ? ['html'] : []; - const reports = htmlReport.concat(['text', 'text-summary']); + const reports = htmlReport.concat(['text', 'text-summary', 'lcov']); const NYC = require('nyc'); const nyc = new NYC({ cwd: path.join(EXTENSION_ROOT_DIR_FOR_TESTS),