Skip to content

Commit

Permalink
add codecov to work on any branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Johanna committed Sep 9, 2024
1 parent 5eef2ec commit 04ecd37
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ name: Rust codecov

on:
push:
branches: [ "master" ]
branches: [ '*' ] # Run on all branches
pull_request:
branches: [ "master" ]
branches: [ '*' ] # Run on PRs to all branches

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

steps:
Expand All @@ -20,27 +19,27 @@ jobs:
with:
toolchain: nightly
override: true
components: llvm-tools-preview # Required for grcov

- name: Build
run: cargo build --verbose

- name: Run tests
run: cargo test --verbose --no-fail-fast
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
- name: rust-grcov
# You may pin to the exact commit or the version.
# uses: actions-rs/grcov@bb47b1ed7883a1502fa6875d562727ace2511248
uses: actions-rs/grcov@v0.1.5
with:
config: .github/config/grcov.yml
- name: Codecov
# You may pin to the exact commit or the version.
# uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378
uses: codecov/codecov-action@v3.1.0

- name: Run grcov
run: |
cargo install grcov
grcov . -s . --binary-path ./target/debug/ -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
# Repository upload token - get it from codecov.io. Required only for private repositories
token: ${{ secrets.CODECOV_TOKEN }}
# Specify whether the Codecov output should be verbose
verbose: true
fail_ci_if_error: true
files: lcov.info
fail_ci_if_error: true
verbose: true

0 comments on commit 04ecd37

Please sign in to comment.