-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (43 loc) · 1.33 KB
/
Copy pathMakefile
File metadata and controls
57 lines (43 loc) · 1.33 KB
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
.PHONY: proto build run test test-unit lint tidy fmt compose compose-down bin-deps mock integration all
proto:
protoc --go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
api/proto/shipment/v1/shipment.proto
run:
go run ./cmd/app
test: test-unit
test-unit:
go test -race -cover ./internal/... ./pkg/...
build:
docker compose build
compose:
docker compose up -d mongodb redis zookeeper kafka service
compose-down:
docker compose down --remove-orphans
integration:
@if [ -z "$$BRANCH_NAME" ]; then \
export "BRANCH_NAME=main"; \
fi; \
echo "BRANCH_NAME="$$BRANCH_NAME; \
test_status=0 ;\
docker compose build || { echo "Build failed, aborting."; exit 1; }; \
docker compose run integration || test_status=$$? ;\
docker compose down --remove-orphans ;\
echo "status="$$test_status; exit $$test_status
lint:
golangci-lint run -v
tidy:
go mod tidy
go mod vendor
fmt:
gofumpt -w .
mock:
go generate ./internal/storage/repository/...
go generate ./internal/workers/...
bin-deps:
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.35.2
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.5.1
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2
go install mvdan.cc/gofumpt@v0.7.0
go install go.uber.org/mock/mockgen@v0.5.0
all: fmt tidy lint test