mirror of
https://github.com/tiffany352/rink-rs
synced 2024-11-10 05:34:14 +00:00
Fix code coverage (#175)
This commit is contained in:
parent
6e0b42e658
commit
4123b75031
1 changed files with 17 additions and 37 deletions
54
.github/workflows/coverage.yml
vendored
54
.github/workflows/coverage.yml
vendored
|
@ -10,43 +10,23 @@ env:
|
|||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
build:
|
||||
coverage:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
steps:
|
||||
# the action needs a nightly toolchain with llvm-tools
|
||||
- uses: actions-rs/toolchain@v1
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install Rust
|
||||
run: rustup update stable
|
||||
- name: Install cargo-llvm-cov
|
||||
uses: taiki-e/install-action@cargo-llvm-cov
|
||||
- name: Generate code coverage
|
||||
# rink-sandbox causes corrupted .profraw files for some reason,
|
||||
# so don't test it. test everything else.
|
||||
run: cargo llvm-cov --all-features -p rink-core -p rink -p rink-js --lcov --output-path lcov.info
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: nightly
|
||||
components: llvm-tools-preview
|
||||
|
||||
- name: Install grcov
|
||||
run:
|
||||
cargo +nightly install grcov
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Build
|
||||
env:
|
||||
RUSTFLAGS: "-C instrument-coverage"
|
||||
run:
|
||||
cargo +nightly test --all --no-run
|
||||
|
||||
- name: Run tests
|
||||
env:
|
||||
RUSTFLAGS: "-C instrument-coverage"
|
||||
LLVM_PROFILE_FILE: "coverage-%p-%m.profraw"
|
||||
run:
|
||||
cargo +nightly test --all --no-fail-fast
|
||||
|
||||
- name: Process coverage info
|
||||
env:
|
||||
RUSTUP_TOOLCHAIN: nightly
|
||||
run:
|
||||
grcov **/*.profraw --binary-path ./target/debug -t lcov -o lcov.info
|
||||
|
||||
# afterwards, upload the report to codecov
|
||||
- uses: codecov/codecov-action@v2
|
||||
with:
|
||||
files: ./lcov.info
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: lcov.info
|
||||
fail_ci_if_error: true
|
||||
|
|
Loading…
Reference in a new issue