-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (70 loc) · 2.33 KB
/
ci-coverage.yml
File metadata and controls
81 lines (70 loc) · 2.33 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
80
81
name: CI - Coverage
on:
push:
branches: [main]
paths:
- '**.rs'
- '**/Cargo.toml'
- '**/Cargo.lock'
- '.github/workflows/ci-coverage.yml'
pull_request:
branches: [main]
paths:
- '**.rs'
- '**/Cargo.toml'
- '**/Cargo.lock'
- '.github/workflows/ci-coverage.yml'
workflow_dispatch:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
coverage:
name: Code Coverage (tarpaulin)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Install cargo-tarpaulin
uses: ./.github/actions/install-cargo-tool
with:
tool: cargo-tarpaulin
- name: Cache cargo registry and build
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: coverage-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
coverage-${{ runner.os }}-cargo-
# Note: sccache is intentionally NOT used here because cargo-tarpaulin
# needs direct control over the compilation process to instrument code
# for coverage collection. Using RUSTC_WRAPPER breaks tarpaulin.
#
# Multi-process network tests are skipped because:
# 1. They spawn external processes which doesn't work well under instrumentation
# 2. The overhead causes timeouts (default 60s is insufficient)
# 3. These tests are thoroughly exercised in ci-network.yml with proper timeouts
#
# --exclude-files removes code from coverage report
# -- --skip multi_process passes skip argument to test executable
- name: Run coverage (tarpaulin)
run: cargo tarpaulin --out Xml --exclude-files 'tests/network/multi_process.rs' -- --skip multi_process
- name: Upload coverage report
uses: actions/upload-artifact@v7
with:
name: coverage-xml
path: cobertura.xml
# Upload coverage to Codecov for PR comments, historical tracking, and badge generation
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6
with:
files: cobertura.xml
fail_ci_if_error: false
verbose: true