-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
46 lines (33 loc) · 1.02 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
.PHONY: \
lint \
vet \
fmt \
fmtcheck \
testdeps \
pretest \
gotest \
test \
CI_TOKEN = foo
lint:
@ go get -v github.com/golang/lint/golint
[ -z "$$(golint . | grep -v 'type name will be used as docker.DockerInfo' | grep -v 'context.Context should be the first' | tee /dev/stderr)" ]
vet:
go vet $$(go list ./... | grep -v vendor)
fmt:
gofmt -s -w $$(go list ./... | grep -v vendor)
fmtcheck:
[ -z "$$(gofmt -s -d $$(go list ./... | grep -v vendor) | tee /dev/stderr)" ]
testdeps:
go get -u github.com/golang/dep/cmd/dep
dep ensure -v
pretest: testdeps lint vet fmtcheck
gotest:
go test -race $$(go list ./... | grep -v vendor) -cover
test: pretest gotest
test-short: testdeps gotest
test-ci: pretest
go test -race $$(go list ./... | grep -v vendor) -cover -coverprofile=.coverprofile .
goveralls -coverprofile=.coverprofile -repotoken ${CI_TOKEN} -coverprofile=.profile.cov
test-travis: pretest
sh scripts/coverall.sh
goveralls -coverprofile=.coverprofile -repotoken ${CI_TOKEN} -coverprofile=.profile.cov