Only run gospace tidy when go.mod or go.sum change (#1214)

This commit is contained in:
Egon Elbre 2019-02-01 20:11:57 +02:00 committed by GitHub
parent 5c2b67db63
commit 5f59c46ed9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -62,7 +62,7 @@ matrix:
- go run ./scripts/check-imports.go ./...
- go run ./scripts/protobuf.go --protoc=$HOME/protoc/bin/protoc lint
- golangci-lint run
- gospace istidy
- ./scripts/check-travis-tidy.sh
### integration tests ###
- env: MODE=integration

12
scripts/check-travis-tidy.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
set -ueo pipefail
CHANGES=$(git diff --name-only $TRAVIS_COMMIT_RANGE -- go.mod go.sum)
if [ -z "$CHANGES" ]
then
echo "go modules not changed"
else
echo "go module changes detected"
gospace tidy
fi