-
Notifications
You must be signed in to change notification settings - Fork 53
67 lines (55 loc) · 1.7 KB
/
Copy pathcoverage.yaml
File metadata and controls
67 lines (55 loc) · 1.7 KB
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
name: Coverage
# adr: docs/adrs/20260612000000_adopt_sccache_for_ci_bare_builds.md
# sccache added for cross-run compilation caching on bare CI builds.
on:
push:
branches:
- develop
env:
CARGO_TERM_COLOR: always
jobs:
report:
name: Generate Coverage Report
environment: coverage
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: "0"
RUSTFLAGS: "-Cinstrument-coverage"
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install LLVM tools
run: sudo apt-get update && sudo apt-get install -y llvm
- id: setup
name: Setup Toolchain
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
components: llvm-tools-preview
- id: sccache
name: Install sccache (GHA backend)
uses: mozilla-actions/sccache-action@v0.0.10
- id: enable-sccache
name: Enable sccache
run: |
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
# CARGO_INCREMENTAL=0 already set in job env for coverage
- id: tools
name: Install Tools
uses: taiki-e/install-action@v2
with:
tool: grcov,cargo-llvm-cov
- id: coverage
name: Generate Coverage Report
run: |
cargo clean
cargo llvm-cov --all-features --workspace --codecov --output-path ./codecov.json
- id: upload
name: Upload Coverage Report
uses: codecov/codecov-action@v7
with:
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ github.workspace }}/codecov.json
fail_ci_if_error: true