diff --git a/.changesets/maint_coverage.md b/.changesets/maint_coverage.md new file mode 100644 index 00000000..bc2e4c60 --- /dev/null +++ b/.changesets/maint_coverage.md @@ -0,0 +1,3 @@ +### Implement Test Coverage Measurement and Reporting - @DaleSeo PR #335 + +This PR adds the bare minimum for code coverage reporting using [cargo-llvm-cov](https://crates.io/crates/cargo-llvm-cov) and integrates with [Codecov](https://www.codecov.io/). It adds a new `coverage` job to the CI workflow that generates and uploads coverage reporting in parallel with existing tests. The setup mirrors that of Router, except it uses `nextest` instead of the built-in test runner and CircleCI instead of GitHub Actions. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ba78966..bc4d26c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,3 +124,22 @@ jobs: gc-max-store-size: 5G - name: Run Tests run: 'nix develop --command bash -c "cargo test"' + + coverage: + name: Run Coverage + runs-on: ubuntu-24.04 + permissions: + contents: read + steps: + - uses: actions/checkout@v5 + with: + ref: ${{ github.event.pull_request.head.sha }} + - uses: taiki-e/install-action@cargo-llvm-cov + - name: Generate code coverage + run: cargo llvm-cov --all-features --workspace --codecov --output-path codecov.json + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos + files: codecov.json + fail_ci_if_error: true