forked from gojek/heimdall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (27 loc) · 779 Bytes
/
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
.PHONYthub.com/mattn/goveralls: all
all: build test coverage
ALL_PACKAGES=$(shell go list ./... | grep -v "vendor")
setup:
mkdir -p $(GOPATH)/bin
go get -u golang.org/x/lint/golint
go get github.com/mattn/goveralls
compile:
mkdir -p out/
go build -race ./...
build: compile fmt vet lint
fmt:
go fmt ./...
vet:
go vet ./...
lint:
golint -set_exit_status $(ALL_PACKAGES)
test: fmt vet build
ENVIRONMENT=test go test -race ./...
coverage:
ENVIRONMENT=test goveralls -service=travis-ci
test-cover-html:
@echo "mode: count" > coverage-all.out
$(foreach pkg, $(ALL_PACKAGES),\
ENVIRONMENT=test go test -coverprofile=coverage.out -covermode=count $(pkg);\
tail -n +2 coverage.out >> coverage-all.out;)
go tool cover -html=coverage-all.out -o out/coverage.html