Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/Benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Download Wasm Modules
uses: actions/download-artifact@v5
with:
name: guest-modules
name: guest-modules-latest
path: ./x64/${{ matrix.config }}

### Benchmarks ###
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CreateRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
- name: Download Wasm Modules
uses: actions/download-artifact@v5
with:
name: guest-modules
name: guest-modules-latest
path: ${{ env.PLATFORM }}/${{ env.CONFIG }}
- name: Build rust wasm modules
run: just build-rust-wasm-examples ${{ env.CONFIG }}
Expand Down
48 changes: 37 additions & 11 deletions .github/workflows/dep_build_wasm_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,13 @@ permissions:
contents: read

jobs:
build-wasm-examples:
build-docker-image:
if: ${{ inputs.docs_only == 'false' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Remove default clang
run: sudo rm /usr/bin/clang
- name: Hyperlight setup workflow
uses: hyperlight-dev/ci-setup-workflow@v1.8.0
with:
rust-toolchain: "1.89"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Registry
Expand Down Expand Up @@ -76,15 +70,47 @@ jobs:
tags: ghcr.io/${{ github.repository_owner }}/wasm-clang-builder:latest
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/wasm-clang-builder:buildcache
cache-to: ${{ env.CACHE_TO }}
- name: Build Modules

build-wasm-examples:
needs: build-docker-image
runs-on: ubuntu-latest
strategy:
matrix:
wasmtime_version:
- name: latest
features: ""
- name: lts
features: "wasmtime_lts"
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Remove default clang
run: sudo rm /usr/bin/clang
- name: Hyperlight setup workflow
uses: hyperlight-dev/ci-setup-workflow@v1.8.0
with:
rust-toolchain: "1.89"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull wasm-clang-builder
run: |
docker pull ghcr.io/${{ github.repository_owner }}/wasm-clang-builder:latest
- name: Build Modules (wasmtime ${{ matrix.wasmtime_version.name }})
run: |
just ensure-tools
just build-wasm-examples release
just build-wasm-examples release ${{ matrix.wasmtime_version.features }}
shell: bash
working-directory: src/wasmsamples
- name: Upload Wasm Modules
- name: Upload Wasm Modules (wasmtime ${{ matrix.wasmtime_version.name }})
uses: actions/upload-artifact@v4
with:
name: guest-modules
name: guest-modules-${{ matrix.wasmtime_version.name }}
path: |
x64/release/*.aot
37 changes: 27 additions & 10 deletions .github/workflows/dep_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,28 @@ jobs:
hypervisor: [hyperv, mshv3, kvm] # hyperv is windows, mshv and kvm are linux
cpu: [amd, intel]
config: [debug, release]
wasmtime: [latest, lts]
exclude:
# Latest testing: skip Windows, Intel, and debug builds to reduce CI load
- wasmtime: latest
hypervisor: hyperv
- wasmtime: latest
cpu: intel
- wasmtime: latest
config: debug

runs-on: ${{ fromJson(
format('["self-hosted", "{0}", "X64", "1ES.Pool=hld-{1}-{2}"]',
matrix.hypervisor == 'hyperv' && 'Windows' || 'Linux',
matrix.hypervisor == 'hyperv' && 'win2022' || matrix.hypervisor == 'mshv3' && 'azlinux3-mshv' || matrix.hypervisor,
matrix.cpu)) }}
matrix.cpu)) }}
env:
# Features to pass to cargo.
# On windows hyperv do not pass any features.
# On Windows LTS builds, only add wasmtime_lts.
# On Linux, always pass the hypervisor feature (kvm/mshv3).
# On Linux LTS builds, also add wasmtime_lts.
FEATURES: ${{ matrix.hypervisor != 'hyperv' && format('{0}{1}', matrix.hypervisor, matrix.wasmtime == 'lts' && ',wasmtime_lts' || '') || (matrix.wasmtime == 'lts' && 'wasmtime_lts' || '') }}
steps:
- uses: actions/checkout@v5

Expand All @@ -70,7 +86,7 @@ jobs:
- name: Download Wasm Modules
uses: actions/download-artifact@v5
with:
name: guest-modules
name: guest-modules-${{ matrix.wasmtime }}
path: ./x64/${{ matrix.config }}

- name: Build Rust component model examples
Expand All @@ -79,7 +95,7 @@ jobs:
# because the component model example depends on the wasm component built here
just ensure-tools
just compile-wit
just build-rust-component-examples ${{ matrix.config }}
just build-rust-component-examples ${{ matrix.config }} ${{ matrix.wasmtime == 'lts' && 'wasmtime_lts' || '' }}

- name: Fmt
run: just fmt-check
Expand All @@ -88,15 +104,15 @@ jobs:
run: just clippy ${{ matrix.config }}

- name: Build
run: just build ${{ matrix.config }}
run: just build ${{ matrix.config }} ${{ env.FEATURES }}
working-directory: ./src/hyperlight_wasm

- name: Build Rust Wasm examples
run: just build-rust-wasm-examples ${{ matrix.config }}
run: just build-rust-wasm-examples ${{ matrix.config }} ${{ matrix.wasmtime == 'lts' && 'wasmtime_lts' || '' }}
working-directory: ./src/hyperlight_wasm

- name: Test
run: just test ${{ matrix.config }}
run: just test ${{ matrix.config }} ${{ env.FEATURES }}
working-directory: ./src/hyperlight_wasm

- name: Install github-cli (Windows)
Expand All @@ -114,21 +130,21 @@ jobs:
shell: pwsh

- name: Test Examples
run: just examples-ci ${{ matrix.config }}
run: just examples-ci ${{ matrix.config }} ${{ env.FEATURES }}
working-directory: ./src/hyperlight_wasm
env:
# required for gh cli when downloading
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Test Component Model Examples
run: just examples-components ${{ matrix.config }}
run: just examples-components ${{ matrix.config }} ${{ env.FEATURES }}
working-directory: ./src/hyperlight_wasm

### Benchmarks ###

- name: Download benchmarks from "latest"
run: |
just bench-download ${{ runner.os }} ${{ matrix.hypervisor }} ${{ matrix.cpu }} dev-latest
just bench-download ${{ runner.os }} ${{ matrix.hypervisor }} ${{ matrix.cpu }} dev-latest ${{ matrix.wasmtime }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
Expand All @@ -137,6 +153,7 @@ jobs:

- name: Run benchmarks
run: |
just bench-ci dev ${{ matrix.config }}
just bench-ci dev ${{ matrix.config }} ${{ env.FEATURES }}
working-directory: ./src/hyperlight_wasm
if: ${{ matrix.config == 'release' }}

Loading
Loading