-
-
Notifications
You must be signed in to change notification settings - Fork 44
/
Makefile
44 lines (33 loc) · 750 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
42
43
44
SHELL := /bin/bash
export GOBIN := $(PWD)/_tools
export PATH := $(GOBIN):$(PATH)
export GO111MODULE := on
.PHONY: generate
generate:
go generate ./...
.PHONY: tools
tools:
@cat tools/tools.go | grep -E '^\s*_\s.*' | awk '{ print $$2 }' | xargs go install
.PHONY: build
build:
go build ./...
.PHONY: test
test: format unit-test credits
.PHONY: format
format:
go mod tidy
.PHONY: credits
credits:
gocredits -skip-missing . > CREDITS
.PHONY: unit-test
unit-test: lint
go test -race ./...
.PHONY: lint
lint:
go vet ./...
.PHONY: coverage
coverage:
DEBUG=true go test -coverpkg ./... -covermode=atomic -coverprofile=coverage.txt -race $(shell go list ./...)
.PHONY: coverage-web
coverage-web: coverage
go tool cover -html=coverage.txt