forked from RGB-Tools/rgb-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (39 loc) · 1.12 KB
/
coverage.yaml
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
name: Coverage
on:
push:
branches:
- master
- coverage
pull_request:
branches:
- master
jobs:
codecov:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: llvm-tools-preview
- name: Run tests
env:
RUSTFLAGS: "-Cinstrument-coverage"
RUSTDOCFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "target/coverage/%p-%m.profraw"
run: cargo test
- name: Install grcov
run: cargo install grcov
- name: Generate coverage report
run: >
grcov target/coverage -s . --binary-path target/debug/ -t lcov --branch
--ignore 'target/*' --ignore 'tests/*' --ignore-not-existing -o coverage.lcov
- name: Upload coverage report
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
file: coverage.lcov
flags: rust
token: ${{ secrets.CODECOV_TOKEN }}