diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..9cbc57d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,9 @@ +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "gomod" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml index d413744..fa94678 100644 --- a/.github/workflows/go-test.yml +++ b/.github/workflows/go-test.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: '1.20' - name: Set up Rust uses: actions-rs/toolchain@v1 @@ -27,18 +27,8 @@ jobs: toolchain: stable target: wasm32-unknown-unknown - - name: Set up TinyGo - run: | # Installing via curl so commands are similar on OS/x - tinygo_version=0.25.0 - curl -sSL https://github.com/tinygo-org/tinygo/releases/download/v${tinygo_version}/tinygo${tinygo_version}.linux-amd64.tar.gz | sudo tar -C /usr/local -xzf - - echo "TINYGOROOT=/usr/local/tinygo" >> $GITHUB_ENV - echo "/usr/local/tinygo/bin" >> $GITHUB_PATH - - name: Build Wasm run: make build-wasm - name: Test - run: go test -v ./... - - - name: Run Example - run: go run example/main.go waPC! + run: make tests diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index f905259..9710071 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -18,7 +18,7 @@ jobs: uses: golangci/golangci-lint-action@v3 with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: v1.52.2 + version: latest # Optional: working directory, useful for monorepos # working-directory: somedir diff --git a/.gitignore b/.gitignore index f63d930..d5f72ea 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,6 @@ vendor # Mac stuff .DS_Store + +# Generated wasm files +*.wasm diff --git a/go.mod b/go.mod index 6dc4e14..3752eea 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,10 @@ module github.com/wapc/wapc-go -go 1.18 +go 1.20 require ( - github.com/Workiva/go-datastructures v1.0.53 + github.com/Workiva/go-datastructures v1.1.5 github.com/bytecodealliance/wasmtime-go v1.0.0 - github.com/tetratelabs/wazero v1.0.0 + github.com/tetratelabs/wazero v1.7.3 github.com/wasmerio/wasmer-go v1.0.4 ) diff --git a/go.sum b/go.sum index 715e524..c038411 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/Workiva/go-datastructures v1.0.53 h1:J6Y/52yX10Xc5JjXmGtWoSSxs3mZnGSaq37xZZh7Yig= -github.com/Workiva/go-datastructures v1.0.53/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= +github.com/Workiva/go-datastructures v1.1.5 h1:5YfhQ4ry7bZc2Mc7R0YZyYwpf5c6t1cEFvdAhd6Mkf4= +github.com/Workiva/go-datastructures v1.1.5/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= github.com/bytecodealliance/wasmtime-go v1.0.0 h1:9u9gqaUiaJeN5IoD1L7egD8atOnTGyJcNp8BhkL9cUU= github.com/bytecodealliance/wasmtime-go v1.0.0/go.mod h1:jjlqQbWUfVSbehpErw3UoWFndBXRRMvfikYH6KsCwOg= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -10,8 +10,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= -github.com/tetratelabs/wazero v1.0.0 h1:sCE9+mjFex95Ki6hdqwvhyF25x5WslADjDKIFU5BXzI= -github.com/tetratelabs/wazero v1.0.0/go.mod h1:wYx2gNRg8/WihJfSDxA1TIL8H+GkfLYm+bIfbblu9VQ= +github.com/tetratelabs/wazero v1.7.3 h1:PBH5KVahrt3S2AHgEjKu4u+LlDbbk+nsGE3KLucy6Rw= +github.com/tetratelabs/wazero v1.7.3/go.mod h1:ytl6Zuh20R/eROuyDaGPkp82O9C/DJfXAwJfQ3X6/7Y= github.com/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg= github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= github.com/wasmerio/wasmer-go v1.0.4 h1:MnqHoOGfiQ8MMq2RF6wyCeebKOe84G88h5yv+vmxJgs= diff --git a/hello/Makefile b/hello/Makefile index f68b3b4..6be5c40 100644 --- a/hello/Makefile +++ b/hello/Makefile @@ -2,4 +2,4 @@ build: @echo "----------" @echo "Building Go wasm Guest" @echo "----------" - tinygo build -o hello.wasm -scheduler=none --no-debug -target=wasi main.go + docker run -v `pwd`/:/build -w /build tinygo/tinygo:0.25.0 tinygo build -o hello.wasm -scheduler=none --no-debug -target=wasi main.go diff --git a/hello/hello.wasm b/hello/hello.wasm deleted file mode 100755 index 8a4f80b..0000000 Binary files a/hello/hello.wasm and /dev/null differ diff --git a/testdata/as/hello.wasm b/testdata/as/hello.wasm deleted file mode 100644 index e84a4f2..0000000 Binary files a/testdata/as/hello.wasm and /dev/null differ diff --git a/testdata/go/Makefile b/testdata/go/Makefile index f68b3b4..6be5c40 100644 --- a/testdata/go/Makefile +++ b/testdata/go/Makefile @@ -2,4 +2,4 @@ build: @echo "----------" @echo "Building Go wasm Guest" @echo "----------" - tinygo build -o hello.wasm -scheduler=none --no-debug -target=wasi main.go + docker run -v `pwd`/:/build -w /build tinygo/tinygo:0.25.0 tinygo build -o hello.wasm -scheduler=none --no-debug -target=wasi main.go diff --git a/testdata/go/hello.wasm b/testdata/go/hello.wasm deleted file mode 100755 index f2e9ba0..0000000 Binary files a/testdata/go/hello.wasm and /dev/null differ diff --git a/testdata/rust/hello.wasm b/testdata/rust/hello.wasm deleted file mode 100755 index 69bcad6..0000000 Binary files a/testdata/rust/hello.wasm and /dev/null differ