name: Coverage
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
coveralls:
name: Coveralls GitHub Action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Install grcov
uses: SierraSoftworks/setup-grcov@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: latest
- name: Run grcov
env:
PROJECT_NAME: "descape"
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off"
CARGO_INCREMENTAL: 0
run: |
cargo build --verbose
cargo test --verbose
zip -0 cov.zip $(find . -name "$PROJECT_NAME*.gc*" -print)
grcov cov.zip -s . -t lcov --llvm --ignore-not-existing --ignore "/*" -o lcov.info
- name: Push grcov results to Coveralls via GitHub Action
uses: coverallsapp/github-action@v1.0.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "lcov.info"