Merge pull request #1920 from CosmWasm/co/go-mod-tidy-ci

Add go mod tidy check to CI
This commit is contained in:
Christoph Otter
2024-07-03 10:03:59 +02:00
committed by GitHub

View File

@@ -61,6 +61,23 @@ jobs:
paths:
- ".git"
tidy-go:
executor: golang
steps:
- checkout
- run:
name: Check go mod tidy
# Use --diff when available (Go 1.23)
# https://github.com/golang/go/issues/27005
command: |
go mod tidy
CHANGES_IN_REPO=$(git status --porcelain)
if [[ -n "$CHANGES_IN_REPO" ]]; then
echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:"
git status && git --no-pager diff
exit 1
fi
lint:
docker:
- image: golangci/golangci-lint:v1.54.2
@@ -275,6 +292,9 @@ workflows:
tags:
only:
- /^v.*/
- tidy-go:
requires:
- setup-dependencies
- lint:
requires:
- setup-dependencies