ci: Update CI. #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Measure test coverage | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- '**.rs' | |
- '**.toml' | |
- '.github/workflows/**' | |
pull_request: | |
branches: [ main ] | |
paths: | |
- '**.rs' | |
- '**.toml' | |
- '.github/workflows/**' | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup | |
run: | | |
rustup component add llvm-tools-preview | |
cargo install grcov | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Measure test coverage | |
env: | |
RUSTFLAGS: "-Cinstrument-coverage" | |
LLVM_PROFILE_FILE: "coverage-%m-%p.profraw" | |
run: | | |
cargo test --all-features | |
grcov . \ | |
--source-dir . \ | |
--binary-path target/debug \ | |
--branch \ | |
--keep-only 'src/**' \ | |
--output-types "lcov" \ | |
--llvm > coveralls.lcov | |
- name: Upload to Coveralls | |
uses: coverallsapp/github-action@v2 | |
with: | |
format: lcov | |
file: coveralls.lcov |