Add the code coverage job#55
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a dedicated code coverage build/test path and wires it into the existing CI pipeline so coverage reports can be generated and uploaded as artifacts.
Changes:
- Added CMake configure/build/test presets for coverage (hosted + freestanding).
- Introduced a reusable GitHub Actions workflow to run coverage-instrumented tests and generate a gcovr report.
- Hooked the new coverage workflow into the main CI pipeline.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
CMakePresets.json |
Adds coverage and coverage-freestanding configure/build/test presets to enable coverage-instrumented builds. |
.github/workflows/pipeline-ci.yml |
Invokes the new code coverage BVT workflow as an additional CI job. |
.github/workflows/bvt-codecoverage.yml |
New reusable workflow that builds/tests with coverage and uploads gcovr reports as an artifact. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| cmake --build --preset coverage -j | ||
| ctest --preset coverage -j | ||
|
|
||
| - name: Build and run freestanding tests with code coverage instrumentation |
There was a problem hiding this comment.
Shall we count coverage of freestanding separately?
| echo '```' | ||
| } >> "$GITHUB_STEP_SUMMARY" | ||
|
|
||
| - name: Upload code coverage report |
There was a problem hiding this comment.
Shall we use GitHub integration actions/upload-code-coverage?
| --xml-pretty --output build/coverage/report/coverage.xml \ | ||
| --html-details build/coverage/report/coverage.html \ | ||
| build/coverage build/coverage-freestanding \ | ||
| | tee build/coverage/report/summary.txt |
There was a problem hiding this comment.
I reviewed the generated coverage.function.html, looks like most "uncovered" functions are just template instantiations from unit tests/doc examples/benchmarks. The more instantiations there are, the less function coverage there will be. I think we should turn off function coverage if possible - it's meaningless for a template library.
What
Adds a dedicated code coverage job to the CI pipeline. It builds the tests with GCC coverage instrumentation, runs both the hosted and freestanding test suites, generates a coverage report scoped to the public headers (
include/proxy/), publishes a summary to the workflow run page, and uploads the full report as an artifact.Samples