Skip to content

More ergonomics

More ergonomics #180

Workflow file for this run

name: CI - Coverage
on:
push:
branches: [main]
paths:
- '**.rs'
- '**/Cargo.toml'
- '**/Cargo.lock'
- '.github/workflows/ci-coverage.yml'
pull_request:
branches: [main]
paths:
- '**.rs'
- '**/Cargo.toml'
- '**/Cargo.lock'
- '.github/workflows/ci-coverage.yml'
workflow_dispatch:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
coverage:
name: Code Coverage (tarpaulin)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Install cargo-tarpaulin
uses: ./.github/actions/install-cargo-tool
with:
tool: cargo-tarpaulin
- name: Cache cargo registry and build
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: coverage-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
coverage-${{ runner.os }}-cargo-
# Note: sccache is intentionally NOT used here because cargo-tarpaulin
# needs direct control over the compilation process to instrument code
# for coverage collection. Using RUSTC_WRAPPER breaks tarpaulin.
#
# Multi-process network tests are skipped because:
# 1. They spawn external processes which doesn't work well under instrumentation
# 2. The overhead causes timeouts (default 60s is insufficient)
# 3. These tests are thoroughly exercised in ci-network.yml with proper timeouts
#
# --exclude-files removes code from coverage report
# -- --skip multi_process passes skip argument to test executable
- name: Run coverage (tarpaulin)
run: cargo tarpaulin --out Xml --exclude-files 'tests/network/multi_process.rs' -- --skip multi_process
- name: Upload coverage report
uses: actions/upload-artifact@v6
with:
name: coverage-xml
path: cobertura.xml
# Upload coverage to Codecov for PR comments, historical tracking, and badge generation
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: cobertura.xml
fail_ci_if_error: false
verbose: true