From e88d751039ef530a6b035d4ec7fe32219411cb51 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Tue, 1 Sep 2026 17:45:41 +0800 Subject: [PATCH] =?UTF-8?q?chore=F0=9F=94=A7:=20run=20the=20silent-failure?= =?UTF-8?q?=20checks=20in=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/go.yml | 7 +++++++ Makefile | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 497e0eaf..601080c6 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -38,6 +38,13 @@ jobs: - name: Build run: make build + # Fails the build on the silent-failure classes listed in + # tools/checksilent, one of which is the contract boundary: nothing under + # common/ may import app/. A boundary that is only written down erodes; this + # is what keeps it true. + - name: Silent-failure checks + run: make checksilent + - name: Set up Docker Buildx uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 if: startsWith(github.ref, 'refs/tags/') diff --git a/Makefile b/Makefile index 65b32832..d668f672 100644 --- a/Makefile +++ b/Makefile @@ -45,6 +45,20 @@ stop: test: go test -race -cover ./... +# Reports the failures that do not announce themselves - see +# tools/checksilent. Exits non-zero on an ERROR; the one WARN-level check +# prints and does not fail the build. +# +# Pass UI_DIR to enable the cross-repository menu-name check, which is skipped +# without it: make checksilent UI_DIR=../go-admin-ui/src +.PHONY: checksilent +checksilent: +ifdef UI_DIR + go run ./tools/checksilent -ui-dir $(UI_DIR) +else + go run ./tools/checksilent +endif + #.PHONY: docker #docker: # docker build . -t go-admin:latest