-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (44 loc) · 1.44 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
.DEFAULT_GOAL := help
.PHONY: generate
generate: ## Generate gRPC code
cd handler/proto && buf generate --path wkafka/wkafka.proto
@echo "> Successfully generated gRPC code"
.PHONY: env
env: ## Start env
docker compose -p wkafka -f env/docker-compose.yml up -d
.PHONY: env-up
env-up: ## Start env without detaching
docker compose -p wkafka -f env/docker-compose.yml up
.PHONY: env-logs
env-logs: ## Show env logs
docker compose -p wkafka logs -f
.PHONY: env-down
env-down: ## Stop env
docker compose -p wkafka down
.PHONY: example
example: LOG_LEVEL ?= debug
example: ## Run example
LOG_LEVEL=$(LOG_LEVEL) go run ./example/main.go
.PHONY: ci-run
ci-run: ## Run CI in local with act
act -j sonarcloud
.PHONY: lint
lint: ## Lint Go files
golangci-lint--version
GOPATH="$(shell dirname $(PWD))" golangci-lint run ./...
.PHONY: test
test: ## Run unit tests
@go test -v -race ./...
.PHONY: test-short
test-short: ## Run unit tests short
@go test -v -race -short ./...
.PHONY: test-without-cache
test-without-cache: ## Run unit tests without cache
@go test -count=1 -v -race ./...
.PHONY: coverage
coverage: ## Run unit tests with coverage
@go test -v -race -cover -coverpkg=./... -coverprofile=coverage.out -covermode=atomic ./...
@go tool cover -func=coverage.out
.PHONY: help
help: ## Display this help screen
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'