From ae1d4a44837f231daef1f462bf349a3241c8419c Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 13 Nov 2026 12:32:39 +0100 Subject: [PATCH] ci: cross-compile for all Go targets Build every target reported by go tool dist list with each tested Go version to catch platform-specific compilation failures. Run these checks on Linux only, as one host suffices for cross-compilation. Signed-off-by: Sebastiaan van Stijn --- .github/workflows/test.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d270cff..4c7f085 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,6 +33,16 @@ jobs: go-version: ${{ matrix.go }} - name: Test run: go test -v ./... + - name: Cross-compile + # One host OS suffices to cross-compile for all targets. + if: runner.os == 'Linux' + env: + CGO_ENABLED: "0" + run: | + for target in $(go tool dist list); do + echo "# building for $target" + GOOS=${target%/*} GOARCH=${target#*/} go build ./... + done lint: runs-on: ubuntu-latest steps: