From d5c3dedca690ae348154cb8a36159a31f78a47c4 Mon Sep 17 00:00:00 2001 From: Chris Wiggins Date: Fri, 15 May 2026 11:48:50 -0600 Subject: [PATCH] feat(ci): run a go test before we build Former-commit-id: 54a13b268e34cad5496aa67a4966680c67edb245 --- .github/workflows/test.yml | 14 ++++++++++++++ Makefile | 7 +++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ea50179..45b3674 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: diff --git a/Makefile b/Makefile index 53c4bb2..759656f 100644 --- a/Makefile +++ b/Makefile @@ -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 \ No newline at end of file + CGO_ENABLED=0 GOOS=freebsd GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o bin/newt_freebsd_arm64