Skip to content

Commit 32e4e6c

Browse files
nficanoclaude
andauthored
ci: collect + upload coverage with cargo-llvm-cov (#64)
Run cargo-llvm-cov (prebuilt binary via taiki-e/install-action) on the `stable` matrix entry to emit lcov.info, then upload to Codecov non-blockingly. MSRV entry is unchanged. Requires CODECOV_TOKEN to be set as a repo secret. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent bfb9732 commit 32e4e6c

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,32 @@ jobs:
8383
- name: cargo test
8484
run: cargo test --all-targets --all-features
8585

86+
# Coverage is collected from the `stable` matrix entry only — the
87+
# report is the same on every Rust version. cargo-llvm-cov drives
88+
# llvm-cov over the existing test invocation (no separate test run).
89+
# taiki-e/install-action provides prebuilt binaries to avoid a long
90+
# source compile. Non-blocking so a Codecov outage cannot break CI.
91+
- name: Install cargo-llvm-cov
92+
if: matrix.rust == 'stable'
93+
# taiki-e/install-action v2.79.7
94+
uses: taiki-e/install-action@d9be7d8cda89035c9c843f78bd44d4f72d8403d4 # v2.79.7
95+
with:
96+
tool: cargo-llvm-cov
97+
98+
- name: cargo llvm-cov (lcov)
99+
if: matrix.rust == 'stable'
100+
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
101+
102+
- name: Upload coverage to Codecov
103+
if: matrix.rust == 'stable'
104+
# codecov/codecov-action v6.0.1
105+
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
106+
with:
107+
fail_ci_if_error: false
108+
flags: unittests
109+
files: ./lcov.info
110+
token: ${{ secrets.CODECOV_TOKEN }}
111+
86112
- name: Upload test artifacts on failure
87113
if: failure()
88114
uses: actions/upload-artifact@v7

0 commit comments

Comments
 (0)