forked from torrust/torrust-index
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add upload coverage report to codecov
- Loading branch information
1 parent
277a905
commit db1612c
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Upload Code Coverage | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: nightly | ||
components: rustfmt, llvm-tools-preview | ||
- name: Build | ||
run: cargo build --release | ||
env: | ||
CARGO_INCREMENTAL: "0" | ||
RUSTFLAGS: "-Cinstrument-coverage" | ||
RUSTDOCFLAGS: "-Cinstrument-coverage" | ||
- name: Test | ||
run: cargo test --all-features --no-fail-fast | ||
env: | ||
CARGO_INCREMENTAL: "0" | ||
RUSTFLAGS: "-Cinstrument-coverage" | ||
RUSTDOCFLAGS: "-Cinstrument-coverage" | ||
- name: Install grcov | ||
run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi | ||
- name: Run grcov | ||
run: grcov . --binary-path target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '../**' --ignore '/*' -o coverage.lcov | ||
- uses: codecov/codecov-action@v3 | ||
with: | ||
files: ./coverage.lcov | ||
flags: rust | ||
fail_ci_if_error: true # optional (default = false) |