From c3730c8cc657a5dd73c47d8a9c2242a371e7dba6 Mon Sep 17 00:00:00 2001 From: leetcrypt Date: Wed, 15 Jul 2026 11:08:51 -0700 Subject: [PATCH] build: Makefile + gitea CI workflow (M1 tooling) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Makefile targets per ROADMAP M1: build / vet / test / race / cover / check-cover / map / vm-proof. check-cover reports any package below a 70% floor (advisory — not yet a hard gate, since rotate/policy/tui are still below target). .gitea/workflows/ci.yml enforces the non-negotiable green bar on push/PR: build + vet + `go test -race ./...` on Go 1.25, installing bash+openssl for the self-contained test suite. Coverage floors are reported but not enforced until the lagging packages are lifted (ROADMAP M1). Remote is gitea only. Co-Authored-By: Claude Opus 4.6 --- .gitea/workflows/ci.yml | 37 +++++++++++++++++++++++++++ Makefile | 55 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 .gitea/workflows/ci.yml create mode 100644 Makefile diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..04d614e --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,37 @@ +# Gitea Actions CI for incredigo (self-hosted; remote is gitea only). +# Enforces the non-negotiable green bar: build + vet + race-clean tests. The go +# suite is self-contained (fake gopass/psql binaries, httptest emulators) but needs +# bash + openssl on PATH. Per-package coverage FLOORS are reported, not enforced, +# until rotate/policy/tui are lifted to target (see docs/ROADMAP.md M1). +name: ci +on: + push: + pull_request: + +jobs: + build-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install test dependencies (bash + openssl) + run: | + apt-get update -y + apt-get install -y --no-install-recommends bash openssl ca-certificates + + - uses: actions/setup-go@v5 + with: + go-version: '1.25' + check-latest: true + + - name: Build + run: go build ./... && go build -o /tmp/incredigo ./cmd/incredigo + + - name: Vet + run: go vet ./... + + - name: Test (race) + run: go test -race ./... + + - name: Coverage report (advisory — floors not yet enforced) + run: make check-cover || true diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..73a0315 --- /dev/null +++ b/Makefile @@ -0,0 +1,55 @@ +# incredigo — developer tasks. See docs/ROADMAP.md (M1) for the tooling contract. +# +# The go test suite is self-contained (fake gopass/psql binaries, httptest +# emulators, in-process SSH servers); it needs bash + openssl on PATH but no live +# services. LIVE-VM driver proofs are separate and run via `make vm-proof`. + +GO ?= go +BIN ?= /tmp/incredigo +PKG ?= ./... +# Coverage floors are NOT yet enforced in CI: rotate (76%), policy (66%) and tui +# (57%) are still below target (ROADMAP M1). `make cover` reports per-package +# numbers; flip `check-cover` on once those packages are lifted. +COVER_FLOOR ?= 70 + +.PHONY: all build vet test race cover check-cover map vm-proof clean + +all: build vet test + +build: + $(GO) build $(PKG) + $(GO) build -o $(BIN) ./cmd/incredigo + +vet: + $(GO) vet $(PKG) + +test: + $(GO) test $(PKG) + +race: + $(GO) test -race $(PKG) + +# Per-package coverage report (no gate). +cover: + $(GO) test -cover $(PKG) + +# Advisory coverage gate: prints any PACKAGE below COVER_FLOOR. Does not fail the +# build yet (see note above). Wire into CI once safety-critical packages are green. +check-cover: + @$(GO) test -cover $(PKG) | awk -v floor=$(COVER_FLOOR) \ + '/coverage:/ { for (i=1;i<=NF;i++) if ($$i=="coverage:") { c=$$(i+1); gsub("%","",c); \ + if (c+0 < floor) printf " UNDER %d%%: %-34s %s%%\n", floor, $$2, c } }' + +# Regenerate the visual project map (build artifact, gitignored). +map: + @command -v project-map >/dev/null 2>&1 && project-map . || \ + echo "project-map not on PATH — regenerate incredigo-map.html with the /project-map skill" + +# Run a LIVE-VM rotation proof for one driver against the Multipass sandbox. +# Usage: make vm-proof DRIVER=postgres (lab scripts live under lab/, ROADMAP M0). +vm-proof: + @test -n "$(DRIVER)" || { echo "usage: make vm-proof DRIVER="; exit 2; } + @echo "vm-proof for $(DRIVER): see docs/ROTATION-REAL-CRED-RUNBOOK.md and lab/ (ROADMAP M0/M1)" + +clean: + rm -f $(BIN) /tmp/incredigo.cov