[MM-44951] Add go mod tidy CircleCI check (#20446)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d317923143
Коммит
bf62ef3fa0
@@ -134,6 +134,19 @@ jobs:
|
|||||||
make app-layers
|
make app-layers
|
||||||
if [[ -n $(git status --porcelain) ]]; then echo "Please update the app layers using make app-layers"; exit 1; fi
|
if [[ -n $(git status --porcelain) ]]; then echo "Please update the app layers using make app-layers"; exit 1; fi
|
||||||
|
|
||||||
|
check-go-mod-tidy:
|
||||||
|
docker:
|
||||||
|
- image: mattermost/mattermost-build-server:20220415_golang-1.18.1
|
||||||
|
working_directory: ~/mattermost
|
||||||
|
steps:
|
||||||
|
- attach_workspace:
|
||||||
|
at: ~/mattermost/
|
||||||
|
- run:
|
||||||
|
command: |
|
||||||
|
cd mattermost-server
|
||||||
|
make modules-tidy
|
||||||
|
if [[ -n $(git status --porcelain) ]]; then echo "Please tidy up the Go modules using make modules-tidy"; exit 1; fi
|
||||||
|
|
||||||
check-store-layers:
|
check-store-layers:
|
||||||
docker:
|
docker:
|
||||||
- image: mattermost/mattermost-build-server:20220415_golang-1.18.1
|
- image: mattermost/mattermost-build-server:20220415_golang-1.18.1
|
||||||
@@ -496,6 +509,9 @@ workflows:
|
|||||||
# - check-i18n:
|
# - check-i18n:
|
||||||
# requires:
|
# requires:
|
||||||
# - setup
|
# - setup
|
||||||
|
- check-go-mod-tidy:
|
||||||
|
requires:
|
||||||
|
- setup
|
||||||
- check-golangci-lint:
|
- check-golangci-lint:
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
@@ -525,6 +541,7 @@ workflows:
|
|||||||
- setup
|
- setup
|
||||||
- build:
|
- build:
|
||||||
requires:
|
requires:
|
||||||
|
- check-go-mod-tidy
|
||||||
- check-app-layers
|
- check-app-layers
|
||||||
- check-store-layers
|
- check-store-layers
|
||||||
- check-mocks
|
- check-mocks
|
||||||
@@ -610,6 +627,9 @@ workflows:
|
|||||||
- master
|
- master
|
||||||
- /^release-.*/
|
- /^release-.*/
|
||||||
- cloud
|
- cloud
|
||||||
|
- check-go-mod-tidy:
|
||||||
|
requires:
|
||||||
|
- setup
|
||||||
- check-app-layers:
|
- check-app-layers:
|
||||||
requires:
|
requires:
|
||||||
- setup
|
- setup
|
||||||
@@ -634,6 +654,7 @@ workflows:
|
|||||||
- sentry:
|
- sentry:
|
||||||
context: matterbuild-sentry
|
context: matterbuild-sentry
|
||||||
requires:
|
requires:
|
||||||
|
- check-go-mod-tidy
|
||||||
- check-app-layers
|
- check-app-layers
|
||||||
- check-store-layers
|
- check-store-layers
|
||||||
- check-mocks
|
- check-mocks
|
||||||
@@ -644,6 +665,7 @@ workflows:
|
|||||||
- build-api-spec
|
- build-api-spec
|
||||||
- build:
|
- build:
|
||||||
requires:
|
requires:
|
||||||
|
- check-go-mod-tidy
|
||||||
- check-app-layers
|
- check-app-layers
|
||||||
- check-store-layers
|
- check-store-layers
|
||||||
- check-mocks
|
- check-mocks
|
||||||
|
|||||||
16
Makefile
16
Makefile
@@ -383,14 +383,30 @@ test-db-migration-v5: start-docker ## Gets diff of upgrade vs new instance schem
|
|||||||
gomodtidy:
|
gomodtidy:
|
||||||
@cp go.mod go.mod.orig
|
@cp go.mod go.mod.orig
|
||||||
@cp go.sum go.sum.orig
|
@cp go.sum go.sum.orig
|
||||||
|
@if [ -f "imports/imports.go" ]; then \
|
||||||
|
mv imports/imports.go imports/imports.go.orig; \
|
||||||
|
fi;
|
||||||
$(GO) mod tidy
|
$(GO) mod tidy
|
||||||
@if [ "$$(diff go.mod go.mod.orig)" != "" -o "$$(diff go.sum go.sum.orig)" != "" ]; then \
|
@if [ "$$(diff go.mod go.mod.orig)" != "" -o "$$(diff go.sum go.sum.orig)" != "" ]; then \
|
||||||
echo "go.mod/go.sum was modified. \ndiff- $$(diff go.mod go.mod.orig) \n$$(diff go.sum go.sum.orig) \nRun \"go mod tidy\"."; \
|
echo "go.mod/go.sum was modified. \ndiff- $$(diff go.mod go.mod.orig) \n$$(diff go.sum go.sum.orig) \nRun \"go mod tidy\"."; \
|
||||||
rm go.*.orig; \
|
rm go.*.orig; \
|
||||||
exit 1; \
|
exit 1; \
|
||||||
fi;
|
fi;
|
||||||
|
@if [ -f "imports/imports.go.orig" ]; then \
|
||||||
|
mv imports/imports.go.orig imports/imports.go; \
|
||||||
|
fi;
|
||||||
@rm go.*.orig;
|
@rm go.*.orig;
|
||||||
|
|
||||||
|
modules-tidy:
|
||||||
|
@if [ -f "imports/imports.go" ]; then \
|
||||||
|
mv imports/imports.go imports/imports.go.orig; \
|
||||||
|
fi;
|
||||||
|
-$(GO) mod tidy
|
||||||
|
@if [ -f "imports/imports.go.orig" ]; then \
|
||||||
|
mv imports/imports.go.orig imports/imports.go; \
|
||||||
|
fi;
|
||||||
|
|
||||||
|
|
||||||
test-server-pre: check-prereqs-enterprise start-docker go-junit-report do-cover-file ## Runs tests.
|
test-server-pre: check-prereqs-enterprise start-docker go-junit-report do-cover-file ## Runs tests.
|
||||||
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
||||||
@echo Running all tests
|
@echo Running all tests
|
||||||
|
|||||||
2
go.sum
2
go.sum
@@ -959,8 +959,6 @@ github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
|||||||
github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||||
github.com/lib/pq v1.10.5 h1:J+gdV2cUmX7ZqL2B0lFcW0m+egaHC2V3lpO8nWxyYiQ=
|
github.com/lib/pq v1.10.5 h1:J+gdV2cUmX7ZqL2B0lFcW0m+egaHC2V3lpO8nWxyYiQ=
|
||||||
github.com/lib/pq v1.10.5/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
github.com/lib/pq v1.10.5/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||||
github.com/lieut-data/squirrel v1.5.4 h1:OGzJNl0/ZxdjLEHuFzDo797zB2V7i8wQXBVThcOzbHE=
|
|
||||||
github.com/lieut-data/squirrel v1.5.4/go.mod h1:NNaOrjSoIDfDA40n7sr2tPNZRfjzjA400rg+riTZj10=
|
|
||||||
github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo=
|
github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo=
|
||||||
github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
|
github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
|
||||||
github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w=
|
github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w=
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user