-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (38 loc) · 1.18 KB
/
codecov.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
name: CodeCov workflow
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
name: Test Ruscode and Upload to CodeCov
steps:
- uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
coverage
key: codecov-cargo
# nice reusable workflow to get rust ready
- name: Setup rust toolchain
uses: hecrj/setup-rust-action@master
with:
rust-version: stable
components: "clippy, rustfmt"
- name: Run cargo test and Collect coverage
env:
RUSTFLAGS: -Cinstrument-coverage
LLVM_PROFILE_FILE: ruscode-%p-%m.profraw
run: |
cargo install grcov
rustup component add llvm-tools-preview
cargo build
cargo test
mkdir coverage-dir
grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing -o ./coverage-dir/lcov.info
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
with:
directory: ./coverage-dir/