-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (35 loc) · 777 Bytes
/
Copy pathMakefile
File metadata and controls
41 lines (35 loc) · 777 Bytes
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
GO_IMG ?= golang:1.14
GO_CILINT ?= golangci/golangci-lint:v1.55
SRV ?= gowfnet
PROJECT_DIR ?= $(shell pwd)
COVER_PROFILE ?= cover.out
COVER_HTML_OUT ?= cover.html
GOOS ?= linux
GOARCH ?= amd64
all: lintC testC
.PHONY: all
lint:
@echo "+ $@"
@golangci-lint run ./...
.PHONY: lint
lintC:
@echo "+ $@"
@docker run --rm -i \
-v ${PROJECT_DIR}:/app/${SRV} \
-v ${GOPATH}:/go \
-w /app/${SRV} ${GO_CILINT} make lint
.PHONY: lintC
test:
@echo "+ $@"
@go test -v -coverprofile=${COVER_PROFILE} ./...
@go tool cover -html=${COVER_PROFILE} -o ${COVER_HTML_OUT}
.PHONY: test
testC:
@echo "+ $@"
@docker run --rm -i \
-v ${PROJECT_DIR}:/app/${SRV} \
-v ${GOPATH}:/go \
-e COVER_PROFILE=${COVER_PROFILE} \
-w /app/${SRV} \
${GO_IMG} make test
.PHONY: testC