Makefile and .amadan/ci.d, following the sibling repos' convention
Copied the shape from sheets-core: each CI step is three lines exec'ing a Makefile target, so CI and `make test` are one definition rather than two lists that can drift apart. Debugging CI is running `make test`. Dropped what doesn't apply to a foundation with no components and no database: test-migrations (no migrations here) and test-race (no concurrency-bearing package — nothing here touches goroutines). Kept test-vet, test-fmt, test-build and test-go, cheapest-and-fastest first, same as sheets-core orders them. test-go covers both gates added so far: internal/lint's prefix tripwire and theme's day-token drift check. `make test` and each .amadan/ci.d/* script run clean.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01APtNStXDZ5H2fAc1ZuGqtS
5 files changed,
+74
−0
.amadan/ci.d/10-vet+8 −0.amadan/ci.d/20-fmt+8 −0.amadan/ci.d/30-build+8 −0.amadan/ci.d/40-go-test+8 −0Makefile+42 −0
Intent
diff --git a/.amadan/ci.d/10-vet b/.amadan/ci.d/10-vet| new file mode 100755 |
| index 0000000..21fe406 |
| --- /dev/null |
| +++ b/.amadan/ci.d/10-vet |
| @@ -0,0 +1,8 @@ |
| +#!/bin/sh |
| +# One step of estilo's CI. It runs a Makefile target rather than its own |
| +# copy of the commands, so CI and the local gate stay ONE definition: |
| +# `make test` runs these same targets in this same order, and |
| +# `make test-vet` is exactly what CI runs here. Debugging CI is running |
| +# it. |
| +set -eu |
| +exec make test-vet |
diff --git a/.amadan/ci.d/20-fmt b/.amadan/ci.d/20-fmt| new file mode 100755 |
| index 0000000..d60da13 |
| --- /dev/null |
| +++ b/.amadan/ci.d/20-fmt |
| @@ -0,0 +1,8 @@ |
| +#!/bin/sh |
| +# One step of estilo's CI. It runs a Makefile target rather than its own |
| +# copy of the commands, so CI and the local gate stay ONE definition: |
| +# `make test` runs these same targets in this same order, and |
| +# `make test-fmt` is exactly what CI runs here. Debugging CI is running |
| +# it. |
| +set -eu |
| +exec make test-fmt |
diff --git a/.amadan/ci.d/30-build b/.amadan/ci.d/30-build| new file mode 100755 |
| index 0000000..fa5f317 |
| --- /dev/null |
| +++ b/.amadan/ci.d/30-build |
| @@ -0,0 +1,8 @@ |
| +#!/bin/sh |
| +# One step of estilo's CI. It runs a Makefile target rather than its own |
| +# copy of the commands, so CI and the local gate stay ONE definition: |
| +# `make test` runs these same targets in this same order, and |
| +# `make test-build` is exactly what CI runs here. Debugging CI is |
| +# running it. |
| +set -eu |
| +exec make test-build |
diff --git a/.amadan/ci.d/40-go-test b/.amadan/ci.d/40-go-test| new file mode 100755 |
| index 0000000..24e8634 |
| --- /dev/null |
| +++ b/.amadan/ci.d/40-go-test |
| @@ -0,0 +1,8 @@ |
| +#!/bin/sh |
| +# One step of estilo's CI. It runs a Makefile target rather than its own |
| +# copy of the commands, so CI and the local gate stay ONE definition: |
| +# `make test` runs these same targets in this same order, and |
| +# `make test-go` is exactly what CI runs here. Debugging CI is running |
| +# it. |
| +set -eu |
| +exec make test-go |
diff --git a/Makefile b/Makefile| new file mode 100644 |
| index 0000000..21b9927 |
| --- /dev/null |
| +++ b/Makefile |
| @@ -0,0 +1,42 @@ |
| +.PHONY: build test test-vet test-fmt test-build test-go |
| + |
| +# CGO_ENABLED=0 for the same reason sheets-core sets it: nothing here |
| +# should grow a cgo dependency by accident. estilo has no cgo-driven |
| +# store of its own; this is a floor, not a workaround. |
| +build: |
| + CGO_ENABLED=0 go build ./... |
| + |
| +# The gate, split into named targets so CI can report them individually |
| +# (.amadan/ci.d calls these one at a time, each its own step). `make |
| +# test` runs exactly the same four things in the same order, so the |
| +# local gate and CI stay ONE definition rather than two lists that |
| +# drift apart. Debugging CI is running `make test`. |
| +# |
| +# Order is cheapest-and-fastest first: vet and gofmt are near-instant, |
| +# build catches compile errors before time is spent on tests, and |
| +# go test — which includes the prefix-rule tripwire (internal/lint) |
| +# and the day-token drift check (theme) — runs last. |
| +test: test-vet test-fmt test-build test-go |
| + |
| +test-vet: |
| + CGO_ENABLED=0 go vet ./... |
| + |
| +# Fails on unformatted files rather than rewriting them. CI must never |
| +# silently "fix" a diff out from under a branch — a red test-fmt tells |
| +# the author to run `gofmt -w` themselves. |
| +test-fmt: |
| + @if [ -n "$$(gofmt -l .)" ]; then \ |
| + echo "gofmt needs to be run on:"; \ |
| + gofmt -l .; \ |
| + exit 1; \ |
| + fi |
| + |
| +test-build: |
| + CGO_ENABLED=0 go build ./... |
| + |
| +# Includes internal/lint's prefix-rule tripwire (AGENTS.md's |
| +# estilo-*/rst- split) and theme's day-token drift check (AGENTS.md's |
| +# two-pin case). -count=1 so a cached "ok" can never stand in for |
| +# actually having run. |
| +test-go: |
| + CGO_ENABLED=0 go test -count=1 ./... |