on:
pull_request:
push:
branches:
- master
name: Code coverage with grcov
jobs:
grcov:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Clean
uses: actions-rs/cargo@v1
with:
command: clean
- name: Execute tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads"
- name: Gather coverage data
id: coverage
uses: actions-rs/grcov@v0.1
with:
config: configs/grcov.config.yml
coveralls-token: ${{ secrets.COVERALLS_TOKEN }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ${{ steps.coverage.outputs.report }}
fail_ci_if_error: true