Skip to content

Commit

Permalink
[ci] also generate coverage report for doctests (#1081)
Browse files Browse the repository at this point in the history
Per #1080.
  • Loading branch information
sunshowers authored Oct 30, 2023
1 parent ef523d1 commit 1f98ee6
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
on:
push:
branches: [ main, auto, canary ]
branches: [main, auto, canary]
pull_request:
branches:
- main
Expand All @@ -18,18 +18,23 @@ jobs:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: dtolnay/rust-toolchain@stable
# Nightly Rust is used for cargo llvm-cov --doc below.
- uses: dtolnay/rust-toolchain@nightly
with:
components: llvm-tools-preview
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2

- name: Install latest nextest release
uses: taiki-e/install-action@nextest
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov

- name: Collect coverage data
run: cargo llvm-cov nextest --lcov --output-path lcov.info
# Generate separate reports for nextest and doctests, and combine them.
run: |
cargo llvm-cov --no-report nextest
cargo llvm-cov --no-report --doc
cargo llvm-cov report --doctests --lcov --output-path lcov.info
- name: Upload coverage data to codecov
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3
with:
Expand Down

0 comments on commit 1f98ee6

Please sign in to comment.