From 41aa647730347d0e01422759283cdeaaa3af2fd5 Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Sat, 22 Jun 2024 15:41:54 -0400 Subject: [PATCH] ci(test): Add 32-bit CI tests Signed-off-by: Dave Henderson --- .github/workflows/build.yml | 20 +++++++------------- Makefile | 6 +++++- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1ec9fe305..b6e8532bd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,10 @@ jobs: runs-on: ubuntu-latest container: image: ghcr.io/hairyhenderson/gomplate-ci-build + strategy: + fail-fast: false + matrix: + goarch: [ '386', 'amd64' ] steps: - run: | git config --global user.email "bogus@example.com" @@ -19,14 +23,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 }} + - run: make test GOARCH=${{ matrix.goarch }} + - run: make integration GOARCH=${{ matrix.goarch }} windows-build: runs-on: windows-latest env: @@ -45,10 +44,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 046092da6..b1a9381ea 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