-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (34 loc) · 956 Bytes
/
Makefile
File metadata and controls
46 lines (34 loc) · 956 Bytes
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
46
.PHONY: all
all: build test
GLIDE_NOVENDOR=$(shell glide novendor)
ALL_PACKAGES=$(shell go list ./... | grep -v "vendor")
setup:
mkdir -p $(GOPATH)/bin
curl https://glide.sh/get | sh
go get -u github.com/Masterminds/glide
go get -u github.com/golang/lint/golint
build-deps:
glide install
update-deps:
glide update
compile:
mkdir -p out/
go build -race $(GLIDE_NOVENDOR)
build: build-deps compile fmt vet lint
fmt:
go fmt $(GLIDE_NOVENDOR)
vet:
go vet $(GLIDE_NOVENDOR)
lint:
@for p in $(GLIDE_NOVENDOR); do \
echo "==> Linting $$p"; \
golint -set_exit_status $$p; \
done
test: build-deps fmt vet build
ENVIRONMENT=test go test -race $(GLIDE_NOVENDOR)
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