-
Notifications
You must be signed in to change notification settings - Fork 5
65 lines (54 loc) · 1.55 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
61
62
63
64
65
name: Coverage
on:
# pull_request:
push:
branches:
- duty/codecov
- develop
env:
CARGO_INCREMENTAL: 0
SKIP_WASM_BUILD: 1
LLVM_PROFILE_FILE: "sora2-%p-%m.profraw"
RUST_BACKTRACE: short
RUSTFLAGS: "-Cinstrument-coverage"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Cache cargo registry
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Setup Rust
uses: ATiltedTree/setup-rust@v1.0.5
with:
rust-version: stable
- name: Install llvm tools
run: rustup component add llvm-tools-preview
- name: Install grcov
run: cargo install grcov
- name: Install packages
run: |
apt-get update
protobuf-compiler
- name: Build and test
run: cargo test -r
- name: Generate Cobertura report
run: |
cargo tarpaulin --out Xml
grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src"
- name: Upload Cobertura report
uses: actions/upload-artifact@v2
with:
name: cobertura-report
path: cobertura.xml
- name: Upload to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}