Skip to content

Commit 985ff1c

Browse files
committed
ci: measure code coverage.
This adds a CI workflow task that will measure code coverage and upload it to codecov.io. We don't configure this task to fail CI if there is an error, it is a best-effort process.
1 parent f21c655 commit 985ff1c

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,26 @@ jobs:
7777
run: cargo test --verbose --features x509-parser
7878
- name: Run cargo doc
7979
run: cargo doc --all --all-features
80+
81+
coverage:
82+
name: Measure coverage
83+
runs-on: ubuntu-latest
84+
steps:
85+
- name: Checkout sources
86+
uses: actions/checkout@v3
87+
with:
88+
persist-credentials: false
89+
- name: Install cargo-llvm-cov
90+
uses: taiki-e/install-action@cargo-llvm-cov
91+
- name: Install rust toolchain
92+
uses: dtolnay/rust-toolchain@nightly
93+
with:
94+
components: llvm-tools
95+
- name: Measure coverage
96+
run: cargo llvm-cov --all-features --lcov --output-path ./lcov.info
97+
- name: Report to codecov.io
98+
uses: codecov/codecov-action@v3
99+
with:
100+
files: ./lcov.info
101+
fail_ci_if_error: false
102+
verbose: true

0 commit comments

Comments
 (0)