From c4273aae7cdc05a7455937f3fb492195d8d06799 Mon Sep 17 00:00:00 2001 From: Joseph Ferguson Date: Mon, 25 Sep 2023 15:48:32 -0700 Subject: [PATCH] Add windows servers to smoke test Disable cgo to fix build failure on GHA windows-2022 --- .github/workflows/ci.yml | 11 +++++++---- bashbrew.sh | 3 ++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82f92300..76c1dc48 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,9 +11,12 @@ defaults: shell: 'bash -Eeuo pipefail -x {0}' jobs: - build: - name: Build - runs-on: ubuntu-latest + build-matrix: + strategy: + matrix: + os: [ ubuntu-latest, windows-2019, windows-2022 ] + name: Build ${{ matrix.os }} + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - uses: ./ # test our "action.yml" 👀 @@ -25,7 +28,7 @@ jobs: bashbrew cat "$image" bashbrew from --uniq "$image" - "$BASHBREW_SCRIPTS/bashbrew-host-arch.sh" # should print "amd64" + "$BASHBREW_SCRIPTS/bashbrew-host-arch.sh" # should print "amd64" or "windows-amd64" arm32v7="$("$BASHBREW_SCRIPTS/bashbrew-arch-to-goenv.sh" arm32v7)" eval "$arm32v7" diff --git a/bashbrew.sh b/bashbrew.sh index 24c9d93e..42c8f440 100755 --- a/bashbrew.sh +++ b/bashbrew.sh @@ -6,7 +6,8 @@ set -Eeuo pipefail dir="$(readlink -f "$BASH_SOURCE")" dir="$(dirname "$dir")" -export GO111MODULE=on +: "${CGO_ENABLED:=0}" +export GO111MODULE=on CGO_ENABLED ( cd "$dir" go build -o bin/bashbrew ./cmd/bashbrew > /dev/null