check for file changes in CI

pull/11050/head
Steven Powell 2021-04-09 17:02:30 -07:00
parent 590d359af6
commit 689763453e
1 changed files with 9 additions and 1 deletions

10
test.sh
View File

@ -17,6 +17,7 @@
set -eu -o pipefail
TESTSUITE="${TESTSUITE:-all}" # if env variable not set run all the tests
CI="${CI:-false}" # if env variable not set don't run CI tests
exitcode=0
if [[ "$TESTSUITE" = "lint" ]] || [[ "$TESTSUITE" = "all" ]] || [[ "$TESTSUITE" = "lintall" ]]
@ -25,7 +26,14 @@ then
make -s lint-ci && echo ok || ((exitcode += 4))
echo "= go mod ================================================================"
go mod download 2>&1 | grep -v "go: finding" || true
go mod tidy -v && git diff --quiet && echo ok || (((exitcode += 2)) && echo ERROR: Please run go mod tidy)
if [[ "$CI" = "true" ]]
then
go mod tidy -v && git diff --quiet go.* && echo ok || (((exitcode += 2)) && echo ERROR: Please run go mod tidy)
echo "= generate docs ========================================================="
make generate-docs > /dev/null 2>&1 && git diff --quiet site && echo ok || (((exitcode += 3)) && echo ERROR: Please run make generate docs)
else
go mod tidy -v && echo ok || ((exitcode += 2))
fi
fi