1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Code Coverage
on:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-coverage-${{ hashFiles('**/Cargo.lock') }}
- name: Install tarpaulin
uses: taiki-e/install-action@cargo-tarpaulin
- name: Generate coverage reports
run: |
# Exclude mrrc-python (PyO3 bindings) as it requires Python linking
# Focus coverage on the core mrrc library
cargo tarpaulin --out Xml Html --package mrrc --timeout 300 --exclude-files examples/ --exclude-files tests/
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v6
with:
files: ./cobertura.xml
flags: unit-tests
fail_ci_if_error: false
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage artifacts
uses: actions/upload-artifact@v7
if: always()
with:
name: coverage-report
path: tarpaulin-report.html