-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
45 lines (35 loc) · 1.07 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: deps fbs proto mocks test test-all test-e2e
FLATBUFFER_SRCS := $(shell find . -name *.fbs)
PROTO_SRCS := $(shell find . -name *.proto)
deps:
go install google.golang.org/protobuf/cmd/[email protected]
go install github.com/golangci/golangci-lint/cmd/[email protected]
go install github.com/securego/gosec/v2/cmd/[email protected]
fbs:
@for FBS in $(FLATBUFFER_SRCS); do \
flatc --go --grpc $$FBS; \
done
proto:
@for PROTO in $(PROTO_SRCS); do \
protoc \
--go_out=../../.. \
--plugin protoc-gen-go="${GOBIN}/protoc-gen-go" \
--go-grpc_out=../../.. \
--plugin protoc-gen-go-grpc="${GOBIN}/protoc-gen-go-grpc" \
--go-vtproto_out=../../.. \
--plugin protoc-gen-go-vtproto="${GOBIN}/protoc-gen-go-vtproto" \
--go-vtproto_opt=features=marshal+unmarshal+size \
--go-vtproto_opt=pool=github.com/ab180/lrmr/lrmrpb.PushDataRequest \
$$PROTO; \
done
mocks: deps
@mockery -all -dir pkg/ -output test/mocks -keeptree
test:
go test ./...
lint:
golangci-lint run --enable=lll ./...
vet:
go vet ./...
sec:
gosec ./...
pre-push: test lint vet sec