Skip to content

Commit

Permalink
nextest with coverage
Browse files Browse the repository at this point in the history
drink7036290 committed Nov 25, 2024
1 parent 50dc339 commit b14e284
Showing 2 changed files with 42 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -25,9 +25,47 @@ jobs:
runs-on: ubuntu-latest
needs:
- tests
- nextest_with_coverage
steps:
- run: exit 0

nextest_with_coverage:
name: nextest_with_coverage
needs:
- basics
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Nightly Rust is used for cargo llvm-cov --doc below.
- name: Install Rust ${{ env.rust_nightly }}
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.rust_nightly }}
components: llvm-tools-preview
- uses: Swatinem/rust-cache@v2

- name: Install cargo-nextest
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov

- name: Collect coverage data
# 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@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: lcov.info

tests:
name: tests
runs-on: ubuntu-latest
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -5,3 +5,7 @@ Cargo.lock
.cargo/config

.vscode/

# coverage
**/*.profraw
lcov.info

0 comments on commit b14e284

Please sign in to comment.