From c0a1487cd0df8434cffdf9df97f5d87aa3c37980 Mon Sep 17 00:00:00 2001 From: deadprogram Date: Fri, 25 Sep 2026 09:04:49 +0200 Subject: [PATCH] ci: test against TinyGo dev image Replace src/net in the tinygo-dev image with this repo, then run the net package tests, wasm builds, and the drivers net smoketests. --- .github/workflows/tinygo.yml | 58 ++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/tinygo.yml diff --git a/.github/workflows/tinygo.yml b/.github/workflows/tinygo.yml new file mode 100644 index 0000000..c93c9f8 --- /dev/null +++ b/.github/workflows/tinygo.yml @@ -0,0 +1,58 @@ +name: TinyGo + +on: + push: + branches: [ main ] + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + container: tinygo/tinygo-dev:latest + steps: + - name: Checkout net + uses: actions/checkout@v7 + with: + path: net + + - name: Checkout drivers + uses: actions/checkout@v7 + with: + repository: tinygo-org/drivers + path: drivers + + - name: Replace TinyGo src/net + run: | + rm -rf /tinygo/src/net + cp -r net /tinygo/src/net + tinygo version + + - name: Run package tests + run: | + tinygo test net + tinygo test net/http/internal/ascii + + - name: Build for wasm and wasip1 + run: | + mkdir -p wasmtest + cat > wasmtest/main.go <<'EOF' + package main + + import ( + "net" + "net/http" + ) + + func main() { + _, _ = net.Dial("tcp", "example.com:80") + _, _ = http.Get("http://example.com") + } + EOF + tinygo build -o wasmtest/js.wasm -target=wasm ./wasmtest/main.go + tinygo build -o wasmtest/wasip1.wasm -target=wasip1 ./wasmtest/main.go + + - name: Build drivers net examples + working-directory: drivers + run: | + mkdir -p build + grep "examples/net/" smoketest.sh | sh -ex