Repository navigation
111 lines (94 loc) · 3.95 KB
/
Copy pathCoverage.yml
File metadata and controls
111 lines (94 loc) · 3.95 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# 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: ${{ fromJSON(vars.COVERAGE_JOB_TIMEOUT || '90') }}
strategy:
fail-fast: false
matrix:
hypervisor: [kvm]
# Spread load across vendor pools: AMD when run_id ends in 0,2,4,6,8, Intel otherwise.
cpu: ${{ fromJSON((endsWith(github.run_id, '0') || endsWith(github.run_id, '2') || endsWith(github.run_id, '4') || endsWith(github.run_id, '6') || endsWith(github.run_id, '8')) && '["amd"]' || '["intel"]') }}
runs-on: ${{ fromJson(
format('["self-hosted", "Linux", "X64", "1ES.Pool=hld-{0}-{1}"]',
matrix.hypervisor,
matrix.cpu)) }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: hyperlight-dev/ci-setup-workflow@2f4142ba17cf573af44fc1e1f1ffc743daded5b3 # v1.10.0
with:
rust-toolchain: "1.94"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Rust cache
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
with:
shared-key: "${{ runner.os }}-debug"
cache-on-failure: "true"
# Only save on main as caches are not shared across branches.
# https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching#restrictions-for-accessing-a-cache
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Set up sccache
uses: ./.github/actions/setup-sccache
- name: Build guest binaries
run: just guests
- name: Install nightly toolchain
run: |
rustup toolchain install nightly-2026-09-22
rustup component add llvm-tools --toolchain nightly-2026-09-22
- name: Generate coverage report
run: just coverage-ci ${{ matrix.hypervisor }}
- name: Coverage summary
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
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: coverage-html-${{ matrix.hypervisor }}-${{ matrix.cpu }}
path: target/coverage/html/
if-no-files-found: error
- name: Upload LCOV coverage report
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: coverage-lcov-${{ matrix.hypervisor }}-${{ matrix.cpu }}
path: target/coverage/lcov.info
if-no-files-found: error
notify-failure:
runs-on: ubuntu-latest
needs: [coverage]
if: always() && needs.coverage.result == 'failure'
permissions:
issues: write
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Notify Coverage Failure
run: ./dev/notify-ci-failure.sh --title="Weekly Coverage Failure - ${{ github.run_number }}" --labels="area/ci-periodics,area/testing,lifecycle/needs-review"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}