Skip to content

Commit 04ecd37

Browse files
author
Johanna
committed
add codecov to work on any branch
1 parent 5eef2ec commit 04ecd37

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

.github/workflows/codecov.yml

+16-17
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@ name: Rust codecov
22

33
on:
44
push:
5-
branches: [ "master" ]
5+
branches: [ '*' ] # Run on all branches
66
pull_request:
7-
branches: [ "master" ]
7+
branches: [ '*' ] # Run on PRs to all branches
88

99
env:
1010
CARGO_TERM_COLOR: always
1111

1212
jobs:
1313
build:
14-
1514
runs-on: ubuntu-latest
1615

1716
steps:
@@ -20,27 +19,27 @@ jobs:
2019
with:
2120
toolchain: nightly
2221
override: true
22+
components: llvm-tools-preview # Required for grcov
23+
2324
- name: Build
2425
run: cargo build --verbose
26+
2527
- name: Run tests
2628
run: cargo test --verbose --no-fail-fast
2729
env:
2830
CARGO_INCREMENTAL: '0'
2931
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
3032
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
31-
- name: rust-grcov
32-
# You may pin to the exact commit or the version.
33-
# uses: actions-rs/grcov@bb47b1ed7883a1502fa6875d562727ace2511248
34-
uses: actions-rs/[email protected]
35-
with:
36-
config: .github/config/grcov.yml
37-
- name: Codecov
38-
# You may pin to the exact commit or the version.
39-
# uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378
40-
uses: codecov/[email protected]
33+
34+
- name: Run grcov
35+
run: |
36+
cargo install grcov
37+
grcov . -s . --binary-path ./target/debug/ -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
38+
39+
- name: Upload coverage to Codecov
40+
uses: codecov/codecov-action@v3
4141
with:
42-
# Repository upload token - get it from codecov.io. Required only for private repositories
4342
token: ${{ secrets.CODECOV_TOKEN }}
44-
# Specify whether the Codecov output should be verbose
45-
verbose: true
46-
fail_ci_if_error: true
43+
files: lcov.info
44+
fail_ci_if_error: true
45+
verbose: true

0 commit comments

Comments
 (0)