Skip to content

Commit fc5b067

Browse files
committed
ci: add coverage
1 parent 91c73b3 commit fc5b067

2 files changed

Lines changed: 35 additions & 19 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Code Coverage
2+
3+
on:
4+
push:
5+
branches: [ "main", "master" ]
6+
pull_request:
7+
branches: [ "main", "master" ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
coverage:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Install Rust
19+
uses: dtolnay/rust-toolchain@stable
20+
with:
21+
toolchain: stable
22+
components: llvm-tools-preview
23+
24+
- name: Install cargo-llvm-cov
25+
uses: taiki-e/install-action@cargo-llvm-cov
26+
27+
- name: Generate code coverage
28+
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
29+
30+
- name: Upload coverage to Codecov
31+
uses: codecov/codecov-action@v5
32+
with:
33+
token: ${{ secrets.CODECOV_TOKEN }}
34+
slug: atsyplenkov/paperdown
35+
files: lcov.info

.github/workflows/rust-ci.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -65,25 +65,6 @@ jobs:
6565
RUSTDOCFLAGS: -D warnings
6666
run: cargo doc --no-deps --document-private-items --all-features --examples
6767

68-
coverage:
69-
name: Coverage
70-
runs-on: ubuntu-latest
71-
steps:
72-
- name: Checkout repository
73-
uses: actions/checkout@v4
74-
- name: Install Rust toolchain
75-
uses: dtolnay/rust-toolchain@stable
76-
- name: Install cargo-llvm-cov
77-
run: cargo install cargo-llvm-cov
78-
- name: Generate coverage report
79-
run: cargo llvm-cov --all-targets --lcov --output-path lcov.info
80-
- name: Upload to Codecov
81-
uses: codecov/codecov-action@v4
82-
with:
83-
files: lcov.info
84-
fail_ci_if_error: true
85-
token: ${{ secrets.CODECOV_TOKEN }}
86-
8768
publish-dry-run:
8869
name: Publish dry run
8970
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)