Repository navigation
Add GitHub Actions for tests, coverage, lint and Docker - #4
Merged
Merged
Conversation
GitHub Actions workflows: - Backend: go vet, a CGO-free build, and race tests against a Postgres service seeded from testdata/shop.sql, so the driver tests run too. - Coverage: scripts/coverage.sh fails a PR on any added Go line no test runs, or on a backend total below COVER_MIN (95%). - Frontend: vitest with its coverage thresholds, then the Vite build. - Lint: golangci-lint v2.15.0 and ESLint, warnings included. - Docker: multi-arch images, latest and sha tags on main, semver tags on v*, and a build-only check on pull requests. - Case collisions: scripts/check-case.sh on every PR. Fixes needed for the tree to pass them: - TestRunHTTPS read the certificate without holding the lock, a data race. - Toast ids came from Date.now() + Math.random() and could collide, so dismissing one toast removed another. They now come from a counter. - The Postgres fixture existed only on a dev machine; it is now committed. - Four golangci-lint and five ESLint findings (Toast.vue is ToastStack.vue). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tmphost-dev
force-pushed
the
ci/github-actions
branch
from
October 23, 2026 00:58
efc018e to
d37d3fb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Workflows modelled on tmphost's:
CGO_ENABLED=0build,go test -racewith a Postgres 18 service so the driver tests run, coverage gatevitest.config.js, buildbackend/.golangci.yml), ESLint with--max-warnings 0<DOCKERHUB_USERNAME>/sql-mcp:latest+:<sha>, amd64 + arm64v*tag:<version>+:<major>.<minor>scripts/check-case.shCoverage gate (
scripts/coverage.sh): the backend total, measured with-coverpkgso the app's HTTP tests credit the handlers, may not drop belowCOVER_MIN(95% in CI, which measures 95.8% with the Postgres tests;make coverdefaults to 92.5% because local runs usually skip them). On PRs, every Go line the PR adds must be run by a test, which matches the 100%-of-new-lines target in AGENTS.md.make cover BASE=mainruns the same check locally.Needs: repository secrets
DOCKERHUB_USERNAMEandDOCKERHUB_TOKEN.Fixes needed to go green:
TestRunHTTPSreads.certwithout the lock: a data race under-race, and flaky. It now waits for the cert under the lock.tx.Rollback, an ineffectual assignment, an invisible U+202E in a test literal, a tagged switch).Toast.vuewas renamed toToastStack.vueforvue/multi-word-component-names.shopdatabase that was never committed, so they failed against the README's empty database. The seed is nowbackend/internal/service/dbdriver/testdata/shop.sql, loaded by CI and by the README recipe.Date.now() + Math.random(), which leaves only ~4096 distinct values per millisecond. Two toasts could share an id, so dismissing one removed both, and the useToasts test flaked in CI. Ids now come from a counter..dockerignorekeeps.env,node_modulesand build output out of the build context.Checked locally:
make test,make lint,make cover BASE=main,actionlint,docker build. The Postgres driver tests were also run in a container against the fixture, and every check on this PR passes.🤖 Generated with Claude Code