Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates code coverage CI to stable #538

Merged
merged 2 commits into from
Apr 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 16 additions & 21 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,30 @@ jobs:

steps:
- name: Git Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: recursive
- name: Rust Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
# Coverage requires the nightly toolchain because it uses the presently unstable `-Z profile` feature
# See: https://github.com/rust-lang/rust/issues/42524
# See also: https://github.com/actions-rs/grcov#usage
toolchain: nightly-2022-12-18 # nightly can be very volatile--pin this to a version we know works well
toolchain: stable
# We need this component to generate source coverage in stable
components: llvm-tools-preview
override: true
- name: Cargo Test
# Wrapper for running coverage with -C instrument-coverage
- name: Cargo Install Coverage Wrapper
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --workspace --all-features --no-fail-fast
env:
CARGO_INCREMENTAL: '0'
# https://github.com/marketplace/actions/rust-grcov
# For some reason the panic=abort modes don't work for build script...
#RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
#RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off'
- id: coverage
name: Code Coverage
uses: actions-rs/grcov@v0.1
command: install
args: cargo-llvm-cov
- name: Cargo Test w/ Coverage
uses: actions-rs/cargo@v1
with:
command: llvm-cov
args: --verbose --workspace --all-features --no-fail-fast --codecov --output-path codecov.json
- name: Codecov Upload
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
files: ${{ steps.coverage.outputs.report }}
files: codecov.json
fail_ci_if_error: true