-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
59 lines (46 loc) · 1.45 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
51
52
53
54
55
56
57
58
59
GO_VERSION:=$(shell go version)
.PHONY: all clean bench bench-all profile lint test contributors update install
all: clean install lint test bench
clean:
go clean ./...
go clean -modcache
rm -rf ./*.log
rm -rf ./*.svg
rm -rf ./go.mod
rm -rf ./go.sum
rm -rf bench
rm -rf pprof
rm -rf vendor
bench: clean init
go test -count=5 -run=NONE -bench . -benchmem
profile: clean
mkdir pprof
mkdir bench
go test -count=10 -run=NONE -bench . -benchmem -o pprof/test.bin -cpuprofile pprof/cpu.out -memprofile pprof/mem.out
go tool pprof --svg pprof/test.bin pprof/mem.out > bench/mem.svg
go tool pprof --svg pprof/test.bin pprof/cpu.out > bench/cpu.svg
init:
GO111MODULE=on go mod init
GO111MODULE=on go mod vendor
sleep 3
deps: clean
GO111MODULE=on go mod init
GO111MODULE=on go mod vendor
rm -rf vendor
lint:
gometalinter --enable-all . | rg -v comment
test: clean init
GO111MODULE=on go test --race -v ./...
contributors:
git log --format='%aN <%aE>' | sort -fu > CONTRIBUTORS
docker-push:
sudo docker build --pull=true --file=Dockerfile -t docker.io/athenz/garm:latest .
sudo docker push docker.io/athenz/garm:latest
coverage:
go test -v -race -covermode=atomic -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
rm -f coverage.out
check-license-header:
# go install github.com/apache/skywalking-eyes/cmd/license-eye@latest
license-eye -c .licenserc.yaml header check
# license-eye -c .licenserc.yaml header fix