Skip to content

Integrate code coverage (tarpaulin/llvm-cov) #303

Description

@mroczect

Summary

Set up code coverage reporting in the CI pipeline to track test coverage and ensure it stays above 80%.

Context

Coverage helps identify untested code paths and improve overall quality. cargo-tarpaulin or llvm-cov can be integrated with GitHub Actions.

Tasks

  • Add a CI job using cargo-tarpaulin (or cargo llvm-cov) to generate coverage reports.
  • Configure the job to:
    • Run on push and pull requests.
    • Execute all tests (cargo test --workspace).
    • Generate coverage (e.g., cargo tarpaulin --out Xml --output-dir coverage).
    • Upload coverage to Codecov or Coveralls (optional but recommended).
    • Enforce a minimum coverage threshold (e.g., 80%) using a coverage gate.
  • Add a badge to the README showing the current coverage percentage.
  • Document how to run coverage locally.

Acceptance Criteria

  • Coverage job runs in CI and reports a percentage.
  • The threshold is configured (fails if below 80%).
  • Badge is added to README.

Dependencies

  • All tests from previous phases.

Metadata

Metadata

Assignees

Labels

ciSee issues with this label

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions