-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (58 loc) · 1.85 KB
/
Copy pathcoverage.yml
File metadata and controls
68 lines (58 loc) · 1.85 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
name: Coverage
on:
push:
branches: [main]
env:
CARGO_TERM_COLOR: always
MIN_COVERAGE: "80"
jobs:
coverage:
name: Coverage
runs-on: ubuntu-latest
env:
DEACON_NETWORK_TESTS: "1"
steps:
- name: Free disk space (before cache restore)
run: |
# Remove pre-installed software to free ~30GB BEFORE cache restore
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL 2>/dev/null || true
echo "=== Disk space after pre-cleanup ==="
df -h
- name: Checkout code
uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov
- name: Cache cargo registry and target
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-llvmcov-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-llvmcov-
- name: Ensure Docker is running and clean
run: |
sudo service docker start
docker info
# Clean Docker after cache restore
sudo docker system prune -af --volumes
sudo docker builder prune -af
echo "=== Disk space after Docker cleanup ==="
df -h
- name: Generate coverage (fail under ${{ env.MIN_COVERAGE }}%)
run: |
mkdir -p coverage
cargo llvm-cov --workspace --lcov --output-path coverage/lcov.info --text --fail-under-lines ${{ env.MIN_COVERAGE }} -- --test-threads=1 | tee -a "$GITHUB_STEP_SUMMARY"
- name: Upload lcov artifact
uses: actions/upload-artifact@v7
with:
name: coverage-lcov
path: coverage/lcov.info