ci: add test coverage reporting with codecov (#3848)
This commit is contained in:
parent
21dfe7f2fc
commit
e61394a97a
|
@ -0,0 +1,11 @@
|
||||||
|
comment: false
|
||||||
|
coverage:
|
||||||
|
status:
|
||||||
|
project:
|
||||||
|
default:
|
||||||
|
target: auto
|
||||||
|
threshold: 5%
|
||||||
|
patch:
|
||||||
|
default:
|
||||||
|
target: auto
|
||||||
|
threshold: 5%
|
|
@ -177,9 +177,13 @@ jobs:
|
||||||
uses: actions-rs/toolchain@v1.0.7
|
uses: actions-rs/toolchain@v1.0.7
|
||||||
with:
|
with:
|
||||||
toolchain: ${{ matrix.rust }}
|
toolchain: ${{ matrix.rust }}
|
||||||
|
components: llvm-tools-preview
|
||||||
profile: minimal
|
profile: minimal
|
||||||
override: true
|
override: true
|
||||||
|
|
||||||
|
- name: Install cargo-llvm-cov
|
||||||
|
uses: taiki-e/install-action@cargo-llvm-cov
|
||||||
|
|
||||||
# Install Mercurial (pre-installed on Linux and windows)
|
# Install Mercurial (pre-installed on Linux and windows)
|
||||||
- name: Setup | Mercurial (macos)
|
- name: Setup | Mercurial (macos)
|
||||||
if: matrix.os == 'macOS-latest'
|
if: matrix.os == 'macOS-latest'
|
||||||
|
@ -187,7 +191,18 @@ jobs:
|
||||||
|
|
||||||
# Run the ignored tests that expect the above setup
|
# Run the ignored tests that expect the above setup
|
||||||
- name: Build | Test
|
- name: Build | Test
|
||||||
run: cargo test --workspace --locked --all-features -- -Z unstable-options --include-ignored
|
run: "cargo llvm-cov
|
||||||
|
--all-features
|
||||||
|
--locked
|
||||||
|
--workspace
|
||||||
|
--lcov --output-path lcov.info
|
||||||
|
-- --include-ignored"
|
||||||
env:
|
env:
|
||||||
# Avoid -D warnings on nightly builds
|
# Avoid -D warnings on nightly builds
|
||||||
RUSTFLAGS: ""
|
RUSTFLAGS: ""
|
||||||
|
|
||||||
|
- name: Upload coverage to Codecov
|
||||||
|
uses: codecov/codecov-action@v3
|
||||||
|
with:
|
||||||
|
files: lcov.info
|
||||||
|
fail_ci_if_error: true
|
||||||
|
|
Loading…
Reference in New Issue