-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (31 loc) · 888 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
version?=$(shell git rev-list -1 HEAD)
cov=coverage.out
covhtml=coverage.html
buildflags=-ldflags "-X main.Version=${version}"
golangci_lint_version=v1.49.0
coverage_report ?= coverage.txt
all: lint test build
.PHONY: build
build:
go build $(buildflags) -o ./cmd/benchcheck/benchcheck ./cmd/benchcheck
.PHONY: lint
lint:
go run github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_lint_version) run ./...
.PHONY: test
test:
go test -race ./...
.PHONY: test/integration
test/integration:
go test -race -tags integration -count=1 ./...
.PHONY: coverage
coverage:
go test -race -covermode=atomic -coverprofile=$(coverage_report) -tags integration ./...
.PHONY: coverage/show
coverage/show: coverage
go tool cover -html=$(coverage_report)
.PHONY: install
install:
go install $(buildflags) ./cmd/benchcheck
.PHONY: cleanup
cleanup:
rm -f cmd/benchcheck/benchcheck