-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
73 lines (59 loc) · 1.6 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
.PHONY: default
default:
@echo "The following targets are available:"
@echo " deps - installs all necessary application dependencies and development tools"
@echo " test - runs the test suite"
@echo " verboseTest - runs the test suite printing all the output"
@echo " format - reformats the code"
@echo " lint - invokes gometalinter"
@echo " cover - runs the test suite and shows coverage"
@echo " docs - runs godoc server on :6060"
@echo " clean - cleans the build and test cache"
@echo " build - builds executable"
@echo " runs - runs executable"
.PHONY: devDeps
devDeps:
go get -u github.com/alecthomas/gometalinter
go get -u golang.org/x/tools/cmd/cover
go get -u github.com/kardianos/govendor
go get -u github.com/joho/godotenv/cmd/godotenv
.PHONY: deps
deps: devDeps
govendor sync -v
govendor list
.PHONY: test
test:
go test -count 1 -p 1 ./...
.PHONY: verboseTest
verboseTest:
go test -v -count 1 -p 1 ./...
.PHONY: lint
lint:
gometalinter -D gosec vetshadow --cyclo-over=20
.PHONY: cover
cover:
go test -coverprofile /tmp/apidfiff.out
go tool cover -html=/tmp/apidfiff.out
.PHONY: format
format:
govendor fmt +local
.PHONY: docs
docs:
godoc -http=:6060
.PHONY: clean
clean:
go clean -cache
.PHONY: build
build:
go build cmd/apidiff/apidiff.go
.PHONY: run
run:
go run cmd/apidiff/apidiff.go
.PHONY: ciDeps
ciDeps: deps
go get -u github.com/alecthomas/gometalinter
gometalinter --install
go get github.com/jstemmer/go-junit-report
.PHONY: ciTest
ciTest:
go test -p 1 -coverprofile=coverage.txt -covermode=atomic ./...