diff --git a/.github/workflows/identity-build.yml b/.github/workflows/identity-build.yml index 4cd8a20600..5337864a27 100644 --- a/.github/workflows/identity-build.yml +++ b/.github/workflows/identity-build.yml @@ -46,6 +46,23 @@ jobs: go-version-file: pkgs/identity/go.mod cache-dependency-path: pkgs/identity/go.sum + - name: Verify go.mod and go.sum are tidy + working-directory: pkgs/identity + # Same gap as pkgs/map (#349): build/vet pass on an untidy + # module, so drift would be silent. Tidy is build-tag agnostic, + # so this one step covers both matrix tag variants. + # Pattern copied from go-modules-build.yml: these modules pin + # Go 1.21/1.22, whose `go mod tidy` has no -diff flag (added in + # Go 1.24; mcpx.yml can use it only because mcpx pins Go 1.27), + # so run tidy and fail if it changed anything. + run: | + go mod tidy + if [[ -n "$(git status --short -- go.mod go.sum)" ]]; then + echo "go mod tidy changed go.mod or go.sum; commit the tidy changes." + git diff -- go.mod go.sum + exit 1 + fi + - name: Build working-directory: pkgs/identity run: go build -tags ${{ matrix.tags }} ./... diff --git a/.github/workflows/map-build.yml b/.github/workflows/map-build.yml index c532d27724..290a2a62c1 100644 --- a/.github/workflows/map-build.yml +++ b/.github/workflows/map-build.yml @@ -42,6 +42,24 @@ jobs: go-version-file: pkgs/map/go.mod cache-dependency-path: pkgs/map/go.sum + - name: Verify go.mod and go.sum are tidy + working-directory: pkgs/map + # Every sibling module already has this guard (go-modules-build + # for #347, mcpx.yml for nix#436, mod-tidy.yml for graph); map and + # identity were the last two without one, and build/vet pass on + # an untidy module, so drift here would be silent (#349). + # Pattern copied from go-modules-build.yml: these modules pin + # Go 1.21/1.22, whose `go mod tidy` has no -diff flag (added in + # Go 1.24; mcpx.yml can use it only because mcpx pins Go 1.27), + # so run tidy and fail if it changed anything. + run: | + go mod tidy + if [[ -n "$(git status --short -- go.mod go.sum)" ]]; then + echo "go mod tidy changed go.mod or go.sum; commit the tidy changes." + git diff -- go.mod go.sum + exit 1 + fi + - name: Build working-directory: pkgs/map run: go build ./...