build: unify the gate so root make check covers the backend (closes #16)
check / check (push) Successful in 11s
check / check (push) Successful in 11s
Root make check, and with it the pre-commit hook, now gates the Go backend too. The backend's Makefile targets are shims over backend/script/*; script/cibuild builds both images and is the workflow's only build step. Root make test runs both halves within one 30-second timeout. Root make lint runs golangci-lint only in Docker, by building the lint stage of Dockerfile.backend without the cache; the .golangci.yml drift check moved into backend/script/lint. script/bootstrap installs no linter: it reuses a Go at least as new as backend/go.mod asks for, otherwise installs the pinned, hash-verified release, linked into ~/.local/bin without replacing anything it did not create. With VERSION unset or empty, the backend version falls back to git describe inside a git checkout, then to dev. Model: opus-5-5
This commit was merged in pull request #38.
This commit is contained in:
@@ -31,25 +31,41 @@ docker run -p 8080:8080 netwatch
|
||||
This repository adheres to the
|
||||
[Scripts to Rule Them All](https://github.com/github/scripts-to-rule-them-all)
|
||||
standard: normalized scripts in `script/` are the entrypoints for the
|
||||
development workflow, and the Makefile targets are thin shims that call them. We
|
||||
provide:
|
||||
development workflow, and the Makefile targets are thin shims that call them.
|
||||
The Go backend in `backend/` has its own `script/` directory and shim Makefile
|
||||
(see [backend/README.md](backend/README.md)). The root scripts cover both
|
||||
halves, so the root `make check` fails if either one is broken. We provide:
|
||||
|
||||
- `script/bootstrap` — install all dependencies (pinned node via nvm if needed,
|
||||
yarn via corepack, `yarn install --frozen-lockfile`)
|
||||
yarn via corepack, `yarn install --frozen-lockfile`, the pinned Go unless one
|
||||
at least as new as `backend/go.mod` asks for is installed, and the Go
|
||||
modules), linking what it installs itself into `~/.local/bin`, which has to be
|
||||
on `PATH`. It installs no Go linter and not Docker: `make lint` runs the
|
||||
linter in Docker
|
||||
- `script/setup` — make a fresh clone ready for development: bootstrap plus the
|
||||
git pre-commit hook
|
||||
- `script/projectname` — print the project name (used for the Docker image tag)
|
||||
- `script/test` — run the production build as the test (no unit tests yet)
|
||||
- `script/lint` — run prettier in check mode
|
||||
- `script/fmt` — format all files (writes)
|
||||
- `script/fmt-check` — check formatting (read-only)
|
||||
- `script/projectname` — print the project name (used for the Docker image tags)
|
||||
- `script/test` — run `script/frontend-test`, then the backend's Go tests, both
|
||||
within one 30-second timeout
|
||||
- `script/lint` — run `script/frontend-lint`, then golangci-lint in Docker, by
|
||||
building the lint stage of `Dockerfile.backend` without the cache
|
||||
- `script/fmt` — format all files (writes): prettier, then gofmt over `backend/`
|
||||
- `script/fmt-check` — check formatting (read-only): prettier, then gofmt
|
||||
- `script/check` — run test, lint, and fmt-check
|
||||
- `script/frontend-test` — run the production build as the frontend's test (no
|
||||
unit tests yet)
|
||||
- `script/frontend-lint` — run prettier in check mode
|
||||
- `script/frontend-fmt` — format everything prettier understands (writes)
|
||||
- `script/frontend-fmt-check` — check prettier formatting (read-only)
|
||||
- `script/frontend-check` — the frontend half of `script/check`, for
|
||||
`Dockerfile`, whose node build stage has neither Go nor Docker
|
||||
- `script/frontend-viewport-test` — responsive-layout verification of the built
|
||||
frontend in a containerised headless Chrome (see
|
||||
[test/viewport/README.md](test/viewport/README.md)). Not part of
|
||||
`script/check`: it needs Docker and takes minutes.
|
||||
- `script/docker` — build the Docker image tagged via `script/projectname`
|
||||
- `script/cibuild` — CI entrypoint: plain `docker build .`
|
||||
- `script/docker` — build both images, tagged via `script/projectname`:
|
||||
`netwatch` from `Dockerfile` and `netwatch-server` from `Dockerfile.backend`
|
||||
- `script/cibuild` — CI entrypoint: builds both images
|
||||
- `script/precommit` — run by the git pre-commit hook; runs `script/check`
|
||||
- `script/install-precommit` — install the git pre-commit hook
|
||||
|
||||
|
||||
Reference in New Issue
Block a user