Skip to content

Commit

Permalink
ci: add upload coverage report to codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
josecelano committed Jul 3, 2023
1 parent 277a905 commit db1612c
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/codecov.yml
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)

0 comments on commit db1612c

Please sign in to comment.