-
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (64 loc) · 1.98 KB
/
coverage.yml
File metadata and controls
79 lines (64 loc) · 1.98 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
68
69
70
71
72
73
74
75
76
77
78
79
name: Coverage
on:
schedule:
- cron: '0 2 * * *' # Nightly at 02:00 UTC
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
coverage:
name: Generate Coverage Report
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup workspace dependencies
run: |
chmod +x scripts/setup-workspace.sh
./scripts/setup-workspace.sh
- name: Install protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.91.0
- name: Show Rust versions
run: |
rustc --version
cargo --version
- name: Install required components
run: |
rustup component add rustfmt
rustup component add clippy
rustup component add llvm-tools-preview
- name: Install cargo-llvm-cov
run: cargo install cargo-llvm-cov --locked
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-coverage-cargo-registry-${{ hashFiles('Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-coverage-cargo-index-${{ hashFiles('Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-coverage-cargo-build-${{ hashFiles('Cargo.lock') }}
- name: Run coverage script (full clean)
run: ./coverage.sh --full-clean
- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: coverage-html
path: target/llvm-cov/html
- name: Upload LCOV file
uses: actions/upload-artifact@v4
with:
name: coverage-lcov
path: target/coverage/lcov.info