ci: check for modified files after go mod checks

Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
Rakshith R 2025-03-14 14:50:14 +05:30 committed by mergify[bot]
parent 7f7988be0d
commit 1fc2e55983
2 changed files with 9 additions and 3 deletions

View File

@ -55,6 +55,9 @@ CEPH_VERSION ?= $(shell . $(CURDIR)/build.env ; echo $${CEPH_VERSION})
# TODO: ceph_preview tag required for FSQuiesce API # TODO: ceph_preview tag required for FSQuiesce API
GO_TAGS_LIST ?= $(CEPH_VERSION) ceph_preview GO_TAGS_LIST ?= $(CEPH_VERSION) ceph_preview
# CephCSI currently has 4 modules in these directories.
GO_MODULES_LIST = ./ e2e/ api/ actions/retest
# go build flags # go build flags
LDFLAGS ?= LDFLAGS ?=
LDFLAGS += -X $(GO_PROJECT)/internal/util.GitCommit=$(GIT_COMMIT) LDFLAGS += -X $(GO_PROJECT)/internal/util.GitCommit=$(GIT_COMMIT)
@ -108,8 +111,11 @@ go-test-api: check-env
@pushd api && ../scripts/test-go.sh && popd @pushd api && ../scripts/test-go.sh && popd
mod-check: check-env mod-check: check-env
@echo 'running: go mod verify' for module in $(GO_MODULES_LIST); do \
@go mod verify && [ "$(shell sha512sum go.mod)" = "`sha512sum go.mod`" ] || ( echo "ERROR: go.mod was modified by 'go mod verify'" && false ) echo "running: go mod checks in $$module"; \
(cd "$$module" && go mod tidy && go mod vendor && go mod verify);\
done
test -z "$(shell git status --short)" || (echo "files were modified during go mod checks: " ; git status --short ; false)
scripts/golangci.yml: scripts/golangci.yml.in scripts/golangci.yml: scripts/golangci.yml.in
rm -f scripts/golangci.yml.buildtags.in rm -f scripts/golangci.yml.buildtags.in