forked from xordataexchange/crypt
-
Notifications
You must be signed in to change notification settings - Fork 27
/
Makefile
59 lines (47 loc) · 1 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
SOURCE_FILES?=./...
TEST_PATTERN?=.
TEST_OPTIONS?=
TEST_TIMEOUT?=15m
TEST_PARALLEL?=2
DOCKER_BUILDKIT?=1
export DOCKER_BUILDKIT
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 backend
gofumpt -w bin/crypt
gofumpt -w config
gofumpt -w encoding
.PHONY: fmt
ci: test
.PHONY: ci
build:
go build -o crypt ./bin/crypt
.PHONY: build
install:
go install ./bin/crypt
deps:
go get -u github.com/bketelsen/crypt/bin/crypt
go mod tidy
go mod verify
.PHONY: deps
todo:
@grep \
--exclude-dir=node_modules \
--exclude-dir=bin \
--exclude=Makefile \
--text \
--color \
-nRo -E ' TODO:.*|SkipNow' .
.PHONY: todo
.DEFAULT_GOAL := build