From 54ef3d5a40c5fd468d92cdf66e61690385de1771 Mon Sep 17 00:00:00 2001 From: Alvin Huang Date: Thu, 25 Jul 2019 11:17:07 -0400 Subject: [PATCH] check vendor folder (#6006) * check vendor in circleci * make vendor checking step more descriptive * reorganize check-vendor and gofmt jobs --- .circleci/config.yml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 70b9055abb..33f25493ab 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -60,6 +60,29 @@ jobs: environment: <<: *ENVIRONMENT + # checks vendor directory is correct + check-vendor: + docker: + - image: *GOLANG_IMAGE + environment: + <<: *ENVIRONMENT + steps: + - checkout + - restore_cache: + keys: + - consul-modcache-v1-{{ checksum "go.mod" }} + - run: + command: make update-vendor + - save_cache: + key: consul-modcache-v1-{{ checksum "go.mod" }} + paths: + - /go/pkg/mod + - run: | + if ! git diff --exit-code; then + echo "Git directory has vendor changes" + exit 1 + fi + go-test: docker: - image: *GOLANG_IMAGE @@ -454,11 +477,13 @@ workflows: version: 2 go-tests: jobs: + - check-vendor - lint-consul-retry - - go-fmt-and-vet + - go-fmt-and-vet: + requires: + - check-vendor - dev-build: requires: - - lint-consul-retry - go-fmt-and-vet - go-test: &go-test requires: