-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (40 loc) · 1.32 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
.DEFAULT_GOAL := help
.PHONY: env
env: ## Start env
docker compose -p wkafka -f env/docker-compose.yml up -d --remove-orphans
.PHONY: env-up
env-up: ## Start env without detaching
docker compose -p wkafka -f env/docker-compose.yml up --remove-orphans
.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
cd example && LOG_LEVEL=$(LOG_LEVEL) go run ./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}'