mirror of
https://github.com/hashicorp/packer.git
synced 2026-05-28 04:35:38 -04:00
check if running go mod vendor has an effect on vendor directory and if so fail
This commit is contained in:
parent
aa6d5e1d74
commit
267e2253a2
2 changed files with 20 additions and 0 deletions
|
|
@ -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
|
||||
7
Makefile
7
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"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue