Skip to content

Commit

Permalink
workflow: add codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
KevFan committed Jul 25, 2023
1 parent 775596d commit 4318d9b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,33 @@ jobs:
with:
command: test
args: --all-features
env:
LLVM_PROFILE_FILE: "target/coverage/prof/%p-%m.profraw"
RUSTFLAGS: "-Cinstrument-coverage"
- name: Install grcov
uses: taiki-e/install-action@v2
with:
tool: grcov
- name: Create coverage report
run: |
grcov \
--source-dir . \
--binary-path target/debug \
--branch \
--excl-start 'mod tests \{' \
--ignore 'tests/*' \
-t lcov \
-o lcov.info \
target/coverage/prof
# - name: Install cargo-llvm-cov
# uses: taiki-e/install-action@cargo-llvm-cov
# - name: Test and Generate code coverage
# run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Codecov
uses: codecov/codecov-action@v3
with:
verbose: true
fail_ci_if_error: true

fmt:
name: Rustfmt
Expand Down

0 comments on commit 4318d9b

Please sign in to comment.