-
Notifications
You must be signed in to change notification settings - Fork 42
85 lines (70 loc) · 2.3 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Coverage
on:
push:
branches:
- develop
pull_request_target:
branches:
- develop
env:
CARGO_TERM_COLOR: always
jobs:
report:
name: Report
environment: coverage
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: "0"
RUSTFLAGS: "-Z profile -C codegen-units=1 -C opt-level=0 -C link-dead-code -C overflow-checks=off -Z panic_abort_tests -C panic=abort"
RUSTDOCFLAGS: "-Z profile -C codegen-units=1 -C opt-level=0 -C link-dead-code -C overflow-checks=off -Z panic_abort_tests -C panic=abort"
steps:
- id: checkout_push
if: github.event_name == 'push'
name: Checkout Repository (Push)
uses: actions/checkout@v4
- id: checkout_pull_request_target
if: github.event_name == 'pull_request_target'
name: Checkout Repository (Pull Request Target)
uses: actions/checkout@v4
with:
ref: "refs/pull/${{ github.event.pull_request.number }}/head"
- id: setup
name: Setup Toolchain
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
components: llvm-tools-preview
- id: cache
name: Enable Workflow Cache
uses: Swatinem/rust-cache@v2
- id: tools
name: Install Tools
uses: taiki-e/install-action@v2
with:
tool: grcov
- id: check
name: Run Build Checks
run: cargo check --tests --benches --examples --workspace --all-targets --all-features
- id: clean
name: Clean Build Directory
run: cargo clean
- id: build
name: Pre-build Main Project
run: cargo build --workspace --all-targets --all-features --jobs 2
- id: build_tests
name: Pre-build Tests
run: cargo build --workspace --all-targets --all-features --tests --jobs 2
- id: test
name: Run Unit Tests
run: cargo test --tests --workspace --all-targets --all-features
- id: coverage
name: Generate Coverage Report
uses: alekitto/[email protected]
- id: upload
name: Upload Coverage Report
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ steps.coverage.outputs.report }}
verbose: true
fail_ci_if_error: true