-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
27 lines (20 loc) · 776 Bytes
/
Makefile
File metadata and controls
27 lines (20 loc) · 776 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
PACKAGES = $(shell go list ./...)
.DEFAULT_GOAL := help
.PHONY: help lint test
help:
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-10s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
lint: ## Run go vet and golangci-lint.
go vet ./... &&
golangci-lint run ./...
test: ## Run tests.
go test -short -v ./... -race
flake: ## Run test flake.
go test -short -v ./... -race -test.failfast -test.count 10
coverage: $(patsubst %,%.coverage,$(PACKAGES))
@rm -f .gocoverage/cover.txt
gocovmerge .gocoverage/*.out > coverage.txt
go tool cover -html=coverage.txt -o .gocoverage/index.html
go tool cover -func=coverage.txt
%.coverage:
@[ -d .gocoverage ] || mkdir .gocoverage
go test -covermode=count -coverprofile=.gocoverage/$(subst /,-,$*).out $* -v