1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Add script to check for uncommitted vendor changes in build

This commit is contained in:
Indradhanush Gupta 2019-10-20 16:34:52 +05:30
parent 9a1b350f4e
commit d399073695
2 changed files with 15 additions and 1 deletions

View File

@ -11,4 +11,4 @@ before_install:
- cd $HOME/gopath/src/github.com/wtfutil/wtf
- export GOPROXY="https://gocenter.io" && export GO111MODULE=on
script: go get ./... && go test -v github.com/wtfutil/wtf/...
script: go get ./... && ./scripts/check-uncommitted-vendor-files.sh && go test -v github.com/wtfutil/wtf/...

View File

@ -0,0 +1,14 @@
#!/bin/bash
set -euo pipefail
GOPROXY="https://gocenter.io" GOSUMDB=off GO111MODULE=on go mod tidy
untracked_files=$(git ls-files --others --exclude-standard | wc -l)
diff_stat=$(git diff --shortstat)
if [[ "${untracked_files}" -ne 0 || -n "${diff_stat}" ]]; then
echo 'Untracked or diff in tracked vendor files found. Please run "go mod tidy" and commit the changes'
exit 1
fi