-
Notifications
You must be signed in to change notification settings - Fork 173
/
Makefile
59 lines (48 loc) · 1.71 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
RELEASE_VERSION =v1.0.0-rc-3
GDOC_PORT =8888
GO_COMPAT_VERSION=1.22
.PHONY: all
all: help
.PHONY: tidy
tidy: ## Updates the go modules
go mod tidy -compat=$(GO_COMPAT_VERSION)
.PHONY: test
test:
CGO_ENABLED=1 go test -count=1 \
-race \
-coverprofile=coverage.txt \
-covermode=atomic \
./...
.PHONY: spell
spell: ## Checks spelling across the entire project
@command -v misspell > /dev/null 2>&1 || (cd tools && go get github.com/client9/misspell/cmd/misspell)
@misspell -locale US -error go=golang client/**/* examples/**/* service/**/* actor/**/* .
.PHONY: cover
cover: ## Displays test coverage in the client and service packages
go test -coverprofile=cover-client.out ./client && go tool cover -html=cover-client.out
go test -coverprofile=cover-grpc.out ./service/grpc && go tool cover -html=cover-grpc.out
go test -coverprofile=cover-http.out ./service/http && go tool cover -html=cover-http.out
go test -coverprofile=cover-workflow.out ./workflow && go tool cover -html=cover-workflow.out
.PHONY: lint
lint: check-lint ## Lints the entire project
golangci-lint run --timeout=3m
.PHONY: check-lint
check-lint: ## Compares the locally installed linter with the workflow version
cd ./tools/check-lint-version && \
go mod tidy && \
go run main.go
.PHONY: tag
tag: ## Creates release tag
git tag $(RELEASE_VERSION)
git push origin $(RELEASE_VERSION)
.PHONY: help
help: ## Display available commands
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk \
'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: check-diff
check-diff:
git diff --exit-code ./go.mod # check no changes
git diff --exit-code ./go.sum # check no changes
.PHONY: modtidy
modtidy:
go mod tidy