diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ba75e7b5..58f5d62e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,6 +12,10 @@ jobs: uses: actions/setup-go@v3 with: go-version: ${{ matrix.go-version }} + - name: go mod tidy + run: | + make tidy + git diff --exit-code - name: Checkout code uses: actions/checkout@v3 - name: Lint diff --git a/Makefile b/Makefile index 19e395dc..389e09df 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,13 @@ test: test-local (cd $$p; go test $(RUN_VIA_SUDO) -v .); \ done +.PHONY: tidy +tidy: + set -eu; \ + for p in $(PACKAGES); do \ + (cd $$p; go mod tidy); \ + done + # Test the mount module against the local mountinfo source code instead of the # release specified in its go.mod. This allows catching regressions / breaking # changes in mountinfo.