Run make test and make build in CI

CI duplicated the Makefile's steps and built the binary without -trimpath
or the version-stamped -ldflags, so it could pass while make build failed
and the CI binary reported dev. Make the Makefile the single build
definition: CI now runs make test and make build, then prints the binary's
build info as evidence of the version stamp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-03 00:30:32 -04:00
co-authored by Claude Opus 5.5
parent 9f4537d0cb
commit d1ab3932f8
+11 -36
View File
@@ -1,6 +1,10 @@
# Runs on every push and pull request (no branch filter) so feature branches,
# their pull requests, and dev/main are all checked. Runs directly on the
# self-hosted act_runner; no container: key.
#
# The Makefile is the single build definition: CI runs `make test` and
# `make build` so it fails whenever either target would, and the binary
# carries the Makefile's -trimpath and version-stamped -ldflags.
name: CI
on: [push, pull_request]
@@ -16,45 +20,16 @@ jobs:
go-version-file: go.mod
cache: false
- name: gofmt
run: |
unformatted="$(gofmt -l .)"
if [ -n "$unformatted" ]; then
echo "gofmt needed:"
echo "$unformatted"
exit 1
fi
- name: go vet
run: go vet ./...
- name: go test
run: go test -race ./...
- uses: actions/setup-node@v4
with:
node-version: "22"
- name: npm ci
working-directory: web
run: npm ci
- name: make test
run: make test
- name: npm run typecheck
working-directory: web
run: npm run typecheck
- name: make build
run: make build
- name: npm test
working-directory: web
run: npm test
- name: npm run build
working-directory: web
run: npm run build
# Embed the real PWA, as `make embed` does, then build the static binary.
- name: go build (embedded PWA)
run: |
rm -rf internal/frontend/dist
mkdir -p internal/frontend/dist
cp -R web/dist/. internal/frontend/dist/
CGO_ENABLED=0 go build -o bin/mealquest ./cmd/server
# Shows the build settings, including the -ldflags version stamp.
- name: show binary build info
run: go version -m bin/mealquest