forked from cueblox/blox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (50 loc) · 1.09 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
SOURCE_FILES?=./...
TEST_PATTERN?=.
TEST_OPTIONS?=
TEST_TIMEOUT?=15m
TEST_PARALLEL?=2
DOCKER_BUILDKIT?=1
export DOCKER_BUILDKIT
export PATH := ./bin:$(PATH)
export GO111MODULE := on
# Install all the build and lint dependencies
setup:
go mod tidy
git config core.hooksPath .githooks
.PHONY: setup
test:
go test $(TEST_OPTIONS) -p $(TEST_PARALLEL) -v -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt $(SOURCE_FILES) -run $(TEST_PATTERN) -timeout=$(TEST_TIMEOUT)
.PHONY: test
cover: test
go tool cover -html=coverage.txt
.PHONY: cover
fmt:
gofumpt -w .
.PHONY: fmt
lint: check
golangci-lint run
.PHONY: check
ci: lint test
.PHONY: ci
build:
go build -o blox ./cmd/blox/main.go
.PHONY: build
deps:
go get -u
go mod tidy
go mod verify
.PHONY: deps
serve:
@docker run --rm -it -p 8000:8000 -v ${PWD}/dogfood/sites/docs:/docs squidfunk/mkdocs-material
.PHONY: serve
todo:
@grep \
--exclude-dir=vendor \
--exclude-dir=node_modules \
--exclude-dir=bin \
--exclude=Makefile \
--text \
--color \
-nRo -E ' TODO:.*|SkipNow' .
.PHONY: todo
.DEFAULT_GOAL := build