From 81829591e0e52e70805e08273a08f89e924f45d0 Mon Sep 17 00:00:00 2001 From: Alex Fournier Date: Wed, 21 Oct 2026 18:49:32 -0700 Subject: [PATCH 1/2] ci(go): validate WASM routing bindings Signed-off-by: Alex Fournier --- .github/workflows/go-bindings.yml | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/go-bindings.yml b/.github/workflows/go-bindings.yml index 964ff0bd1..f8cbc1a66 100644 --- a/.github/workflows/go-bindings.yml +++ b/.github/workflows/go-bindings.yml @@ -44,3 +44,35 @@ jobs: cc testdata/cshared.c -I "$RUNNER_TEMP" -L "$RUNNER_TEMP" \ -Wl,-rpath,"$RUNNER_TEMP" -lswitchyard_smoke -o "$RUNNER_TEMP/shared-host" "$RUNNER_TEMP/shared-host" + + wasm: + name: WASM + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 + with: + go-version-file: bindings/go/go.mod + cache-dependency-path: bindings/go/go.sum + - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 + with: + cache-bin: false + save-if: ${{ github.ref == 'refs/heads/main' }} + - name: Build Go WASM module + run: scripts/build-go-wasm.sh + - name: go test (WASM, no cgo) + working-directory: bindings/go + env: + CGO_ENABLED: "0" + run: go test -count=1 ./... + - name: go vet (WASM, no cgo) + working-directory: bindings/go + env: + CGO_ENABLED: "0" + run: go vet ./... + - name: go test (WASM, race) + working-directory: bindings/go + env: + CGO_ENABLED: "1" + run: go test -count=1 -race ./... From d4ce9c69837d6e9b6608324103b0b625798f519b Mon Sep 17 00:00:00 2001 From: Alex Fournier Date: Fri, 30 Oct 2026 09:51:57 -0700 Subject: [PATCH 2/2] ci(go): build the WASM guest directly Signed-off-by: Alex Fournier --- .github/workflows/go-bindings.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go-bindings.yml b/.github/workflows/go-bindings.yml index f8cbc1a66..f25af16ad 100644 --- a/.github/workflows/go-bindings.yml +++ b/.github/workflows/go-bindings.yml @@ -60,7 +60,11 @@ jobs: cache-bin: false save-if: ${{ github.ref == 'refs/heads/main' }} - name: Build Go WASM module - run: scripts/build-go-wasm.sh + run: | + rustup target add wasm32-wasip1 + cargo build -p switchyard-ffi --target wasm32-wasip1 --release --locked --lib + mkdir -p bindings/go/internal/wasm + cp target/wasm32-wasip1/release/switchyard_ffi.wasm bindings/go/internal/wasm/switchyard.wasm - name: go test (WASM, no cgo) working-directory: bindings/go env: