Skip to content

Commit c69b8e9

Browse files
committed
ci: move coverage to own workflow
1 parent 9f59093 commit c69b8e9

File tree

2 files changed

+37
-22
lines changed

2 files changed

+37
-22
lines changed

.github/workflows/ci-post-merge.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -103,28 +103,6 @@ jobs:
103103
cargo install cargo-cache --version 0.6.2 --no-default-features --features ci-autoclean
104104
cargo-cache
105105
106-
coverage:
107-
name: coverage
108-
runs-on: ubuntu-latest
109-
steps:
110-
- uses: actions/checkout@v3
111-
112-
- name: Install Rust (nightly)
113-
uses: actions-rust-lang/setup-rust-toolchain@v1
114-
with: { toolchain: nightly }
115-
116-
- name: Install cargo-tarpaulin
117-
uses: taiki-e/install-action@v1
118-
with: { tool: cargo-tarpaulin }
119-
120-
- name: Generate coverage file
121-
if: github.ref == 'refs/heads/master'
122-
run: cargo tarpaulin --out Xml --verbose
123-
- name: Upload to Codecov
124-
if: github.ref == 'refs/heads/master'
125-
uses: codecov/codecov-action@v3
126-
with: { files: cobertura.xml }
127-
128106
minimal-versions:
129107
name: minimal versions
130108
runs-on: ubuntu-latest

.github/workflows/coverage.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
branches: [master]
6+
7+
permissions:
8+
contents: read
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
coverage:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Install Rust
21+
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
22+
with:
23+
components: llvm-tools-preview
24+
25+
- name: Install cargo-llvm-cov
26+
uses: taiki-e/install-action@v2.18.9
27+
with:
28+
tool: cargo-llvm-cov
29+
30+
- name: Generate code coverage
31+
run: cargo llvm-cov --workspace --all-features --codecov --output-path codecov.json
32+
33+
- name: Upload coverage to Codecov
34+
uses: codecov/codecov-action@v3.1.4
35+
with:
36+
files: codecov.json
37+
fail_ci_if_error: true

0 commit comments

Comments
 (0)