Skip to content

Bump testing to go1.22 #91

Bump testing to go1.22

Bump testing to go1.22 #91

Workflow file for this run

name: wasip1/wasm (smoke test)
on:
push:
branches:
- 'master'
paths:
- 'action.yml'
- '.github/workflows/wasip1_wasm.yml'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
- name: Build go from tip
uses: iwdgo/gotip-build@master
id: gotip
with:
go_variables: GOOS=wasip1 GOARCH=wasm GOROOT_FINAL=/home/runner/work/gotip-build/gotip-build/go
test_build: false
- name: Install Go wasm
run: |
mv -f go/bin/${{ env.goos }}_${{ env.goarch }}/* go/bin/ # erase native build
- name: Test using wasmtime
run: |
curl https://wasmtime.dev/install.sh -sSf | bash
export WASMTIME_HOME="$HOME/.wasmtime"
echo $WASMTIME_HOME
export PATH="$WASMTIME_HOME/bin:$PATH"
echo $PATH
# wasmtime help
# Go config
export GOWASIRUNTIME=wasmtime
cd ./go
./misc/wasm/go_wasip1_wasm_exec ./bin/go env
./misc/wasm/go_wasip1_wasm_exec ./bin/go tool
# Set up as run.bash
export GO_TEST_TIMEOUT_SCALE=4
export GOPROXY="https://proxy.golang.org,direct"
export GOSUMDB="sum.golang.org"
export GOENV=off
eval $(./misc/wasm/go_wasip1_wasm_exec ./bin/go tool dist env)
unset CDPATH # in case user has it set
export GOHOSTOS
export CC
export GOPATH=/nonexist-gopath
# TODO Fails with go: RLock /home/runner/work/go-upon-ci/go-upon-ci/go/src/go.mod: unsupported operation
# ./misc/wasm/go_wasip1_wasm_exec ./bin/go test ./...
- name: Test using wazero
run: |
curl https://wazero.io/install.sh | sh
ls -l ./bin
export PATH="$(pwd)/bin:$PATH"
echo $PATH
wazero version
wazero -h
# Go config
export GOWASIRUNTIME=wazero
cd ./go
wazero run --cachedir=/home/runner/.cache/go-build -interpreter -mount=/:/ ./bin/go env
wazero run --cachedir=/home/runner/.cache/go-build -interpreter -mount=/:/ ./bin/go tool
# Set up as run.bash
export GO_TEST_TIMEOUT_SCALE=4
export GOPROXY="https://proxy.golang.org,direct"
export GOSUMDB="sum.golang.org"
export GOENV=off
eval $(./misc/wasm/go_wasip1_wasm_exec ./bin/go tool dist env)
unset CDPATH # in case user has it set
export GOHOSTOS
export CC
export GOPATH=/nonexist-gopath
# pattern ./...: directory prefix / does not contain main module or its selected dependencies
# wazero run --cachedir=/home/runner/.cache/go-build -interpreter -mount=/:/ ./bin/go test ./...
- name: Test using wasmedge
shell: bash
run: |
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash
source $HOME/.bashrc
export GOWASIRUNTIME=wasmedge
$HOME/.wasmedge/bin/wasmedge -v
# $HOME/.wasmedge/bin/wasmedge -h
echo $PATH
# Go config
export GOHOSTOS=wasip1 GOHOSTARCH=wasm
# Does not exist /home/runner/.config/go/env
cd ./go
$HOME/.wasmedge/bin/wasmedge --dir=/ --env PWD="$PWD" --env PATH="$PATH" ./bin/go env
$HOME/.wasmedge/bin/wasmedge --dir=/ --env PWD="$PWD" --env PATH="$PATH" ./bin/go tool
# Set up as run.bash
# export GO_TEST_TIMEOUT_SCALE=4
# export GOENV=off
# eval $($HOME/.wasmedge/bin/wasmedge --dir=/ --env PWD="$PWD" --env PATH="$PATH" ../bin/go run cmd/dist env)
# unset CDPATH # in case user has it set
# export CC
# export GOPATH=/nonexist-gopath
# $HOME/.wasmedge/bin/wasmedge --dir=/ --env PWD="$PWD" --env PATH="$PATH" ./bin/go
- name: Test using wasmer
if: false
run: |
curl https://get.wasmer.io -sSfL | sh
source /home/runner/.wasmer/wasmer.sh
export GOWASIRUNTIME=wasmer
wasmer -V
wasmer -h
# Go config
export GOHOSTOS=wasip1 GOHOSTARCH=wasm
# go env
cd ./go
wasmer run --dir=/ --env PWD="$PWD" --env PATH="$PATH" ./bin/go env
# Set up as run.bash
export GO_TEST_TIMEOUT_SCALE=4
export GOPROXY="https://proxy.golang.org,direct"
export GOSUMDB="sum.golang.org"
export GOENV=off
eval $(./misc/wasm/go_wasip1_wasm_exec ./bin/go run cmd/dist env)
unset CDPATH # in case user has it set
# export CC
export GOPATH=/nonexist-gopath
# ./misc/wasm/go_wasip1_wasm_exec ./bin/go test ./...
- name: Upload go executable
uses: actions/upload-artifact@v3
if: ${{ env.crosscompile == 'true' }}
with:
name: gotip-${{ env.goos }}-${{ env.arch }}
path: go/bin/