Makefile.common: add deps target (#5339)

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
This commit is contained in:
Simon Pasquier 2019-03-13 08:58:11 +01:00 committed by GitHub
parent d6f0e14ac6
commit b0be270958
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View file

@ -7,7 +7,12 @@ go:
go_import_path: github.com/prometheus/prometheus
# This ensures that the local cache is filled before running the CI.
# travis_retry retries the command 3 times if it fails as we've experienced
# random issues on Travis.
before_install:
- travis_retry make deps
script:
- GO111MODULE=on travis_retry go mod download
- make check_license style unused test staticcheck check_assets
- git diff --exit-code

View file

@ -116,6 +116,15 @@ common-check_license:
exit 1; \
fi
.PHONY: common-deps
common-deps:
@echo ">> getting dependencies"
ifdef GO111MODULE
GO111MODULE=$(GO111MODULE) $(GO) mod download
else
$(GO) get $(GOOPTS) -t ./...
endif
.PHONY: common-test-short
common-test-short:
@echo ">> running short tests"
@ -221,7 +230,6 @@ precheck::
define PRECHECK_COMMAND_template =
precheck:: $(1)_precheck
PRECHECK_COMMAND_$(1) ?= $(1) $$(strip $$(PRECHECK_OPTIONS_$(1)))
.PHONY: $(1)_precheck
$(1)_precheck: