-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (51 loc) · 1.66 KB
/
ci.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
name: Cargo Build & Test
on:
push:
pull_request:
env:
CARGO_TERM_COLOR: always
LLVM_PROFILE_FILE: target/coverage/%p-%m.profraw
RUSTFLAGS: -C instrument-coverage
jobs:
build_and_test:
name: nwrfc - latest
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
- beta
- nightly
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install clang
run: sudo apt-get update && sudo apt-get install -y llvm-dev libclang-dev clang
- name: Get rust toolchain
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- name: Install grcov & llvm-tools
run: rustup component add llvm-tools-preview && cargo install grcov
- name: Build
run: cargo build --verbose
- name: Test
run: cargo test --verbose
- name: Collect coverage data
run: mkdir coverage && grcov target/coverage --binary-path target/debug --source-dir . --output-path coverage --keep-only 'src/*' --output-types cobertura
- name: Report coverage
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: coverage/cobertura.xml
badge: true
fail_below_min: false
format: markdown
hide_branch_rate: true
hide_complexity: true
indicators: true
output: both
thresholds: '70 90'
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request' && matrix.toolchain == 'stable'
with:
recreate: true
path: code-coverage-results.md