Skip to content

[CI] Display test coverage in CI results #529

@Miou-zora

Description

@Miou-zora

Problem Statement

Test coverage is not currently reported in CI results. After a pipeline run, there is no visibility into which parts of the codebase are covered by tests, making it hard to track regression risks or set coverage improvement goals.

Proposed Solution

Integrate a test coverage reporting step into the CI pipeline that:

  1. Runs the test suite with coverage instrumentation (e.g. gcov/lcov for GCC, or llvm-cov for Clang).
  2. Generates a coverage report.
  3. Displays the coverage percentage directly in the CI job summary or as a PR comment.
  4. Optionally uploads the report to a coverage hosting service (e.g. Codecov or Coveralls) and adds a badge to the README.

Alternative Solutions

  • Only generate a coverage report locally and document how to run it — no CI change, but results are not visible to reviewers.
  • Use a third-party GitHub App for coverage tracking — less control over the setup.

Use Cases

  • Use case 1: A reviewer checking a PR immediately sees whether the change maintains or improves coverage.
  • Use case 2: A maintainer sets a minimum coverage threshold and the CI fails if it drops below it.
  • Use case 3: The README displays an up-to-date coverage badge giving external contributors an instant quality signal.

Impact

  • CI workflow changes only — no changes to source code.
  • Slightly increased CI build time due to coverage instrumentation.
  • No breaking changes.

Implementation Details (optional)

  • Add a CMake/xmake configuration option to build with coverage flags (--coverage or -fprofile-instr-generate -fcoverage-mapping).
  • Add a CI step to generate the report and post it as a job summary using lcov + genhtml or llvm-cov show.
  • Integrate with Codecov by adding codecov/codecov-action to the workflow and a codecov.yml config file.

Additional Context

N/A

Related Issues

  • N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    ciEverything related to continous integration

    Type

    No type

    Projects

    Status

    Not planned

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions