@@ -68,15 +68,23 @@ jobs:
6868 steps :
6969 - uses : actions/checkout@v4
7070
71- - name : Install Go (for kraft-hyperlight)
72- run : |
73- curl -sL https://go.dev/dl/go1. 25.1.linux-amd64.tar.gz | sudo tar -C /usr/local -xz
74- echo "/usr/local/go/bin" >> $GITHUB_PATH
71+ - uses : actions/setup-go@v5
72+ with :
73+ go-version : ' 1. 25.1'
74+ cache : false
7575
7676 - name : Install just
7777 uses : extractions/setup-just@v2
7878
79+ - name : Cache kraft-hyperlight
80+ id : kraft-cache
81+ uses : actions/cache@v4
82+ with :
83+ path : /usr/local/bin/kraft-hyperlight
84+ key : kraft-hyperlight-linux-${{ hashFiles('.github/workflows/test-examples.yml') }}
85+
7986 - name : Build kraft-hyperlight
87+ if : steps.kraft-cache.outputs.cache-hit != 'true'
8088 run : |
8189 git clone --branch hyperlight-platform --depth 1 \
8290 https://github.com/danbugs/kraftkit.git /tmp/kraftkit
@@ -224,6 +232,10 @@ jobs:
224232 steps :
225233 - uses : actions/checkout@v4
226234
235+ - uses : Swatinem/rust-cache@v2
236+ with :
237+ workspaces : host -> target
238+
227239 - name : Enable KVM permissions (no-op if device absent)
228240 run : |
229241 echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
@@ -387,15 +399,23 @@ jobs:
387399 steps :
388400 - uses : actions/checkout@v4
389401
390- - name : Install Go (for kraft-hyperlight)
391- run : |
392- curl -sL https://go.dev/dl/go1. 25.1.linux-amd64.tar.gz | sudo tar -C /usr/local -xz
393- echo "/usr/local/go/bin" >> $GITHUB_PATH
402+ - uses : actions/setup-go@v5
403+ with :
404+ go-version : ' 1. 25.1'
405+ cache : false
394406
395407 - name : Install just
396408 uses : extractions/setup-just@v2
397409
410+ - name : Cache kraft-hyperlight
411+ id : kraft-cache
412+ uses : actions/cache@v4
413+ with :
414+ path : /usr/local/bin/kraft-hyperlight
415+ key : kraft-hyperlight-linux-${{ hashFiles('.github/workflows/test-examples.yml') }}
416+
398417 - name : Build kraft-hyperlight
418+ if : steps.kraft-cache.outputs.cache-hit != 'true'
399419 run : |
400420 git clone --branch hyperlight-platform --depth 1 \
401421 https://github.com/danbugs/kraftkit.git /tmp/kraftkit
@@ -532,17 +552,19 @@ jobs:
532552 steps :
533553 - uses : actions/checkout@v4
534554
535- - name : Install hyperlight-unikraft host binaries
555+ - uses : Swatinem/rust-cache@v2
556+ with :
557+ workspaces : host -> target
558+
559+ - name : Build host binaries
536560 shell : pwsh
537561 run : |
538- cargo install --git https://github.com/${{ github.repository }} `
539- --branch ${{ github.head_ref || github.ref_name }} `
540- hyperlight-unikraft-host `
541- --bin hyperlight-unikraft `
542- --bin multifn-test `
543- --bin pydriver-run `
544- --bin pyhl `
545- --locked --force
562+ cd host
563+ cargo build --release --bin hyperlight-unikraft --bin multifn-test --bin pydriver-run --bin pyhl
564+ Copy-Item target\release\hyperlight-unikraft.exe $env:USERPROFILE\.cargo\bin\ -Force
565+ Copy-Item target\release\multifn-test.exe $env:USERPROFILE\.cargo\bin\ -Force
566+ Copy-Item target\release\pydriver-run.exe $env:USERPROFILE\.cargo\bin\ -Force
567+ Copy-Item target\release\pyhl.exe $env:USERPROFILE\.cargo\bin\ -Force
546568
547569 - name : Download prebuilt image
548570 uses : actions/download-artifact@v4
@@ -636,6 +658,10 @@ jobs:
636658 steps :
637659 - uses : actions/checkout@v4
638660
661+ - uses : Swatinem/rust-cache@v2
662+ with :
663+ workspaces : host -> target
664+
639665 # Linux needs /dev/kvm access to run the guest.
640666 - name : Enable KVM permissions (Linux only)
641667 if : runner.os == 'Linux'
@@ -660,11 +686,9 @@ jobs:
660686 - name : Install pyhl
661687 shell : pwsh
662688 run : |
663- cargo install --git https://github.com/${{ github.repository }} `
664- --branch ${{ github.head_ref || github.ref_name }} `
665- hyperlight-unikraft-host `
666- --bin pyhl `
667- --locked --force
689+ cd host
690+ cargo build --release --bin pyhl
691+ Copy-Item target/release/pyhl* $env:USERPROFILE/.cargo/bin/ -Force
668692
669693 - name : Download prebuilt python-agent-driver image
670694 uses : actions/download-artifact@v4
0 commit comments