Skip to content

internal/wasmtools: vendor wasm-tools with WebAssembly #946

internal/wasmtools: vendor wasm-tools with WebAssembly

internal/wasmtools: vendor wasm-tools with WebAssembly #946

Workflow file for this run

name: Go
on:
push:
branches:
- main
pull_request:
paths-ignore:
- '.prettier*'
- '.vscode/**'
- '**/*.md'
- 'docs/**'
- 'LICENSE'
env:
go-modules: ./... ./cm/...
wasm-tools-version: "1.219.1"
wasmtime-version: "26.0.0"
jobs:
# Vet Go code
vet-go:
name: Vet Go code
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Vet Go code
run: go vet ${{ env.go-modules }} ./tests/...
# Test with Go
test-go:
name: Test with Go
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
go-version: ["1.22", "1.23"]
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Run Go tests
run: go test -v ${{ env.go-modules }}
- name: Run Go tests with race detector
run: go test -v -race ${{ env.go-modules }}
- name: Test Go without cgo
env:
CGO_ENABLED: 0
run: go test -v ${{ env.go-modules }}
- name: Verify repo is unchanged
run: git diff --exit-code HEAD
# Test with TinyGo
test-tinygo:
name: Test with TinyGo
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
go-version: ["1.22", "1.23"]
tinygo-version: ["0.32.0", "0.33.0", "0.34.0"]
exclude:
- go-version: "1.23"
tinygo-version: "0.32.0"
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Set up TinyGo
uses: acifani/setup-tinygo@v2
with:
tinygo-version: ${{ matrix.tinygo-version }}
- name: Test with TinyGo
run: tinygo test -v ${{ env.go-modules }}
- name: Verify repo is unchanged
run: git diff --exit-code HEAD
# Test with WebAssembly
test-wasm:
name: Test with WebAssembly
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
go-version: ["1.22", "1.23"]
tinygo-version: ["0.32.0", "0.33.0", "0.34.0"]
exclude:
- go-version: "1.23"
tinygo-version: "0.32.0"
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Set up TinyGo
uses: acifani/setup-tinygo@v2
with:
tinygo-version: ${{ matrix.tinygo-version }}
# TinyGo needs wasm-tools for -target=wasip2
- name: Set up wasm-tools
uses: bytecodealliance/actions/wasm-tools/setup@v1
with:
version: ${{ env.wasm-tools-version }}
- name: Set up Wasmtime
uses: bytecodealliance/actions/wasmtime/setup@v1
with:
version: ${{ env.wasmtime-version }}
- name: Add Go wasm exec to $PATH
run: echo "$(go env GOROOT)/misc/wasm" >> $GITHUB_PATH
- name: Regenerate Go
run: make tests/generated
- name: Verify repo is unchanged
run: git diff --exit-code HEAD
- name: Test wasm/wasip1 with Go
env:
GOARCH: wasm
GOOS: wasip1
run: go test -v ${{ env.go-modules }}
- name: Test wasm/wasip1 with TinyGo 0.32.0
if: ${{ matrix.tinygo-version == '0.32.0' }}
run: tinygo test -v -target=wasi ${{ env.go-modules }}
- name: Test wasm/wasip1 with TinyGo >= 0.33.0
if: ${{ matrix.tinygo-version != '0.32.0' }}
run: tinygo test -v -target=wasip1 ${{ env.go-modules }}
- name: Test wasm/wasip2 with TinyGo >= 0.33.0
if: ${{ matrix.tinygo-version != '0.32.0' }}
run: tinygo test -v -target=wasip2 ${{ env.go-modules }}
- name: Test generated Go with TinyGo >= 0.34.0
if: ${{ matrix.tinygo-version != '0.32.0' && matrix.tinygo-version != '0.33.0' }}
run: tinygo test -v -target wasip2 ./tests/...
- name: Verify repo is unchanged
run: git diff --exit-code HEAD