diff --git a/.travis.yml b/.travis.yml index bf5298909eb..6d1bec1cc6f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,7 @@ matrix: script: - make BUILDTAGS="${BUILDTAGS}" all - sudo PATH="$PATH" make localintegration RUNC_USE_SYSTEMD=1 + - make vendor-verify allow_failures: - go: tip diff --git a/Makefile b/Makefile index c60f8237154..89a5805e175 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .PHONY: all shell dbuild man release \ localtest localunittest localintegration \ test unittest integration \ - cross localcross + cross localcross vendor vendor-verify GO := go @@ -118,6 +118,17 @@ validate: ci: validate test release +vendor: + export GO111MODULE=on \ + $(GO) mod tidy && \ + $(GO) mod vendor && \ + $(GO) mod verify + +vendor-verify: vendor + @test -z "$$(git status --porcelain -- go.mod go.sum vendor/)" \ + || (echo -e "git status:\n $$(git status -- go.mod go.sum vendor/)\nerror: vendor/, go.mod and/or go.sum not up to date. Run \"make vendor\" to update"; exit 1) \ + && echo "all vendor files are up to date." + cross: runcimage docker run ${DOCKER_RUN_PROXY} -e BUILDTAGS="$(BUILDTAGS)" --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localcross