-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (44 loc) · 1.32 KB
/
Makefile
File metadata and controls
55 lines (44 loc) · 1.32 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
.PHONY: all lint test vet tidy vuln fuzz gen bench
all: test
lint:
@echo "linting..."
@go fmt ./...
vet:
@echo "vetting..."
@go vet ./...
tidy:
@echo "tidying..."
@go mod tidy
vuln:
@echo "checking for vulnerabilities..."
@govulncheck -show verbose ./...
test: tidy lint vet vuln
@echo "testing..."
@go test -v -count=1 -race ./...
@make fuzz
@make bench
fuzz:
@echo "fuzzing..."
@go test -fuzz=FuzzEncryptDecrypt ./crypto -fuzztime=3s
@go test -fuzz=FuzzDecryptMalformed ./crypto -fuzztime=3s
@go test -fuzz=FuzzCorruptionPositions ./crypto -fuzztime=3s
@go test -fuzz=FuzzPEMEncoding ./crypto -fuzztime=3s
@go test -fuzz=FuzzStreamingPatterns ./crypto -fuzztime=3s
@go test -fuzz=FuzzPartialCorruption ./crypto -fuzztime=3s
@go test -fuzz=FuzzDifferentKeyPairs ./crypto -fuzztime=3s
bench:
@echo "benchmarking..."
@go test -run=^$ -bench=. -benchmem -v ./...
gen:
@echo "generating..."
@go generate ./... && go fmt ./...
@make gen-protoc
# Install required protobuf tools
install-proto-tools:
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
gen-protoc:
@cd gravity/proto && \
protoc --go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
gravity_monitor.proto gravity_session.proto