-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (35 loc) · 1.16 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
.PHONY: run lint install-tools test test-race benchmark migrate-up migrate-down-1 generate build
run:
go run cmd/server/main.go start
lint:
$(foreach f,$(shell go fmt ./...),@echo "Forget to format file: ${f}"; exit 1;)
go vet ./...
revive -config revive.toml -formatter friendly ./...
install-tools:
go install github.com/matryer/moq
go install github.com/mgechev/revive
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway
go install google.golang.org/protobuf/cmd/protoc-gen-go
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc
go install github.com/QuangTung97/otelwrap
test:
go test -v -p 1 -count=1 -covermode=count -coverprofile=coverage.out -tags integration ./...
test-race:
go test -v -p 1 -count=1 -race ./...
benchmark:
echo "TODO"
migrate-up:
go run cmd/migrate/main.go up
migrate-down-1:
go run cmd/migrate/main.go down 1
generate:
./generate.sh
build:
go build -o bin/migrate cmd/migrate/main.go
go build -o bin/bench cmd/bench/main.go
mkdir -p bin/build
cp bin/migrate bin/build
cp bin/bench bin/build
cp -r migrations bin/build
cp -n config.yml bin/build/config.yml
cd bin && tar -czvf build.tar.gz build