Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(test): Add 32-bit & ARM CI tests #2126

Merged
merged 1 commit into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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