diff options
-rw-r--r-- | .travis.yml | 1 | ||||
-rw-r--r-- | Makefile | 21 |
2 files changed, 14 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml index 9de81ec..e108b17 100644 --- a/.travis.yml +++ b/.travis.yml | |||
@@ -7,4 +7,3 @@ go: | |||
7 | 7 | ||
8 | script: | 8 | script: |
9 | - make | 9 | - make |
10 | - ./end-to-end-test.sh | ||
@@ -13,8 +13,10 @@ | |||
13 | 13 | ||
14 | GO ?= GO15VENDOREXPERIMENT=1 go | 14 | GO ?= GO15VENDOREXPERIMENT=1 go |
15 | GOPATH := $(firstword $(subst :, ,$(GOPATH))) | 15 | GOPATH := $(firstword $(subst :, ,$(GOPATH))) |
16 | PROMU ?= $(GOPATH)/bin/promu | 16 | |
17 | pkgs = $(shell $(GO) list ./... | grep -v /vendor/) | 17 | PROMU ?= $(GOPATH)/bin/promu |
18 | STATICCHECK ?= $(GOPATH)/bin/staticcheck | ||
19 | pkgs = $(shell $(GO) list ./... | grep -v /vendor/) | ||
18 | 20 | ||
19 | PREFIX ?= $(shell pwd) | 21 | PREFIX ?= $(shell pwd) |
20 | BIN_DIR ?= $(shell pwd) | 22 | BIN_DIR ?= $(shell pwd) |
@@ -33,7 +35,7 @@ else | |||
33 | test-e2e := skip-test-e2e | 35 | test-e2e := skip-test-e2e |
34 | endif | 36 | endif |
35 | 37 | ||
36 | all: format build test $(test-e2e) | 38 | all: format vet staticcheck build test $(test-e2e) |
37 | 39 | ||
38 | style: | 40 | style: |
39 | @echo ">> checking code style" | 41 | @echo ">> checking code style" |
@@ -58,6 +60,10 @@ vet: | |||
58 | @echo ">> vetting code" | 60 | @echo ">> vetting code" |
59 | @$(GO) vet $(pkgs) | 61 | @$(GO) vet $(pkgs) |
60 | 62 | ||
63 | staticcheck: $(STATICCHECK) | ||
64 | @echo ">> running staticcheck" | ||
65 | @$(STATICCHECK) $(pkgs) | ||
66 | |||
61 | build: $(PROMU) | 67 | build: $(PROMU) |
62 | @echo ">> building binaries" | 68 | @echo ">> building binaries" |
63 | @$(PROMU) build --prefix $(PREFIX) | 69 | @$(PROMU) build --prefix $(PREFIX) |
@@ -71,9 +77,10 @@ docker: | |||
71 | @docker build -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" . | 77 | @docker build -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" . |
72 | 78 | ||
73 | $(GOPATH)/bin/promu promu: | 79 | $(GOPATH)/bin/promu promu: |
74 | @GOOS=$(shell uname -s | tr A-Z a-z) \ | 80 | @GOOS= GOARCH= $(GO) get -u github.com/prometheus/promu |
75 | GOARCH=$(subst x86_64,amd64,$(patsubst i%86,386,$(shell uname -m))) \ | 81 | |
76 | $(GO) get -u github.com/prometheus/promu | 82 | $(GOPATH)/bin/staticcheck: |
83 | @GOOS= GOARCH= $(GO) get -u honnef.co/go/tools/cmd/staticcheck | ||
77 | 84 | ||
78 | 85 | ||
79 | .PHONY: all style format build test test-e2e vet tarball docker promu $(GOPATH)/bin/promu | 86 | .PHONY: all style format build test test-e2e vet tarball docker promu staticcheck $(GOPATH)/bin/promu $(GOPATH)/bin/staticcheck |