feat(ci): run a go test before we build

Former-commit-id: 54a13b268e
This commit is contained in:
Chris Wiggins
2026-05-15 11:48:50 -06:00
parent 1de3076808
commit d5c3dedca6
2 changed files with 19 additions and 2 deletions

View File

@@ -10,6 +10,20 @@ on:
- dev
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 1.25
- name: Run Go tests
run: make test
build:
runs-on: ubuntu-latest
strategy:

View File

@@ -1,4 +1,4 @@
.PHONY: all local docker-build docker-build-release
.PHONY: all local test docker-build docker-build-release
all: local
@@ -8,6 +8,9 @@ LDFLAGS = -X main.newtVersion=$(VERSION)
local:
CGO_ENABLED=0 go build -ldflags "$(LDFLAGS)" -o ./bin/newt
test:
go test ./...
docker-build:
docker build -t fosrl/newt:latest .
@@ -70,4 +73,4 @@ go-build-release-freebsd-amd64:
CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o bin/newt_freebsd_amd64
go-build-release-freebsd-arm64:
CGO_ENABLED=0 GOOS=freebsd GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o bin/newt_freebsd_arm64
CGO_ENABLED=0 GOOS=freebsd GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o bin/newt_freebsd_arm64