From d63ae74faaef274fb735cf8d9bf4cd5617934610 Mon Sep 17 00:00:00 2001 From: Ben McClelland Date: Fri, 18 Apr 2025 10:08:10 -0700 Subject: [PATCH] feat: add matrix build tests to github workflow We support several build targets, so need to verify these for PR checks. This adds the following build tsargets to the matrix builds: os: [darwin, freebsd, linux] arch: [amd64, arm64] --- .github/workflows/go.yml | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 985d2bc..2a727b8 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -3,7 +3,7 @@ on: pull_request jobs: build: - name: Build + name: Go Basic Checks runs-on: ubuntu-latest steps: @@ -23,9 +23,6 @@ jobs: run: | go get -v -t -d ./... - - name: Build - run: make - - name: Test run: go test -coverprofile profile.txt -race -v -timeout 30s -tags=github ./... @@ -35,4 +32,26 @@ jobs: - name: Run govulncheck run: govulncheck ./... - shell: bash \ No newline at end of file + shell: bash + + verify-build: + name: Verify Build Targets + needs: build + runs-on: ubuntu-latest + strategy: + matrix: + os: [darwin, freebsd, linux] + arch: [amd64, arm64] + steps: + + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 'stable' + + - name: Build for ${{ matrix.os }}/${{ matrix.arch }} + run: | + GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o versitygw-${{ matrix.os }}-${{ matrix.arch }} cmd/versitygw/*.go \ No newline at end of file