Skip to content

Commit f5dd3e8

Browse files
author
Gonzalo Diaz
committed
[Github Actions] coverage splitted
1 parent 9ce9a2a commit f5dd3e8

File tree

1 file changed

+40
-7
lines changed

1 file changed

+40
-7
lines changed
Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
---
12
name: Coverage
23

3-
on: [pull_request, push]
4+
on: # yamllint disable-line rule:truthy
5+
push:
6+
branches: ["main"]
7+
pull_request:
8+
# The branches below must be a subset of the branches above
9+
branches: ["main"]
10+
workflow_dispatch:
411

512
jobs:
613
coverage:
@@ -14,10 +21,36 @@ jobs:
1421
- name: Install cargo-llvm-cov
1522
uses: taiki-e/install-action@cargo-llvm-cov
1623
- name: Generate code coverage
17-
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
18-
- name: Upload coverage to Codecov
19-
uses: codecov/codecov-action@v3
24+
run: >
25+
cargo llvm-cov
26+
--all-features
27+
--workspace
28+
--lcov
29+
--output-path lcov.info
30+
- name: Upload coverage artifact
31+
uses: actions/upload-artifact@v4
2032
with:
21-
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
22-
files: lcov.info
23-
fail_ci_if_error: true
33+
name: coverage-report
34+
path: lcov.info
35+
36+
codecov:
37+
name: Upload to Codecov
38+
runs-on: ubuntu-24.04
39+
needs: coverage
40+
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@v5
44+
with:
45+
fetch-depth: 0
46+
- name: Download coverage artifact
47+
uses: actions/download-artifact@v5
48+
with:
49+
name: coverage-report
50+
51+
- name: Upload coverage reports to Codecov with GitHub Action
52+
uses: codecov/codecov-action@v5
53+
with:
54+
files: coverage.out
55+
token: ${{ secrets.CODECOV_TOKEN }} # required
56+
verbose: true # optional (default = false)

0 commit comments

Comments
 (0)