-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (42 loc) · 1.1 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
46
47
48
49
50
.DEFAULT_GOAL := build
# you cannot customize fmt to don't use tabs,
# so at the moment I disabled this command
#fmt:
# go fmt ./...
#.PHONY:fmt
lint:
# use staticcheck, because golint has been deprecated
staticcheck ./...
.PHONY:lint
vet:
go vet ./...
shadow ./...
.PHONY:vet
proto:
protoc api/grpc/*/*.proto \
--go_out=. \
--go_opt=paths=source_relative \
--go-grpc_out=. \
--go-grpc_opt=paths=source_relative \
--proto_path=.
.PHONY: proto
build: vet lint proto
go build -o ./build/api-server .
.PHONY: build
run: vet lint proto
air
.PHONY: run
test: lint
mkdir -p ./coverage
ENV=testing go test -v -coverpkg ./... -coverprofile ./coverage/profile.cov ./...
# go tool cover -html ./coverage/profile.cov
go tool cover -html ./coverage/profile.cov -o ./coverage/cover.html
go-cover-treemap -coverprofile ./coverage/profile.cov > ./coverage/out.svg
.PHONY: test
deps:
go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
go install honnef.co/go/tools/cmd/staticcheck@latest
go get -u
go mod tidy
go install github.com/nikolaydubina/go-cover-treemap@latest
.PHONY: deps