Skip to content

Commit f74b0d6

Browse files
committed
Enforce go mod
Signed-off-by: Stefan Büringer [email protected]
1 parent 070467f commit f74b0d6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,20 @@ test: ## Run the test.sh script which will check all.
7676
TRACE=1 ./test.sh
7777

7878
test-all:
79+
$(MAKE) verify-modules
7980
$(MAKE) test
8081

8182
.PHONY: modules
8283
modules: ## Runs go mod to ensure modules are up to date.
8384
go mod tidy
8485

86+
.PHONY: verify-modules
87+
verify-modules: modules ## Verify go modules are up to date
88+
@if !(git diff --quiet HEAD -- go.sum go.mod); then \
89+
git diff; \
90+
echo "go module files are out of date, please run 'make modules'"; exit 1; \
91+
fi
92+
8593
## --------------------------------------
8694
## Cleanup / Verification
8795
## --------------------------------------

0 commit comments

Comments
 (0)