-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
53 lines (44 loc) · 787 Bytes
/
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
BINARY_OUT ?= ./sockstun
CMD_DIR := ./cmd/sockstun
TEST_COVERAGE_OUT := ./.gocoverage
.PHONY: all
all:
$(MAKE) lint
$(MAKE) test
$(MAKE) build
.PHONY: lint
lint:
@golangci-lint run -v \
./...
.PHONY: test-fast
test-fast:
go test -v \
-shuffle on \
-failfast \
./...
.PHONY: test
test: test-fast
go test -v \
-shuffle on \
-vet=all \
-race \
-cover -covermode=atomic -coverprofile="${TEST_COVERAGE_OUT}" \
./...
.PHONY: test-cover-open
test-cover-open: test
go tool cover \
-html="${TEST_COVERAGE_OUT}"
BUILD_FLAGS ?=
.PHONY: build
build:
go build -v \
-o "${BINARY_OUT}" \
${BUILD_FLAGS} \
"${CMD_DIR}"
DEBUG ?= true
.PHONY: run
run:
DEBUG="${DEBUG}" air -c ./.air.toml
.PHONY: clean
clean:
go clean -r -cache -testcache -modcache -fuzzcache