Skip to content

Commit 2f8b3bd

Browse files
authored
Add a specific job just for publishing tests (#20)
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
1 parent 692fb38 commit 2f8b3bd

File tree

6 files changed

+58
-16
lines changed

6 files changed

+58
-16
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,44 @@ jobs:
123123
- name: Python SDK Benchmark
124124
run: just benchmark
125125

126-
# Build release wheels and verify they install + work correctly
127-
- name: Python SDK Wheelhouse test
126+
python-wheelhouse:
127+
name: Python SDK · wheelhouse test
128+
runs-on: ubuntu-latest
129+
steps:
130+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
131+
132+
- uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
133+
with:
134+
cache-key: release
135+
rustflags: ""
136+
137+
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
138+
139+
- name: Install Python
140+
run: uv python install 3.12
141+
142+
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
143+
with:
144+
node-version: "latest"
145+
cache: npm
146+
cache-dependency-path: src/wasm_sandbox/guests/javascript/package-lock.json
147+
148+
- name: Install just
149+
run: cargo install --locked just
150+
151+
- name: Install clang
152+
run: sudo apt-get update && sudo apt-get install -y clang
153+
154+
- name: Enable KVM
155+
if: ${{ !env.ACT }}
128156
run: |
129-
just python-dist
130-
just python python-wheelhouse-test
157+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
158+
sudo udevadm control --reload-rules
159+
sudo udevadm trigger --name-match=kvm
160+
sudo chmod 666 /dev/kvm
161+
162+
- name: Build release wheels and run wheelhouse test
163+
run: just python-wheelhouse-test
131164

132165
javascript-sandbox:
133166
name: JS Sandbox · lint / build / examples

.github/workflows/publish.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ jobs:
4040
- name: Install clang
4141
run: sudo apt-get update && sudo apt-get install -y clang
4242

43-
- name: Install JS guest dependencies
44-
run: just wasm js-guest-install
45-
4643
- name: Build & Publish
4744
if: ${{ !env.ACT }}
4845
run: |

Justfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ test-rust:
4141

4242
benchmark: python::python-sandbox-benchmark
4343

44-
python-dist: (wasm::build "release") python::python-dist
44+
python-dist: (wasm::build "release") (jssandbox::build "release") python::python-dist
45+
46+
python-wheelhouse-test: python-dist python::python-wheelhouse-test
4547

4648
examples target=default-target: (wasm::examples target) (jssandbox::examples target) python::examples
4749

src/javascript_sandbox/Justfile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ build target=default-target:
77
# If cargo fingerprints exist but the runtime binary is missing, clean stale state
88
# to force hyperlight-js's build script to re-run. This can happen when rust-cache
99
# restores partial artifacts.
10-
if compgen -G "{{repo-root}}/target/debug/build/hyperlight-js-*" > /dev/null && \
11-
[ ! -f "{{repo-root}}/target/hyperlight-js-runtime/x86_64-hyperlight-none/debug/hyperlight-js-runtime" ]; then
12-
echo "Cleaning stale hyperlight-js build artifacts..."
13-
rm -rf {{repo-root}}/target/hyperlight-js-runtime \
14-
{{repo-root}}/target/debug/build/hyperlight-js-* \
15-
{{repo-root}}/target/debug/.fingerprint/hyperlight-js-*
16-
fi
10+
for profile in debug release; do
11+
if compgen -G "{{repo-root}}/target/$profile/build/hyperlight-js-*" > /dev/null && \
12+
[ ! -f "{{repo-root}}/target/hyperlight-js-runtime/x86_64-hyperlight-none/$profile/hyperlight-js-runtime" ]; then
13+
echo "Cleaning stale hyperlight-js $profile build artifacts..."
14+
rm -rf {{repo-root}}/target/hyperlight-js-runtime \
15+
{{repo-root}}/target/$profile/build/hyperlight-js-* \
16+
{{repo-root}}/target/$profile/.fingerprint/hyperlight-js-*
17+
fi
18+
done
1719
{{ wit-world }} cargo build --manifest-path {{repo-root}}/src/javascript_sandbox/Cargo.toml --profile={{ if target == "debug" {"dev"} else { target } }}
1820

1921
#### EXAMPLES ####

src/sdk/python/Justfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ python-publish repository="pypi":
7373
uv publish "${publish_url[@]}" {{javascript-guest-dist}}/*
7474
uv publish "${publish_url[@]}" {{core-dist}}/*
7575

76-
python-wheelhouse-test: python-dist
76+
# Smoke-test the wheels in dist/pythonsdk/ by installing them into
77+
# isolated environments and running basic tests.
78+
# Requires `just python-dist` (root) to have been run first.
79+
python-wheelhouse-test:
7780
#!/usr/bin/env bash
7881
set -e
7982
root={{repo-root}}

src/wasm_sandbox/Justfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,15 @@ guest-compile-wit: ensure-tools
2222
@# Without this, cargo won't detect that sandbox-world.wasm changed
2323
@# and SDKs will fail at runtime with "vector parameter missing length".
2424
rm -rf {{repo-root}}/target/hyperlight-wasm-runtime \
25+
{{repo-root}}/target/hyperlight-js-runtime \
2526
{{repo-root}}/target/debug/build/hyperlight-wasm-* \
2627
{{repo-root}}/target/debug/.fingerprint/hyperlight-wasm-* \
2728
{{repo-root}}/target/release/build/hyperlight-wasm-* \
2829
{{repo-root}}/target/release/.fingerprint/hyperlight-wasm-* \
30+
{{repo-root}}/target/debug/build/hyperlight-js-* \
31+
{{repo-root}}/target/debug/.fingerprint/hyperlight-js-* \
32+
{{repo-root}}/target/release/build/hyperlight-js-* \
33+
{{repo-root}}/target/release/.fingerprint/hyperlight-js-* \
2934
{{repo-root}}/src/sdk/python/wasm_backend/target/hyperlight-wasm-runtime \
3035
{{repo-root}}/src/sdk/python/wasm_backend/target/debug/build/hyperlight-wasm-* \
3136
{{repo-root}}/src/sdk/python/wasm_backend/target/debug/.fingerprint/hyperlight-wasm-* \

0 commit comments

Comments
 (0)