Skip to content

Commit

Permalink
workflow: aggregate coverage using grcov
Browse files Browse the repository at this point in the history
  • Loading branch information
KevFan committed Jul 25, 2023
1 parent 878cd6c commit 84e455d
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,32 @@ jobs:
- uses: abelfodil/protoc-action@v1
with:
protoc-version: '3.19.4'
- 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
- uses: actions-rs/cargo@v1
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:
Expand Down

0 comments on commit 84e455d

Please sign in to comment.