From ee4e0b849343775b1d5611c27ca781eb09824ba1 Mon Sep 17 00:00:00 2001 From: diamondburned Date: Tue, 28 May 2024 13:14:15 -0700 Subject: [PATCH] add workflow that guarantees Tinygo build This workflow guarantees that at least these packages build under Tinygo x86_64 and WASM: - mvdan.cc/sh/v3/expand - mvdan.cc/sh/v3/syntax - mvdan.cc/sh/v3/interp --- .github/workflows/test.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3e2a57dd..5c27f025 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,6 +40,32 @@ jobs: - name: Test as root, without cgo, and with busybox run: docker run -v="$PWD:/pwd" -w=/pwd -e=CGO_ENABLED=0 golang:1.22.0-alpine go test ./... + test-tinygo: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Tinygo + uses: acifani/setup-tinygo@v2 + + - name: Create temporary main package + run: | + mkdir _tinygo && cat< _tinygo/main.go + package main + + import ( + _ "mvdan.cc/sh/v3/expand" + _ "mvdan.cc/sh/v3/interp" + _ "mvdan.cc/sh/v3/syntax" + ) + + func main() {} + EOF + + - name: Build with Tinygo natively + run: tinygo build -o /dev/null ./_tinygo + - name: Build with Tinygo on WASM + run: tinygo build -o /dev/null -target wasm ./_tinygo + docker: name: Build and test Docker images # Only deploy if previous stages pass.