name: Coverage
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
coverage:
name: coverage
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Install stable toolchain with llvm-tools
run: |
set -euo pipefail
rustup update stable
rustup default stable
rustup component add llvm-tools-preview
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-coverage-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-coverage-
${{ runner.os }}-cargo-
- name: Install cargo-llvm-cov
run: cargo install cargo-llvm-cov --version "0.6.16" --locked
- name: Generate coverage report
run: cargo llvm-cov --locked --all-features --lcov --output-path lcov.info