-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (57 loc) · 1.63 KB
/
coverage.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
53
54
55
56
57
58
59
60
name: codecov
on:
push:
branches: [ trunk ]
pull_request:
branches: [ trunk ]
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
RUST_BACKTRACE: 1
jobs:
coverage:
runs-on: ubuntu-latest
steps:
# checkout
- uses: actions/checkout@v4
with:
submodules: recursive
# install requirements
- uses: dtolnay/rust-toolchain@stable
- name: Install llvm-tools-preview
run: rustup component add llvm-tools-preview
- name: Install grcov
run: cargo install grcov
- uses: Swatinem/rust-cache@v2
# generate raw coverage data
- name: Build code
run: cargo build --all-features --workspace --exclude integraal-examples
env:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "cargo-test-%p-%m.profraw"
- name: Run tests
run: cargo test --all-features --workspace --exclude integraal-examples
env:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "cargo-test-%p-%m.profraw"
# generate lcov file using grcov
- name: Run grcov
run: |
grcov . \
--binary-path ./target/debug/ \
-s . \
-t lcov \
--branch \
--ignore-not-existing \
--ignore '../*' \
--ignore "/*" \
-o target/tests.lcov
# upload results
- name: Upload reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: target/tests.lcov
slug: imrn99/integraal