summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Henderson <dhenderson@gmail.com>2024-06-23 19:55:51 -0400
committerGitHub <noreply@github.com>2024-06-23 19:55:51 -0400
commit36bafcf8a275d8f350511d638fa5b54008e345b3 (patch)
tree54fc6bbf5151365690977492952ea159257b8830
parent62901868f10e887f602e85b37eac70c77f864cc4 (diff)
ci(test): Add 32-bit CI tests (#2126)
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
-rw-r--r--.github/workflows/build.yml25
-rw-r--r--Makefile6
2 files changed, 17 insertions, 14 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 1ec9fe30..3327431c 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -11,7 +11,16 @@ jobs:
runs-on: ubuntu-latest
container:
image: ghcr.io/hairyhenderson/gomplate-ci-build
+ strategy:
+ fail-fast: false
+ matrix:
+ goarch: [ '386', 'amd64', 'arm', 'arm64' ]
+ include:
+ - goarch: 'arm'
+ goarm: '7'
steps:
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v3.0.0
- run: |
git config --global user.email "bogus@example.com"
git config --global user.name "Someone"
@@ -19,14 +28,9 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- - run: make build
- - name: Save binary
- uses: actions/upload-artifact@v4
- with:
- name: gomplate
- path: bin/gomplate
- - run: make test
- - run: make integration
+ - run: make build GOARCH=${{ matrix.goarch }} GOARM=${{ matrix.goarm }}
+ - run: make test GOARCH=${{ matrix.goarch }} GOARM=${{ matrix.goarm }}
+ - run: make integration GOARCH=${{ matrix.goarch }} GOARM=${{ matrix.goarm }}
windows-build:
runs-on: windows-latest
env:
@@ -45,10 +49,5 @@ jobs:
git config --global user.email "bogus@example.com"
git config --global user.name "Someone"
- run: make build
- - name: Save binary
- uses: actions/upload-artifact@v4
- with:
- name: gomplate.exe
- path: bin/gomplate.exe
- run: make test
- run: make integration
diff --git a/Makefile b/Makefile
index 046092da..b1a9381e 100644
--- a/Makefile
+++ b/Makefile
@@ -147,7 +147,11 @@ $(PREFIX)/bin/$(PKG_NAME)$(call extension,$(GOOS)): $(PREFIX)/bin/$(PKG_NAME)_$(
build: $(PREFIX)/bin/$(PKG_NAME)_$(GOOS)-$(GOARCH)$(TARGETVARIANT)$(call extension,$(GOOS)) $(PREFIX)/bin/$(PKG_NAME)$(call extension,$(GOOS))
-ifeq ($(OS),Windows_NT)
+# test with race detector on supported platforms
+# windows/amd64 is supported in theory, but in practice it requires a C compiler
+race_platforms := 'linux/amd64' 'darwin/amd64' 'darwin/arm64'
+ifeq (,$(findstring '$(GOOS)/$(GOARCH)',$(race_platforms)))
+export CGO_ENABLED=0
test:
$(GO) test -coverprofile=c.out ./...
else