diff --git a/.circleci/config.yml b/.circleci/config.yml index 17ad2f3f7..c3689910e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,3 +10,16 @@ jobs: steps: - checkout - run: make ci + check-vendor-vs-mod: + docker: + - image: circleci/golang:1.12 + working_directory: /go/src/github.com/hashicorp/packer + steps: + - checkout + - run: make check-vendor-vs-mod +workflows: + version: 2 + build_and_check_vendor_vs_module: + jobs: + - build + - check-vendor-vs-mod \ No newline at end of file diff --git a/Makefile b/Makefile index e84073a73..684df6966 100644 --- a/Makefile +++ b/Makefile @@ -111,6 +111,13 @@ testacc: deps generate ## Run acceptance tests testrace: fmt-check mode-check vet ## Test with race detection enabled @GO111MODULE=off go test -race $(TEST) $(TESTARGS) -timeout=3m -p=8 +check-vendor-vs-mod: + @GO111MODULE=on go mod vendor + @git diff --exit-code --ignore-space-change --ignore-space-at-eol -- vendor ; if [ $$? -eq 1 ]; then \ + echo "ERROR: vendor dir is not on par with go modules definition." && \ + exit 1; \ + fi + updatedeps: @echo "INFO: Packer deps are managed by go modules. See .github/CONTRIBUTING.md"