#108: migrate coverage from tarpaulin to cargo-llvm-cov - #136
Open
RAprogramm wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #136 +/- ##
==========================================
+ Coverage 94.09% 97.92% +3.82%
==========================================
Files 14 14
Lines 711 1875 +1164
==========================================
+ Hits 669 1836 +1167
+ Misses 42 39 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #108
This is the coverage part of #103, extracted so it can be reviewed on its own,
without waiting for the Rust atoms work. It implements the tool agreed upon in
that discussion: @hanMaster proposed
cargo-llvm-covon 2025-11-10. Once this ismerged, #103 will be rebased to drop these files and to close #33 alone.
What changed
tarpaulin.ymlbecomescoverage.yml, renamed so the history is kept:actions-rs/tarpaulin@v0.1, unmaintained, Node 20taiki-e/install-action@cargo-llvm-covcargo-tarpaulinpinned to0.22.0, released 2022cargo-llvm-cov, latest at run timelibssl1.1.debfrom the Ubuntu Bionic archive, installed withdpkgonubuntu-24.04llvm-tools-previewcomponent only--exclude-files src/lib.rs--ignore-filename-regex 'src/lib\.rs$'files: lcov.infoTwo leftovers of the old tool go with it: the dead
[lints.rust] unexpected_cfgs = { check-cfg = ['cfg(tarpaulin)'] }inCargo.toml, since nocfg(tarpaulin)exists anywhere insrc, andtarpaulin-report.htmlin.gitignore, replaced bylcov.info. Production codeis untouched and the edition stays at 2021.
Why the upload was failing, and why it stops
cargo-tarpaulinwas never the reasonmasterwas red. Coverage was collectedfine; the upload died on
{"message":"Token required because branch is protected"}, which needs aCODECOV_TOKENsecret. Rather than ask you to add one, the job now authenticateswith GitHub OIDC, which needs no secret at all:
id-token: writeplususe_oidc: true.Pull requests from forks keep working exactly as before. I read the action to be
sure rather than assume:
codecov/codecov-action@v5computesCC_FORKfrom thepull request head repository, and its OIDC step is skipped whenever
CC_FORKistrue, so a fork pull request still takes the tokenless route that worked for#103 in November. This pull request is itself the proof: it comes from a fork,
and Codecov reported its patch and project statuses here. OIDC applies to pushes
into this repository, which is precisely where the protected-branch error was
raised.
The job also declares least-privilege permissions,
contents: readandid-token: write, which OIDC requires anyway.Verification
Every check of this repository was reproduced locally on this branch —
cargo testwith 240 tests including doc-tests,target/debug/fibonacci 7 10,cargo fmt --check,cargo clippy,actionlint,yamllint --strict,reuse lintat42 of 42 files,
typoson the changed files,markdownlint-cli2— and theworkflow itself was run end to end in my fork.
That run is also where the OIDC claim above comes from. Without OIDC the upload
answered
Token required - not valid tokenless upload. With OIDC it obtained a1936-character identity token, the CLI ran with it, and the answer changed to
Repository not found— my fork is simply not a project on Codecov, while thisrepository is. Authentication is therefore no longer the obstacle, which is the
only thing that error message could have been telling us.
The exclusion regex was checked rather than assumed:
cargo-llvm-covmatches thepattern against absolute paths, so an anchored
^src/lib\.rs$would silentlymatch nothing. Substituting
src/perf\.rs$droppedperf.rsfrom the report,14 files down to 13, confirming the suffix form is the one that works.