11
11
required : false
12
12
type : string
13
13
default : " false"
14
+ target_triple :
15
+ description : Target triple for cross-compilation
16
+ required : false
17
+ type : string
18
+ default : " "
19
+ hypervisor :
20
+ description : Hypervisor for this run (passed from caller matrix)
21
+ required : false
22
+ type : string
23
+ default : " kvm"
24
+ config :
25
+ description : Build configuration for this run (passed from caller matrix)
26
+ required : false
27
+ type : string
28
+ default : " debug"
29
+ cpu :
30
+ description : CPU architecture for the build (passed from caller matrix)
31
+ required : false
32
+ type : string
33
+ default : " amd"
14
34
15
35
env :
16
36
CARGO_TERM_COLOR : always
@@ -32,17 +52,12 @@ defaults:
32
52
33
53
jobs :
34
54
code-checks :
35
- if : ${{ inputs.docs_only == 'false' }}
55
+ if : ${{ inputs.docs_only == 'false' && (inputs.hypervisor == 'hyperv-ws2025' || inputs.hypervisor == 'kvm') }}
36
56
timeout-minutes : 60
37
- strategy :
38
- fail-fast : true
39
- matrix :
40
- hypervisor : ['hyperv-ws2025', kvm]
41
- config : [debug, release]
42
57
runs-on : ${{ fromJson(
43
58
format('["self-hosted", "{0}", "X64", "1ES.Pool=hld-{1}-amd"]',
44
- (matrix .hypervisor == 'hyperv-ws2025') && 'Windows' || 'Linux',
45
- matrix .hypervisor == 'hyperv-ws2025' && 'win2025' || 'kvm')) }}
59
+ (inputs .hypervisor == 'hyperv-ws2025') && 'Windows' || 'Linux',
60
+ inputs .hypervisor == 'hyperv-ws2025' && 'win2025' || 'kvm')) }}
46
61
steps :
47
62
- uses : actions/checkout@v5
48
63
@@ -63,32 +78,29 @@ jobs:
63
78
- name : clippy
64
79
if : ${{ (runner.os == 'Windows' )}}
65
80
run : |
66
- just clippy ${{ matrix.config }}
67
- just clippy-guests ${{ matrix.config }}
81
+ just clippy ${{ inputs.config }}
82
+ just clippy-guests ${{ inputs.config }}
83
+ env :
84
+ TARGET_TRIPLE : ${{ inputs.target_triple }}
68
85
69
86
- name : clippy exhaustive check
70
87
if : ${{ (runner.os == 'Linux' )}}
71
88
run : |
72
- just clippy-exhaustive ${{ matrix.config }}
89
+ just clippy-exhaustive ${{ inputs.config }}
90
+ env :
91
+ TARGET_TRIPLE : ${{ inputs.target_triple }}
73
92
74
93
- name : Verify MSRV
75
94
run : ./dev/verify-msrv.sh hyperlight-host hyperlight-guest hyperlight-guest-bin hyperlight-common
76
95
77
96
build :
78
97
if : ${{ inputs.docs_only == 'false' }}
79
98
timeout-minutes : 60
80
- strategy :
81
- fail-fast : true
82
- matrix :
83
- hypervisor : [hyperv, 'hyperv-ws2025', mshv, mshv3, kvm] # hyperv is windows, mshv and kvm are linux
84
- cpu : [amd, intel]
85
- config : [debug, release]
86
-
87
99
runs-on : ${{ fromJson(
88
100
format('["self-hosted", "{0}", "X64", "1ES.Pool=hld-{1}-{2}"]',
89
- (matrix .hypervisor == 'hyperv' || matrix .hypervisor == 'hyperv-ws2025') && 'Windows' || 'Linux',
90
- matrix .hypervisor == 'hyperv' && 'win2022' || matrix .hypervisor == 'hyperv-ws2025' && 'win2025' || matrix .hypervisor == 'mshv3' && 'azlinux3-mshv' || matrix .hypervisor,
91
- matrix .cpu)) }}
101
+ (inputs .hypervisor == 'hyperv' || inputs .hypervisor == 'hyperv-ws2025') && 'Windows' || 'Linux',
102
+ inputs .hypervisor == 'hyperv' && 'win2022' || inputs .hypervisor == 'hyperv-ws2025' && 'win2025' || inputs .hypervisor == 'mshv3' && 'azlinux3-mshv' || inputs .hypervisor,
103
+ inputs .cpu)) }}
92
104
steps :
93
105
- uses : actions/checkout@v5
94
106
@@ -112,79 +124,86 @@ jobs:
112
124
- name : Build and move Rust guests
113
125
run : |
114
126
# use these commands in favor of build-and-move-rust-guests to avoid building both configs
115
- just build-rust-guests ${{ matrix .config }}
116
- just move-rust-guests ${{ matrix .config }}
127
+ just build-rust-guests ${{ inputs .config }}
128
+ just move-rust-guests ${{ inputs .config }}
117
129
118
130
- name : Build c guests
119
131
run : |
120
132
# use these commands in favor of build-and-move-c-guests to avoid building both configs
121
- just build-c-guests ${{ matrix.config }}
122
- just move-c-guests ${{ matrix.config }}
133
+ just build-c-guests ${{ inputs.config }}
134
+ just move-c-guests ${{ inputs.config }}
135
+
123
136
- name : Build
124
- run : just build ${{ matrix.config }}
137
+ run : just build ${{ inputs.config }}
138
+ env :
139
+ TARGET_TRIPLE : ${{ inputs.target_triple }}
125
140
126
141
- name : Run Rust tests
127
142
env :
128
143
CARGO_TERM_COLOR : always
144
+ TARGET_TRIPLE : ${{ inputs.target_triple }}
129
145
run : |
130
146
# with default features
131
- just test ${{ matrix .config }} ${{ matrix .hypervisor == 'mshv' && 'mshv2' || ''}}
147
+ just test ${{ inputs .config }} ${{ inputs .hypervisor == 'mshv' && 'mshv2' || '"" '}}
132
148
133
149
# with only one driver enabled (driver mshv/kvm feature is ignored on windows) + seccomp
134
- just test ${{ matrix .config }} seccomp,${{ matrix .hypervisor == 'mshv' && 'mshv2' || matrix .hypervisor == 'mshv3' && 'mshv3' || 'kvm' }}
150
+ just test ${{ inputs .config }} seccomp,${{ inputs .hypervisor == 'mshv' && 'mshv2' || inputs .hypervisor == 'mshv3' && 'mshv3' || 'kvm' }}
135
151
136
152
# make sure certain cargo features compile
137
- cargo check -p hyperlight-host --features crashdump
138
- cargo check -p hyperlight-host --features print_debug
139
- cargo check -p hyperlight-host --features gdb
140
- cargo check -p hyperlight-host --features trace_guest,unwind_guest,mem_profile
153
+ just check
141
154
142
155
# without any features
143
- just test-compilation-no-default-features ${{ matrix .config }}
156
+ just test-compilation-no-default-features ${{ inputs .config }}
144
157
145
158
# One of the examples is flaky on Windows GH runners, so this allows us to disable it for now
146
159
- name : Run Rust examples - windows
147
160
if : ${{ (runner.os == 'Windows') }}
148
161
env :
149
162
CARGO_TERM_COLOR : always
150
163
RUST_LOG : debug
151
- run : just run-rust-examples ${{ matrix.config }}
164
+ TARGET_TRIPLE : ${{ inputs.target_triple }}
165
+ run : just run-rust-examples ${{ inputs.config }}
166
+
152
167
153
168
- name : Run Rust examples - linux
154
- if : ${{ (runner.os != 'Windows') }}
169
+ if : false
155
170
env :
156
171
CARGO_TERM_COLOR : always
157
172
RUST_LOG : debug
158
- run : just run-rust-examples-linux ${{ matrix.config }} ${{ matrix.hypervisor == 'mshv' && 'mshv2' || ''}}
173
+ TARGET_TRIPLE : ${{ inputs.target_triple }}
174
+ run : just run-rust-examples-linux ${{ inputs.config }} ${{ inputs.hypervisor == 'mshv' && 'mshv2' || '""'}}
159
175
160
176
- name : Run Rust Gdb tests - linux
161
177
if : runner.os == 'Linux'
162
178
env :
163
179
CARGO_TERM_COLOR : always
164
180
RUST_LOG : debug
165
- run : just test-rust-gdb-debugging ${{ matrix.config }} ${{ matrix.hypervisor == 'mshv' && 'mshv2' || ''}}
181
+ TARGET_TRIPLE : ${{ inputs.target_triple }}
182
+ run : just test-rust-gdb-debugging ${{ inputs.config }} ${{ inputs.hypervisor == 'mshv' && 'mshv2' || '""'}}
166
183
167
184
- name : Run Rust Crashdump tests
168
185
env :
169
186
CARGO_TERM_COLOR : always
170
187
RUST_LOG : debug
171
- run : just test-rust-crashdump ${{ matrix.config }} ${{ matrix.hypervisor == 'mshv' && 'mshv2' || ''}}
188
+ TARGET_TRIPLE : ${{ inputs.target_triple }}
189
+ run : just test-rust-crashdump ${{ inputs.config }} ${{ inputs.hypervisor == 'mshv' && 'mshv2' || '""'}}
172
190
173
191
- name : Run Rust Tracing tests - linux
174
192
if : runner.os == 'Linux'
175
193
env :
176
194
CARGO_TERM_COLOR : always
177
195
RUST_LOG : debug
178
- run : just test-rust-tracing ${{ matrix.config }} ${{ matrix.hypervisor == 'mshv' && 'mshv2' || ''}}
196
+ TARGET_TRIPLE : ${{ inputs.target_triple }}
197
+ run : just test-rust-tracing ${{ inputs.config }} ${{ inputs.hypervisor == 'mshv' && 'mshv2' || '""'}}
179
198
180
199
- name : Download benchmarks from "latest"
181
- run : just bench-download ${{ runner.os }} ${{ matrix .hypervisor }} ${{ matrix .cpu}} dev-latest # compare to prerelease
200
+ run : just bench-download ${{ runner.os }} ${{ inputs .hypervisor }} ${{ inputs .cpu}} dev-latest # compare to prerelease
182
201
env :
183
202
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
184
203
continue-on-error : true
185
- if : ${{ matrix .config == 'release' }}
204
+ if : ${{ inputs .config == 'release' && inputs.target_triple == ' ' }}
186
205
187
206
- name : Run benchmarks
188
207
run : |
189
- just bench-ci main ${{ matrix .hypervisor == 'mshv' && 'mshv2' || ''}}
190
- if : ${{ matrix .config == 'release' }}
208
+ just bench-ci main ${{ inputs .hypervisor == 'mshv' && 'mshv2' || ''}}
209
+ if : ${{ inputs .config == 'release' && inputs.target_triple == ' ' }}
0 commit comments