Make CI script to verify that vendor is in sync
Signed-off-by: Odin Ugedal <odin@ugedal.com>
This commit is contained in:
parent
df583b4c51
commit
a08ab87fe9
15
Makefile
15
Makefile
|
@ -1,7 +1,7 @@
|
|||
.PHONY: all shell dbuild man release \
|
||||
localtest localunittest localintegration \
|
||||
test unittest integration \
|
||||
cross localcross
|
||||
cross localcross vendor verify-dependencies
|
||||
|
||||
CONTAINER_ENGINE := docker
|
||||
GO := go
|
||||
|
@ -112,13 +112,24 @@ clean:
|
|||
rm -rf $(RELEASE_DIR)
|
||||
rm -rf $(MAN_DIR)
|
||||
|
||||
validate:
|
||||
validate: verify-dependencies
|
||||
script/validate-gofmt
|
||||
script/validate-c
|
||||
$(GO) vet $(allpackages)
|
||||
|
||||
ci: validate test release
|
||||
|
||||
vendor:
|
||||
export GO111MODULE=on \
|
||||
$(GO) mod tidy && \
|
||||
$(GO) mod vendor && \
|
||||
$(GO) mod verify
|
||||
|
||||
verify-dependencies: 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
|
||||
$(CONTAINER_ENGINE) run ${CONTAINER_ENGINE_RUN_FLAGS} -e BUILDTAGS="$(BUILDTAGS)" --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localcross
|
||||
|
||||
|
|
Loading…
Reference in New Issue