-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
executable file
·44 lines (33 loc) · 1.06 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
.DEFAULT_GOAL := build
GO ?= go
GO_RUN_TOOLS ?= $(GO) run -modfile ./tools/go.mod
GO_TEST = $(GO_RUN_TOOLS) gotest.tools/gotestsum --format pkgname
.PHONY: generate
generate:
go generate ./...
.PHONY: fmt
fmt: ## Run go fmt against code.
go run mvdan.cc/gofumpt -w .
.PHONY: vet
vet: ## Run go vet against code.
go vet ./...
.PHONY: bench
bench: ## Run benchmarks
go test -bench=. ./...
.PHONY: test
test: fmt vet ## Run tests.
mkdir -p .test/reports
$(GO_TEST) --junitfile .test/reports/unit-test.xml -- -race ./... -count=1 -short -cover -coverprofile .test/reports/unit-test-coverage.out
.PHONY: lint
lint: ## Run lint.
$(GO_RUN_TOOLS) github.com/golangci/golangci-lint/cmd/golangci-lint run --timeout 5m -c .golangci.yml
.PHONY: clean
clean: ## Remove previous build.
find . -type f -name '*.gen.go' -exec rm {} +
git checkout go.mod
.PHONY: run-kafka
run-kafka:
@docker run -d --rm -p 2181:2181 -p 9092:9092 --name some-kafka --env ADVERTISED_HOST=127.0.0.1 --env ADVERTISED_PORT=9092 spotify/kafka
.PHONY: stop-kafka
stop-kafka:
@docker stop some-kafka