-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
34 lines (25 loc) · 846 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
### Required tools
GOTOOLS_CHECK = go golangci-lint
all: ensure-deps linter test gofmt
### Testing
test:
go test ./... -covermode=atomic -coverpkg=./... -count=1 -race
test-cover:
go test ./... -covermode=atomic -coverprofile=/tmp/coverage.out -coverpkg=./... -count=1
go tool cover -html=/tmp/coverage.out
test-integration:
go test -tags integration ./... -covermode=atomic -coverpkg=./... -count=1 -race
ensure-deps:
@echo "==> Running go mod tidy"
go mod download
go mod tidy
linter:
@echo "==> Running linter"
golangci-lint run ./...
gofmt:
@echo "==> Running go fmt"
go fmt ./...
# To avoid unintended conflicts with file names, always add to .PHONY
# unless there is a reason not to.
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
.PHONY: all check_tools test test-cover linter ensure-deps gofmt