-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
84 lines (67 loc) · 3.1 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
.PHONY: proto-format proto-lint proto-breaking proto-gen format lint test-unit build local-image test-e2e
all: proto-all format lint test-unit build local-image test-e2e
###############################################################################
### Build ###
###############################################################################
build:
@echo "🤖 Building simd..."
@cd simapp && make build 1> /dev/null
@echo "✅ Completed build!"
###############################################################################
### Formatting & Linting ###
###############################################################################
gofumpt_cmd=mvdan.cc/gofumpt
golangci_lint_cmd=github.com/golangci/golangci-lint/cmd/golangci-lint
format:
@echo "🤖 Running formatter..."
@go run $(gofumpt_cmd) -l -w .
@echo "✅ Completed formatting!"
lint:
@echo "🤖 Running linter..."
@go run $(golangci_lint_cmd) run --timeout=10m
@echo "✅ Completed linting!"
###############################################################################
### Protobuf ###
###############################################################################
BUF_VERSION=1.42
BUILDER_VERSION=0.15.1
proto-all: proto-format proto-lint proto-breaking proto-gen
proto-format:
@echo "🤖 Running protobuf formatter..."
@docker run --rm --volume "$(PWD)":/workspace --workdir /workspace \
bufbuild/buf:$(BUF_VERSION) format --diff --write
@echo "✅ Completed protobuf formatting!"
proto-gen:
@echo "🤖 Generating code from protobuf..."
@docker run --rm --volume "$(PWD)":/workspace --workdir /workspace \
ghcr.io/cosmos/proto-builder:$(BUILDER_VERSION) sh ./proto/generate.sh
@echo "✅ Completed code generation!"
proto-lint:
@echo "🤖 Running protobuf linter..."
@docker run --rm --volume "$(PWD)":/workspace --workdir /workspace \
bufbuild/buf:$(BUF_VERSION) lint
@echo "✅ Completed protobuf linting!"
proto-breaking:
@echo "🤖 Running protobuf breaking checks..."
@docker run --rm --volume "$(PWD)":/workspace --workdir /workspace \
bufbuild/buf:$(BUF_VERSION) breaking --against "https://github.com/ondoprotocol/usdy-noble.git#branch=v1.0.0"
@echo "✅ Completed protobuf breaking checks!"
###############################################################################
### Testing ###
###############################################################################
local-image:
ifeq (,$(shell which heighliner))
@echo heighliner not found. https://github.com/strangelove-ventures/heighliner
else
@echo "🤖 Building image..."
@heighliner build --chain aura-simd --local 1> /dev/null
@echo "✅ Completed build!"
endif
test-unit:
@echo "🤖 Running unit tests..."
@go test -cover -coverprofile=coverage.out -race -v ./keeper/...
@echo "✅ Completed unit tests!"
test-e2e:
@echo "🤖 Running e2e tests..."
@cd e2e && go test -timeout 15m -race -v ./...
@echo "✅ Completed e2e tests!"