-
Notifications
You must be signed in to change notification settings - Fork 170
94 lines (79 loc) · 2.6 KB
/
Coverage.yml
File metadata and controls
94 lines (79 loc) · 2.6 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
82
83
84
85
86
87
88
89
90
91
92
93
94
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Weekly Coverage
on:
pull_request:
paths:
- .github/workflows/Coverage.yml
schedule:
# Runs every Monday at 06:00 UTC
- cron: '0 6 * * 1'
workflow_dispatch: # Allow manual trigger
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
coverage:
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
hypervisor: [kvm]
cpu: [amd]
runs-on: ${{ fromJson(
format('["self-hosted", "Linux", "X64", "1ES.Pool=hld-{0}-{1}"]',
matrix.hypervisor,
matrix.cpu)) }}
steps:
- uses: actions/checkout@v6
- uses: hyperlight-dev/ci-setup-workflow@v1.8.0
with:
rust-toolchain: "1.89"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Fix cargo home permissions
run: |
sudo chown -R $(id -u):$(id -g) /opt/cargo || true
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "${{ runner.os }}-debug"
cache-on-failure: "true"
- name: Build guest binaries
run: just guests
- name: Install cargo-llvm-cov
run: |
cargo install cargo-llvm-cov
rustup component add llvm-tools
- name: Generate coverage report
run: just coverage-ci ${{ matrix.hypervisor }}
- name: Coverage summary
if: always()
run: |
echo '## 📊 Code Coverage Report' >> $GITHUB_STEP_SUMMARY
echo '' >> $GITHUB_STEP_SUMMARY
if [ -f target/coverage/summary.txt ]; then
echo '```' >> $GITHUB_STEP_SUMMARY
cat target/coverage/summary.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
else
echo '⚠️ Coverage report was not generated.' >> $GITHUB_STEP_SUMMARY
fi
echo '' >> $GITHUB_STEP_SUMMARY
echo '> 📥 For a detailed per-file breakdown, download the **HTML coverage report** from the Artifacts section below.' >> $GITHUB_STEP_SUMMARY
- name: Upload HTML coverage report
if: always()
uses: actions/upload-artifact@v7
with:
name: coverage-html-${{ matrix.hypervisor }}-${{ matrix.cpu }}
path: target/coverage/html/
- name: Upload LCOV coverage report
if: always()
uses: actions/upload-artifact@v7
with:
name: coverage-lcov-${{ matrix.hypervisor }}-${{ matrix.cpu }}
path: target/coverage/lcov.info