-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (56 loc) · 2.02 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
#!/usr/bin/make -f
###############################################################################
### Build ###
###############################################################################
BUILD_DIR ?= $(CURDIR)/build
build:
@go build -o $(BUILD_DIR)/ ./cmd/mmu/
.PHONY: build
build-docker:
@docker build -f contrib/images/mmu.Dockerfile -t mmu .
lint:
@echo "--> Running linter"
@go run github.com/golangci/golangci-lint/cmd/golangci-lint run --out-format=tab
.PHONY: lint
format:
@find . -name '*.go' -type f -not -path "*/mocks/*" | xargs go run mvdan.cc/gofumpt -w .
@find . -name '*.go' -type f | xargs go run golang.org/x/tools/cmd/goimports -w -local github.com/skip-mev/connect-mmu
.PHONY: format
mocks:
@echo "--> generating mocks"
@go install github.com/vektra/mockery/v2
@go generate ./...
@make format
.PHONY: mocks
GOTOOLS=$(shell go list -e -f '{{ join .Imports " "}}' ./tools/tools.go)
tools:
go install ${GOTOOLS}
.PHONY: tools
###############################################################################
### Install ###
###############################################################################
install-sentry:
@go install ./validator/cmd/sentry
.PHONY: install-sentry
install-mmu:
@go install ./cmd/mmu
.PHONY: install-mmu
install: install-mmu install-sentry
.PHONY: install
###############################################################################
### Testing ###
###############################################################################
test:
@go test ./... -race -v
.PHONY: test
test-e2e:
@./scripts/setup_dydx_localnet.sh
cd test && go test -v e2e_test.go
-cd v4-chain/protocol && make localnet-stop
.PHONY: test-e2e
start-localnet-dydx:
@./scripts/setup_dydx_localnet.sh
.PHONY: start-localnet-dydx
stop-localnet-dydx:
@cd v4-chain/protocol && make localnet-stop
.PHONY: stop-localnet-dydx