Repository navigation
152 lines (126 loc) · 4.77 KB
/
Copy pathRustNightly.yml
File metadata and controls
152 lines (126 loc) · 4.77 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Nightly
on:
workflow_dispatch:
schedule:
# 12:00 AM, every 2 days
- cron: '0 0 */2 * *'
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
defaults:
run:
shell: bash
jobs:
# Nightly musl cross-compilation builds
# This is a self-contained job since musl builds are a special case
# that require TARGET_TRIPLE for cross-compilation
musl:
timeout-minutes: ${{ fromJSON(vars.NIGHTLY_JOB_TIMEOUT || '60') }}
strategy:
fail-fast: true
matrix:
hypervisor: [kvm, mshv3]
cpu_vendor: [amd, intel]
config: [debug, release]
runs-on: ${{ fromJson(
format('["self-hosted", "Linux", "X64", "1ES.Pool=hld-{0}-{1}", "JobId=musl-{2}-{3}-{4}-{5}"]',
matrix.hypervisor == 'mshv3' && 'azlinux3-mshv' || matrix.hypervisor,
matrix.cpu_vendor,
matrix.config,
github.run_id,
github.run_number,
github.run_attempt)) }}
env:
TARGET_TRIPLE: x86_64-unknown-linux-musl
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 }}
# cargo-hyperlight builds a custom sysroot for x86_64-hyperlight-none target.
# rust-cache cleans "anything not a dependency" from target dirs, removing the sysroot.
# We cache sysroot separately to avoid rebuilding it (~10s) on every run.
- name: Sysroot cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
src/tests/rust_guests/target/sysroot
src/tests/rust_guests/target-non-pie/sysroot
key: sysroot-linux-${{ matrix.config }}-${{ hashFiles('rust-toolchain.toml') }}
- name: Rust cache
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
with:
shared-key: "nightly-${{ matrix.config }}"
cache-on-failure: "true"
workspaces: |
. -> target
src/tests/rust_guests -> target
- name: Set up sccache
uses: ./.github/actions/setup-sccache
- name: Install cargo-hyperlight
run: just ensure-cargo-hyperlight
- name: Build and move Rust guests
run: |
just build-rust-guests ${{ matrix.config }}
just move-rust-guests ${{ matrix.config }}
- name: Build non-PIE Rust guests
run: |
just build-rust-guests-non-pie ${{ matrix.config }}
just move-rust-guests-non-pie ${{ matrix.config }}
- name: Build C guests
run: |
just build-c-guests ${{ matrix.config }}
just move-c-guests ${{ matrix.config }}
- name: Build
run: just build ${{ matrix.config }}
- name: Run Rust tests
run: |
# with default features
just test ${{ matrix.config }}
# with only one driver enabled
just test ${{ matrix.config }} ${{ matrix.hypervisor == 'mshv3' && 'mshv3' || 'kvm' }}
# make sure certain cargo features compile
just check
# without any features
just test-compilation-no-default-features ${{ matrix.config }}
- name: Run Rust examples
env:
RUST_LOG: debug
run: just run-rust-examples-linux ${{ matrix.config }}
- name: Run Rust Gdb tests
env:
RUST_LOG: debug
run: just test-rust-gdb-debugging ${{ matrix.config }}
- name: Run Rust Crashdump tests
env:
RUST_LOG: debug
run: just test-rust-crashdump ${{ matrix.config }}
- name: Run Rust Tracing tests
env:
RUST_LOG: debug
run: just test-rust-tracing ${{ matrix.config }}
# Miri asks nothing of a runner beyond its architecture, so it runs once on a
# hosted one rather than in every entry of the musl matrix.
miri:
uses: ./.github/workflows/dep_miri.yml
secrets: inherit
with:
arch: X64
notify-failure:
runs-on: ubuntu-latest
needs: [musl, miri]
if: always() && (needs.musl.result == 'failure' || needs.miri.result == 'failure')
permissions:
issues: write
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Notify Nightly Failure
run: ./dev/notify-ci-failure.sh --title="Nightly musl Failure - ${{ github.run_number }}" --labels="area/ci-periodics-nightly,area/ci-periodics,area/testing,lifecycle/needs-review,release-blocker"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}