Skip to content

Code coverage with grcov #1067

Code coverage with grcov

Code coverage with grcov #1067

Workflow file for this run

name: Code coverage with grcov
on:
# Run at every day at 2:15.
schedule:
- cron: '15 2 * * *'
# Also run then this file is changed.
push:
paths:
- '.github/workflows/coverage.yaml'
# Also run manually from the Actions tab
workflow_dispatch:
jobs:
coverage:
name: Coverage
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- name: Checkout sources
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libmagic-dev
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --features=magic-module,rules-profiling --workspace --lib --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true