-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (48 loc) · 1.42 KB
/
cov.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Coverage
on:
push:
branches: [ "main", "develop" ]
pull_request:
branches: [ "main", "develop" ]
env:
CARGO_TERM_COLOR: always
jobs:
unit-tests-coverage:
name: Unit Tests Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Install deps
run: |
rustup component add llvm-tools-preview
grcov --version || cargo install --locked grcov
- name: Run tests
run: |
rm -rf target/coverage
mkdir -p target/coverage
cargo test --verbose
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Cinstrument-coverage'
RUSTDOCFLAGS: '-Cinstrument-coverage'
LLVM_PROFILE_FILE: 'target/coverage/unittests-%p-%m.profraw'
- name: Collect Report
run: |
grcov target/coverage --binary-path "target/debug/" \
-s . -t lcov --branch --ignore-not-existing \
--ignore "src/tests.rs" \
-o coverage-report.info
- name: Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
# Repository upload token - get it from codecov.io. Required only for private repositories
# token: # optional
# Specify whether the Codecov output should be verbose
verbose: true
fail_ci_if_error: true