-
Notifications
You must be signed in to change notification settings - Fork 15
57 lines (45 loc) · 1.66 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
48
49
50
51
52
53
54
55
56
57
name: ☂ Code Coverage
on:
push:
branches: [ main ]
pull_request:
branches: [ '*' ]
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
with:
override: true
toolchain: nightly
components: llvm-tools-preview
profile: minimal
- name: Cache Project
uses: Swatinem/rust-cache@v2
- name: Generate Code coverage
env:
CARGO_INCREMENTAL: '0'
LLVM_PROFILE_FILE: "rs-ucan-%p-%m.profraw"
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'
run: cargo test --all
- name: Install grcov
run: "curl -L https://github.com/mozilla/grcov/releases/download/v0.8.12/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf -"
- name: Run grcov
run: "./grcov . --llvm --binary-path target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '/*' -o lcov.info"
- name: Install covfix
uses: actions-rs/install@v0.1
with:
crate: rust-covfix
use-tool-cache: true
- name: Run covfix
run: rust-covfix lcov.info -o lcov.info --verbose
- name: Upload to codecov.io
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: lcov.info