ci: aggregate cross-OS coverage via cargo-llvm-cov#168
Conversation
Replace the Linux-only cargo-tarpaulin job with cargo-llvm-cov folded into the test matrix. Coverage is now collected on Linux, macOS, and Windows and merged by Codecov (after_n_builds: 3), so OS-specific branches are counted. The test suite no longer runs twice per commit.
Dependency ReviewThe following issues were found:
License Issues.github/workflows/ci.yml
OpenSSF Scorecard
Scanned Files
|
There was a problem hiding this comment.
Pull request overview
This PR updates the CI pipeline to generate and upload cross-OS code coverage by replacing the prior Linux-only cargo-tarpaulin approach with cargo-llvm-cov integrated into the existing test matrix, enabling Codecov to aggregate coverage across Linux/macOS/Windows.
Changes:
- Adds a
codecov.ymlconfiguration to define OS-specific flags and wait for 3 uploads before notifying. - Updates the
testjob matrix to installcargo-llvm-cov, run tests under coverage, and upload an LCOV report to Codecov with OS flags. - Removes the standalone Linux-only tarpaulin coverage job.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
codecov.yml |
Adds Codecov config for OS-flagged uploads and aggregation timing (after_n_builds: 3). |
.github/workflows/ci.yml |
Switches matrix tests to run under cargo-llvm-cov and upload per-OS LCOV reports; removes tarpaulin coverage job. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Use explicit taiki-e/install-action@v2 + tool: input instead of the tool-name ref shorthand (clearer, pins the action major). - Add carryforward to per-OS flags so a flaky upload on one OS doesn't tank the merged number. - Drop after_n_builds (left the coverage status pending if a matrix leg failed before uploading) and the redundant per-flag src/ paths. - Add concurrency to cancel superseded CI runs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #168 +/- ##
==========================================
+ Coverage 81.87% 90.84% +8.96%
==========================================
Files 29 29
Lines 4684 10691 +6007
==========================================
+ Hits 3835 9712 +5877
- Misses 849 979 +130
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Why
The
coveragejob rancargo-tarpaulinonubuntu-latestonly, because tarpaulin is Linux-only (ptrace-based) and can't join the test matrix. Two problems followed:cfg!(target_os = "macos")/"windows"arms insrc/providers/mod.rs:90-102and#[cfg(unix)]inscanner.rs. Codecov reported a Linux number, not the project's.testacross all three OSes, then again from scratch under tarpaulin.Changes
cargo-llvm-cov(source-based, cross-platform) and fold coverage into thetestmatrix, so tests run once per OS and emit coverage in the same pass.flags: os-${{ runner.os }}. Codecov merges the per-commit reports into one aggregated figure that includes the OS-specific branches.carryforward: trueon each flag (in the newcodecov.yml) keeps the merged number stable if one OS upload is missing, instead of letting it drop.coveragejob and the now-redundantcargo buildstep (llvm-cov builds its own instrumented binary in a separate target dir).The e2e tests that shell out to the binary now count toward coverage too:
assert_cmd::Command::cargo_binresolvesCARGO_BIN_EXE_*to llvm-cov's instrumented build. Tarpaulin missed those.Verification
Real check is this PR's own run: confirm the
testjob collects coverage on all three OSes, the old job is gone, Codecov receives three uploads, and the macOS/Windows arms insrc/providers/mod.rsnow show as covered.