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
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
LDFLAGS ?=
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
mod-check: check-env
@echo 'running: go mod verify'
@go mod verify && [ "$(shell sha512sum go.mod)" = "`sha512sum go.mod`" ] || ( echo "ERROR: go.mod was modified by 'go mod verify'" && false )
for module in $(GO_MODULES_LIST); do \
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
rm -f scripts/golangci.yml.buildtags.in

2
go.sum
View File

@ -1406,4 +1406,4 @@ sigs.k8s.io/structured-merge-diff/v4 v4.5.0/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=