-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
54 lines (43 loc) · 1021 Bytes
/
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
# Install development tools (golangci-lint, gofumpt)
devtools:
@echo "Installing devtools"
go install github.com/golangci/golangci-lint/cmd/[email protected]
go install mvdan.cc/gofumpt@latest
go install github.com/bufbuild/buf/cmd/[email protected]
# Tests
unit_test:
go test $(shell go list ./... | grep -v /tests)
integration_test:
go test ./tests/integration/*
e2e_test:
go test ./tests/e2e/*
test:
make unit_test
make integration_test
make e2e_test
# Format
fmt:
gofumpt -l -w .
buf format -w
# Linter
linter:
golangci-lint run --build-tags "${BUILD_TAG}" --timeout=20m0s
buf_linter:
buf lint
# Run on development
dev:
# enable gRPC log tools
export GRPC_GO_LOG_VERBOSITY_LEVEL=99
export GRPC_GO_LOG_SEVERITY_LEVEL=info
# run server
go run cmd/server/server.go
# Build for production
build:
export GIN_MODE=release
export ENV=production
go mod tidy
go clean -cache
go build -o ./build/server cmd/server/server.go
gen_protobuf:
rm -rdf ./protobuf/gen
buf generate --path ./protobuf