name: Coverage
on:
pull_request:
paths:
- "src/**"
- "tests/**"
- "Cargo.toml"
- "Cargo.lock"
- ".github/workflows/coverage.yml"
merge_group: {}
workflow_dispatch:
permissions:
contents: read
concurrency:
group: coverage-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
coverage:
name: Statement coverage
if: ${{ !startsWith(github.head_ref, 'release-please') }}
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a with:
egress-policy: audit
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with:
persist-credentials: false
- uses: ./.github/actions/setup-rust
with:
components: llvm-tools
- uses: taiki-e/install-action@ab49d3c64680143e184118bed66a46419fc15519 with:
tool: cargo-llvm-cov@0.8.7
- name: Require 80 percent line coverage
run: cargo llvm-cov --locked --summary-only --fail-under-lines 80