Skip to content

Commit a2ab7b7

Browse files
feloyclaude
andauthored
ci: add coverage reporting to pr-check workflow (#14)
* ci: add coverage reporting to pr-check workflow Run cargo-llvm-cov on Ubuntu only and upload the resulting LCOV report to Codecov via codecov/codecov-action. The three coverage steps are guarded by `if: matrix.os == 'ubuntu-24.04'` so macOS and Windows matrix legs are unaffected. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Philippe Martin <phmartin@redhat.com> * chore: add kaiden workspace config with cargo-llvm-cov feature Adds a Kaiden workspace definition that provisions Rust and a custom cargo-llvm-cov devcontainer feature, making coverage tools available in the development environment out of the box. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Philippe Martin <phmartin@redhat.com> --------- Signed-off-by: Philippe Martin <phmartin@redhat.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 28764d9 commit a2ab7b7

4 files changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/pr-check.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,20 @@ jobs:
5252

5353
- name: Test
5454
run: cargo test
55+
56+
- name: Install cargo-llvm-cov
57+
if: matrix.os == 'ubuntu-24.04'
58+
uses: taiki-e/install-action@65851e10cd6c377f11a60e600abc07cb08643468 # v2.79.3
59+
with:
60+
tool: cargo-llvm-cov
61+
62+
- name: Generate coverage report
63+
if: matrix.os == 'ubuntu-24.04'
64+
run: cargo llvm-cov --lcov --output-path lcov.info
65+
66+
- name: Upload coverage to Codecov
67+
if: matrix.os == 'ubuntu-24.04'
68+
uses: codecov/codecov-action@cddd853df119a48c5be31a973f8cd97e12e35e16 # v6.0.1
69+
with:
70+
files: lcov.info
71+
token: ${{ secrets.CODECOV_TOKEN }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"id": "cargo-llvm-cov",
3+
"version": "1.0.0",
4+
"name": "cargo-llvm-cov",
5+
"description": "Installs cargo-llvm-cov for LLVM-based code coverage",
6+
"containerEnv": {
7+
"CARGO_HOME": "/home/agent/.cargo"
8+
},
9+
"installsAfter": [
10+
"ghcr.io/devcontainers/features/rust"
11+
]
12+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
set -e
3+
4+
cargo +stable install cargo-llvm-cov --locked
5+
rustup component add llvm-tools-preview --toolchain stable

.kaiden/workspace.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"features": {
3+
"ghcr.io/devcontainers/features/rust:1": {},
4+
"./features/cargo-llvm-cov": {}
5+
}
6+
}

0 commit comments

Comments
 (0)