| 1 | #!/bin/sh |
| 2 | # The build gate from CLAUDE.md — "go build ./..., go vet ./..., go test |
| 3 | # ./... -count=1 — all clean, every package, before any commit lands" — |
| 4 | # as amadan CI runs it. |
| 5 | # |
| 6 | # THIS IS THE GATE. Not a second home for one, not a copy kept beside a |
| 7 | # more authoritative run somewhere else: the definition of green for this |
| 8 | # repo is what these three steps say it is. |
| 9 | # |
| 10 | # It did not start that way, and the change is recent enough to be worth |
| 11 | # writing down. Until 2026-08-24 the authority was |
| 12 | # .github/workflows/ci.yml, and this file said so in as many words — |
| 13 | # where the two disagreed, the workflow won and the difference was a bug |
| 14 | # here. That workflow has been deleted. Two things made it safe to |
| 15 | # delete, and they arrived together: |
| 16 | # |
| 17 | # 1. This directory caught up, and then went past it. `10-gate`, |
| 18 | # `20-cross@5` and `30-minio-contract` cover every job the workflow |
| 19 | # ran — build/vet/test, all five cross-compile targets, the live |
| 20 | # MinIO contract — and the gofmt check here is STRICTER: `make |
| 21 | # test` runs `gofmt -l .` over the whole tree, where the workflow |
| 22 | # only ever checked the files a PR happened to touch. There is no |
| 23 | # direction in which the deleted file was the tighter gate. |
| 24 | # |
| 25 | # 2. It had stopped running anyway. GitHub Actions on the |
| 26 | # carlosframework account has been refusing to start jobs over |
| 27 | # billing, so the "required check" was gating nothing well before |
| 28 | # anyone removed it — which is the worse of the two failure modes, |
| 29 | # because a gate that is merely absent is at least honest about it. |
| 30 | # |
| 31 | # So: a red step here is not a discrepancy to reconcile against a more |
| 32 | # official run. It is the answer, and nothing behind it is going to catch |
| 33 | # what it misses. Keep it true. |
| 34 | # |
| 35 | # One definition, not two. Everything past the build is `make test` — the |
| 36 | # same target a maintainer runs on a laptop — so CI and the local gate |
| 37 | # cannot drift apart, and a check added to one is a check added to both. |
| 38 | # That is how the gofmt check gets here at all: `make test` runs vet, a |
| 39 | # repo-wide `gofmt -l .` and the tests (side by side, through |
| 40 | # .amadan/test-gate.sh), and this file no longer restates any of it. |
| 41 | # |
| 42 | # `go build ./...` stays spelled out because `make test` does not do it. |
| 43 | # |
| 44 | # -count=1 and -timeout 30m live in .amadan/test-gate.sh, on each go test |
| 45 | # line, with the Makefile's note on why; they are still in force here, |
| 46 | # just not written down twice. |
| 47 | set -eu |
| 48 | |
| 49 | # The build runs beside the tests rather than before them: neither needs |
| 50 | # the other, and the gate's wall clock is whichever finishes last. |
| 51 | go build ./... & |
| 52 | build=$! |
| 53 | status=0 |
| 54 | make test || status=$? |
| 55 | wait "$build" || status=1 |
| 56 | exit "$status" |
| 57 | |