-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (30 loc) · 727 Bytes
/
Copy pathMakefile
File metadata and controls
39 lines (30 loc) · 727 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
BIN_DIR = $(PWD)/bin
GOIMPORTS_BIN = $(BIN_DIR)/goimports
GOLANGCI_BIN = $(BIN_DIR)/golangci-lint
.PHONY: all
all: tidy fmt lint test
.PHONY: tidy
tidy:
go mod tidy
.PHONY: test
test:
go test -v -race -cover -coverprofile=coverage.out -timeout 10s -cpu 1,2,4,8 ./...
go tool cover -html=coverage.out -o coverage.html
.PHONY: vet
vet:
go vet ./...
.PHONY: fmt
fmt:
go fmt ./...
$(GOIMPORTS_BIN) -w .
.PHONY: lint
lint: vet
$(GOLANGCI_BIN) run -c golangci.yaml ./...
.PHONY: ci
ci: deps lint test
.PHONY: deps
deps:
go mod download
mkdir -p $(BIN_DIR)
GOBIN=$(BIN_DIR) go install golang.org/x/tools/cmd/goimports@v0.26.0
GOBIN=$(BIN_DIR) go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0