Skip to content

Commit b59826c

Browse files
committed
ci: fix pyhl-snapshot-test on both Linux and Windows
Linux: replace pwsh Copy-Item (USERPROFILE is unset) with cp to /usr/local/bin. Windows: add surrogate build consistency check (was missing from the matrix job, only runtime-test-windows had it). Signed-off-by: danbugs <danilochiarlone@gmail.com>
1 parent 294b035 commit b59826c

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

.github/workflows/test-examples.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,17 @@ jobs:
672672
with:
673673
workspaces: host -> target
674674

675+
- name: Ensure surrogate build consistency (Windows only)
676+
if: runner.os == 'Windows'
677+
shell: pwsh
678+
run: |
679+
$hlsExe = "host\target\release\build\hyperlight-host-*\out\..\..\hls\x86_64-pc-windows-msvc\release\hyperlight_surrogate.exe"
680+
if (-not (Resolve-Path $hlsExe -ErrorAction SilentlyContinue)) {
681+
Write-Host "Surrogate missing — clearing hyperlight-host fingerprints to force rebuild"
682+
Get-ChildItem "host\target\release\.fingerprint" -Filter "hyperlight-host-*" -Directory -ErrorAction SilentlyContinue |
683+
Remove-Item -Recurse -Force
684+
}
685+
675686
# Linux needs /dev/kvm access to run the guest.
676687
- name: Enable KVM permissions (Linux only)
677688
if: runner.os == 'Linux'
@@ -693,12 +704,20 @@ jobs:
693704
echo "::warning::/dev/kvm is not available; pyhl test skipped"
694705
fi
695706
696-
- name: Install pyhl
707+
- name: Install pyhl (Linux)
708+
if: runner.os == 'Linux'
709+
run: |
710+
cd host
711+
cargo build --release --bin pyhl
712+
sudo cp target/release/pyhl /usr/local/bin/
713+
714+
- name: Install pyhl (Windows)
715+
if: runner.os == 'Windows'
697716
shell: pwsh
698717
run: |
699718
cd host
700719
cargo build --release --bin pyhl
701-
Copy-Item target/release/pyhl* $env:USERPROFILE/.cargo/bin/ -Force
720+
Copy-Item target\release\pyhl.exe $env:USERPROFILE\.cargo\bin\ -Force
702721
703722
- name: Download prebuilt python-agent-driver image
704723
uses: actions/download-artifact@v4

0 commit comments

Comments
 (0)