-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (50 loc) · 987 Bytes
/
Makefile
File metadata and controls
62 lines (50 loc) · 987 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
.PHONY: clean
clean:
$(call print-target)
rm -rf out
.PHONY: generate
generate:
$(call print-target)
go generate ./...
.PHONY: run
run:
$(call print-target)
go run cmd/example/*
.PHONY: fmt
fmt:
$(call print-target)
go fmt ./...
.PHONY: update
update:
$(call print-target)
go get -u ./...
go mod tidy
.PHONY: build
build:
$(call print-target)
go build -v ./...
.PHONY: test
test:
$(call print-target)
go test -v -race ./...
.PHONY: coverage
coverage:
$(call print-target)
mkdir -p out
go test -v -race -coverprofile=out/coverage.txt -covermode=atomic -coverpkg=./... ./...
go tool cover -html=out/coverage.txt -o out/coverage.html
.PHONY: benchmark
benchmark:
$(call print-target)
go test -bench=. ./...
.PHONY: lint
lint:
$(call print-target)
golangci-lint run --fix ./...
.PHONY: verify
verify: generate build test
$(call print-target)
pre-commit run --all-files
define print-target
@printf "[Make] executing target: \033[36m$@\033[0m\n"
endef