diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2019-09-20 10:43:14 +0200 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2019-09-20 10:47:24 +0200 |
commit | e2cc41f44e545427eda5c916b089f69ae99e80a9 (patch) | |
tree | 049b443dee5e17e0926340c2f14762de69fb5f38 | |
parent | 6e10770797c486ba1068d5a6580c7752714905c8 (diff) |
add vendor checks to Makefile and the CI
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
-rw-r--r-- | .cirrus.yml | 2 | ||||
-rw-r--r-- | Makefile | 9 | ||||
-rwxr-xr-x | hack/tree_status.sh | 15 |
3 files changed, 25 insertions, 1 deletions
diff --git a/.cirrus.yml b/.cirrus.yml index d5498eb..fcca28b 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -61,6 +61,8 @@ validate_task: validate_script: - make validate + - make vendor + - ./hack/tree_status.sh - make test_task: @@ -76,9 +76,16 @@ clean: test: .install.ginkgo $(GO) test -v ./... +vendor: + export GO111MODULE=on \ + $(GO) mod tidy && \ + $(GO) mod vendor && \ + $(GO) mod verify + .PHONY: \ binaries \ test \ gofmt \ lint \ - validate + validate \ + vendor diff --git a/hack/tree_status.sh b/hack/tree_status.sh new file mode 100755 index 0000000..ac874a3 --- /dev/null +++ b/hack/tree_status.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -e + +SUGGESTION="${SUGGESTION:-sync the vendor.conf and commit all changes.}" + +STATUS=$(git status --porcelain) +if [[ -z $STATUS ]] +then + echo "tree is clean" +else + echo "tree is dirty, please $SUGGESTION" + echo "" + echo "$STATUS" + exit 1 +fi |