1111 required : false
1212 type : string
1313 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"
1434
1535env :
1636 CARGO_TERM_COLOR : always
@@ -32,17 +52,12 @@ defaults:
3252
3353jobs :
3454 code-checks :
35- if : ${{ inputs.docs_only == 'false' }}
55+ if : ${{ inputs.docs_only == 'false' && (inputs.hypervisor == 'hyperv-ws2025' || inputs.hypervisor == 'kvm') }}
3656 timeout-minutes : 60
37- strategy :
38- fail-fast : true
39- matrix :
40- hypervisor : ['hyperv-ws2025', kvm]
41- config : [debug, release]
4257 runs-on : ${{ fromJson(
4358 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')) }}
4661 steps :
4762 - uses : actions/checkout@v5
4863
@@ -63,32 +78,29 @@ jobs:
6378 - name : clippy
6479 if : ${{ (runner.os == 'Windows' )}}
6580 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 }}
6885
6986 - name : clippy exhaustive check
7087 if : ${{ (runner.os == 'Linux' )}}
7188 run : |
72- just clippy-exhaustive ${{ matrix.config }}
89+ just clippy-exhaustive ${{ inputs.config }}
90+ env :
91+ TARGET_TRIPLE : ${{ inputs.target_triple }}
7392
7493 - name : Verify MSRV
7594 run : ./dev/verify-msrv.sh hyperlight-host hyperlight-guest hyperlight-guest-bin hyperlight-common
7695
7796 build :
7897 if : ${{ inputs.docs_only == 'false' }}
7998 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-
8799 runs-on : ${{ fromJson(
88100 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)) }}
92104 steps :
93105 - uses : actions/checkout@v5
94106
@@ -112,78 +124,85 @@ jobs:
112124 - name : Build and move Rust guests
113125 run : |
114126 # 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 }}
117129
118130 - name : Build c guests
119131 run : |
120132 # 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+
123136 - name : Build
124- run : just build ${{ matrix.config }}
137+ run : just build ${{ inputs.config }}
138+ env :
139+ TARGET_TRIPLE : ${{ inputs.target_triple }}
125140
126141 - name : Run Rust tests
127142 env :
128143 CARGO_TERM_COLOR : always
144+ TARGET_TRIPLE : ${{ inputs.target_triple }}
129145 run : |
130146 # with default features
131- just test ${{ matrix .config }} ${{ matrix .hypervisor == 'mshv' && 'mshv2' || ''}}
147+ just test ${{ inputs .config }} ${{ inputs .hypervisor == 'mshv' && 'mshv2' || '"" '}}
132148
133149 # 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' }}
135151
136152 # 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
141154
142155 # without any features
143- just test-compilation-no-default-features ${{ matrix .config }}
156+ just test-compilation-no-default-features ${{ inputs .config }}
144157
145158 # One of the examples is flaky on Windows GH runners, so this allows us to disable it for now
146159 - name : Run Rust examples - windows
147160 if : ${{ (runner.os == 'Windows') }}
148161 env :
149162 CARGO_TERM_COLOR : always
150163 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+
152167
153168 - name : Run Rust examples - linux
154169 if : ${{ (runner.os != 'Windows') }}
155170 env :
156171 CARGO_TERM_COLOR : always
157172 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' || '""'}}
159175
160176 - name : Run Rust Gdb tests
161177 env :
162178 CARGO_TERM_COLOR : always
163179 RUST_LOG : debug
164- run : just test-rust-gdb-debugging ${{ matrix.config }} ${{ matrix.hypervisor == 'mshv' && 'mshv2' || ''}}
180+ TARGET_TRIPLE : ${{ inputs.target_triple }}
181+ run : just test-rust-gdb-debugging ${{ inputs.config }} ${{ inputs.hypervisor == 'mshv' && 'mshv2' || '""'}}
165182
166183 - name : Run Rust Crashdump tests
167184 env :
168185 CARGO_TERM_COLOR : always
169186 RUST_LOG : debug
170- run : just test-rust-crashdump ${{ matrix.config }} ${{ matrix.hypervisor == 'mshv' && 'mshv2' || ''}}
187+ TARGET_TRIPLE : ${{ inputs.target_triple }}
188+ run : just test-rust-crashdump ${{ inputs.config }} ${{ inputs.hypervisor == 'mshv' && 'mshv2' || '""'}}
171189
172190 - name : Run Rust Tracing tests - linux
173191 if : runner.os == 'Linux'
174192 env :
175193 CARGO_TERM_COLOR : always
176194 RUST_LOG : debug
177- run : just test-rust-tracing ${{ matrix.config }} ${{ matrix.hypervisor == 'mshv' && 'mshv2' || ''}}
195+ TARGET_TRIPLE : ${{ inputs.target_triple }}
196+ run : just test-rust-tracing ${{ inputs.config }} ${{ inputs.hypervisor == 'mshv' && 'mshv2' || '""'}}
178197
179198 - name : Download benchmarks from "latest"
180- run : just bench-download ${{ runner.os }} ${{ matrix .hypervisor }} ${{ matrix .cpu}} dev-latest # compare to prerelease
199+ run : just bench-download ${{ runner.os }} ${{ inputs .hypervisor }} ${{ inputs .cpu}} dev-latest # compare to prerelease
181200 env :
182201 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
183202 continue-on-error : true
184- if : ${{ matrix .config == 'release' }}
203+ if : ${{ inputs .config == 'release' && inputs.target_triple == ' ' }}
185204
186205 - name : Run benchmarks
187206 run : |
188- just bench-ci main ${{ matrix .hypervisor == 'mshv' && 'mshv2' || ''}}
189- if : ${{ matrix .config == 'release' }}
207+ just bench-ci main ${{ inputs .hypervisor == 'mshv' && 'mshv2' || ''}}
208+ if : ${{ inputs .config == 'release' && inputs.target_triple == ' ' }}
0 commit comments