Skip to content

Commit

Permalink
ci(test): Add 32-bit CI tests (#2126)
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Henderson <[email protected]>
  • Loading branch information
hairyhenderson authored Jun 23, 2024
1 parent 6290186 commit 36bafcf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,26 @@ 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/[email protected]
- run: |
git config --global user.email "[email protected]"
git config --global user.name "Someone"
git config --global --add safe.directory /__w/gomplate/gomplate
- 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:
Expand All @@ -45,10 +49,5 @@ jobs:
git config --global user.email "[email protected]"
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
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 36bafcf

Please sign in to comment.