Skip to content

Commit 0e6ebab

Browse files
authored
Push code coverage to codecov (#21)
1 parent 3ee86fd commit 0e6ebab

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

.github/workflows/_rust.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,17 @@ jobs:
4848
with:
4949
toolchain: stable
5050
- uses: Swatinem/rust-cache@v2
51-
52-
- name: Build Everything
53-
run: cargo build --all-targets
54-
- name: Run tests
55-
run: cargo test --all-targets --verbose
51+
- name: Install cargo-llvm-cov
52+
uses: taiki-e/install-action@cargo-llvm-cov
53+
- name: Run tests and generate code coverage
54+
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
55+
- name: Upload coverage to Codecov
56+
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5
57+
with:
58+
files: lcov.info
59+
fail_ci_if_error: true
60+
env:
61+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
5662
# Ensure that no files (most likely the Cargo.lock file) have changed
5763
- name: Unstaged Changes
5864
run: git diff --exit-code

0 commit comments

Comments
 (0)