Skip to content

Coverage

Coverage #45

Workflow file for this run

name: Coverage
on:
schedule:
- cron: '0 2 * * *' # Nightly at 02:00 UTC
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
coverage:
name: Generate Coverage Report
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup workspace dependencies
run: |
chmod +x scripts/setup-workspace.sh
./scripts/setup-workspace.sh
- name: Install protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.91.0
- name: Show Rust versions
run: |
rustc --version
cargo --version
- name: Install required components
run: |
rustup component add rustfmt
rustup component add clippy
rustup component add llvm-tools-preview
- name: Install cargo-llvm-cov
run: cargo install cargo-llvm-cov --locked
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-coverage-cargo-registry-${{ hashFiles('Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-coverage-cargo-index-${{ hashFiles('Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-coverage-cargo-build-${{ hashFiles('Cargo.lock') }}
- name: Run coverage script (full clean)
run: ./coverage.sh --full-clean
- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: coverage-html
path: target/llvm-cov/html
- name: Upload LCOV file
uses: actions/upload-artifact@v4
with:
name: coverage-lcov
path: target/coverage/lcov.info