Skip to content

Commit fe110fb

Browse files
committed
[ci] update ci to ensure it builds on windows w/o any features
Signed-off-by: danbugs <danilochiarlone@gmail.com>
1 parent 3796c5a commit fe110fb

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

.github/workflows/dep_rust.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ jobs:
138138
cargo check -p hyperlight-host --features print_debug
139139
cargo check -p hyperlight-host --features gdb
140140
141-
# without any driver (shouldn't compile)
142-
just test-compilation-fail ${{ matrix.config }}
141+
# without any features
142+
just test-compilation-no-default-features ${{ matrix.config }}
143143
144144
# One of the examples is flaky on Windows GH runners, so this allows us to disable it for now
145145
- name: Run Rust examples - windows

Justfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ test-like-ci config=default-target hypervisor="kvm":
8484
cargo check -p hyperlight-host --features gdb
8585

8686
@# without any driver (should fail to compile)
87-
just test-compilation-fail {{config}}
87+
just test-compilation-no-default-features {{config}}
8888

8989
@# test the crashdump feature
9090
just test-rust-crashdump {{config}}
@@ -121,10 +121,12 @@ test-seccomp target=default-target features="":
121121
cargo test --profile={{ if target == "debug" { "dev" } else { target } }} -p hyperlight-host test_violate_seccomp_filters --lib {{ if features =="" {''} else { "--features " + features } }} -- --ignored
122122
cargo test --profile={{ if target == "debug" { "dev" } else { target } }} -p hyperlight-host test_violate_seccomp_filters --no-default-features {{ if features =~"mshv3" {"--features init-paging,mshv3"} else {"--features mshv2,init-paging,kvm" } }} --lib -- --ignored
123123

124-
# runs tests that ensure compilation fails when it should
125-
test-compilation-fail target=default-target:
126-
@# the following should fail on linux because one of kvm, mshv, or mshv3 feature must be specified, which is why the exit code is inverted with an !.
127-
{{ if os() == "linux" { "! cargo check -p hyperlight-host --no-default-features 2> /dev/null"} else { "" } }}
124+
# tests compilation with no default features on different platforms
125+
test-compilation-no-default-features target=default-target:
126+
@# Linux should fail without a hypervisor feature (kvm, mshv, or mshv3)
127+
{{ if os() == "linux" { "! cargo check -p hyperlight-host --no-default-features 2> /dev/null" } else { "" } }}
128+
@# Windows should succeed even without default features
129+
{{ if os() == "windows" { "cargo check -p hyperlight-host --no-default-features" } else { "" } }}
128130

129131
# runs tests that exercise gdb debugging
130132
test-rust-gdb-debugging target=default-target features="":

0 commit comments

Comments
 (0)