CI: use grcov #23
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: Continuous integration | |
on: | |
push: | |
branches: [ master, grcov-test ] | |
pull_request: | |
branches: [ master ] | |
env: | |
CARGO_TERM_COLOR: always | |
CARGO_INCREMENTAL: 0 | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
continue-on-error: false | |
strategy: | |
matrix: | |
rust: | |
- 1.63.0 | |
- stable | |
- beta | |
- nightly | |
include: | |
- rust: nightly | |
coverage: 'send' | |
components: llvm-tools | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
- name: Install ${{ matrix.rust }} toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: ${{ matrix.rust }} | |
components: ${{ matrix.components }} | |
override: true | |
- name: Install grcov | |
if: matrix.coverage == 'send' | |
uses: actions-rs/install@v0.1 | |
with: | |
crate: grcov | |
version: latest | |
use-tool-cache: true | |
- name: Tests | |
env: | |
RUSTFLAGS: '-D warnings' | |
run: | | |
cargo build --verbose --no-default-features | |
cargo test --verbose --no-default-features | |
cargo build --verbose --no-default-features --features=lz | |
cargo test --verbose --no-default-features --features=lz | |
cargo build --verbose --no-default-features --features=lh1 | |
cargo test --verbose --no-default-features --features=lh1 | |
cargo build --verbose --all-features | |
cargo test --verbose --all-features | |
- name: Coverage | |
if: matrix.coverage == 'send' | |
env: | |
LLVM_PROFILE_FILE: "delharc-%p-%m.profraw" | |
RUSTFLAGS: "-Cinstrument-coverage" | |
run: | | |
cargo build --verbose --all-features | |
cargo test --verbose --all-features | |
grcov . \ | |
--binary-path ./target/debug/ \ | |
--branch \ | |
--output-types lcov \ | |
--source-dir . \ | |
--output-path ./lcov.info \ | |
--ignore-not-existing \ | |
--keep-only 'src/*' \ | |
--commit-sha ${{ github.sha }} \ | |
--service-job-id ${{ github.job }} \ | |
--service-name "GitHub Actions" \ | |
--service-number ${{ github.run_id }} | |
- name: Upload coverage as artifact | |
if: matrix.coverage == 'send' | |
uses: actions/upload-artifact@v2 | |
with: | |
name: lcov.info | |
path: ./lcov.info | |
if-no-files-found: error | |
- name: Upload coverage to Coveralls | |
if: matrix.coverage == 'send' | |
uses: coverallsapp/github-action@v2 | |
with: | |
file: lcov.info | |
format: lcov |