-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (48 loc) · 1.42 KB
/
Makefile
File metadata and controls
56 lines (48 loc) · 1.42 KB
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
51
52
53
54
55
56
.DEFAULT_GOAL := build
lint:
set +e
# use staticcheck, because golint has been deprecated
staticcheck ./...
set -e
.PHONY:lint
vet:
go vet ./...
shadow ./...
.PHONY:vet
check:
# find vulnerabilities
govulncheck ./...
.PHONY:check
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: proto vet lint
go build -o ./build/api-server .
.PHONY: build
run: proto vet lint
air
.PHONY: run
test: proto vet lint
mkdir -p ./coverage
ENV=testing go test -v -race -count=1 -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 install github.com/air-verse/air@latest
go install golang.org/x/vuln/cmd/govulncheck@latest
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
go get -u
go mod tidy
go install github.com/nikolaydubina/go-cover-treemap@latest
echo "Note: protoc (protobuf compiler) must be installed separately: https://grpc.io/docs/protoc-installation/"
.PHONY: deps