From 8ec304aaad180cefc35bc74968f628393a6e1013 Mon Sep 17 00:00:00 2001 From: dev_agent Date: Fri, 2 Oct 2026 23:08:29 -0400 Subject: [PATCH] Add Gitea Actions CI workflow Runs gofmt, go vet, go test -race, the web typecheck/test/build and a static build of the binary with the real PWA embedded, on every push and pull request using the self-hosted act_runner. Co-Authored-By: Claude Opus 5.5 --- .gitea/workflows/ci.yml | 60 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .gitea/workflows/ci.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..4862a8a --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,60 @@ +# 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. +name: CI + +on: [push, pull_request] + +jobs: + ci: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + 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: npm run typecheck + working-directory: web + run: npm run typecheck + + - 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