Skip to content

Commit 6892254

Browse files
committed
Add code coverage in GitHub Actions
1 parent 21e00ca commit 6892254

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

.github/workflows/rust.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,29 @@ env:
1111

1212
jobs:
1313
build:
14-
1514
runs-on: ubuntu-latest
16-
1715
steps:
18-
- uses: actions/checkout@v3
19-
- name: Build
20-
run: cargo build --verbose
21-
- name: Run tests
22-
run: cargo test --tests --verbose --features=unsafe
23-
- name: Run doctests
24-
run: cargo test --doc --verbose --features=unsafe
16+
- uses: actions/checkout@v3
17+
- name: Check format
18+
run: cargo fmt --check
19+
- name: Clippy
20+
run: cargo clippy
21+
- name: Build
22+
run: cargo build --verbose
23+
- name: Run doctests
24+
run: cargo test --doc --verbose --all-features
25+
- uses: dtolnay/rust-toolchain@stable
26+
with:
27+
components: llvm-tools-preview
28+
- name: Install cargo-llvm-cov
29+
uses: taiki-e/install-action@cargo-llvm-cov
30+
- name: Install nextest
31+
uses: taiki-e/install-action@nextest
32+
- name: Generate code coverage
33+
run: cargo llvm-cov nextest --all-features --workspace --lcov --output-path lcov.info
34+
- name: Upload coverage to Codecov
35+
uses: codecov/[email protected]
36+
with:
37+
token: ${{ secrets.CODECOV_TOKEN }}
38+
files: lcov.info
39+
fail_ci_if_error: true

0 commit comments

Comments
 (0)