check if running `go mod vendor` has an effect on vendor directory and if so fail

pull/7270/head
Adrien Delorme 7 years ago
parent aa6d5e1d74
commit 267e2253a2

@ -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

@ -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"

Loading…
Cancel
Save