-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
99 lines (70 loc) · 1.7 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
PROTOBUF_DOCKER_IMAGE := custom-protobuf-image
PROTOBUF_DOCKERFILE := docker/protobuf.Dockerfile
# suave-geth
.PHONY: devnet-up devnet-down
devnet-up:
@docker compose --file ./suave-geth.compose.yaml up --detach
.PHONY: devnet-down
devnet-down:
@docker compose --file ./suave-geth.compose.yaml down
# Solidity
build-solidity:
forge build --via-ir
test-solidity:
forge test --ffi --via-ir test/**/*.t.sol
lint-solidity:
solhint 'src/**/*.sol'
fmt-solidity:
forge fmt src/solidit
check-fmt-solidity:
forge fmt --check src/solidity
# Golang
.PHONY: run-go
run-go:
@go run ./src/go/...
build-go:
go build ./src/go
vet-go:
go vet ./src/go
test-go:
go test ./src/go/... ./test/...
lint-go:
golangci-lint run
fmt-go:
go fmt ./src/go/... ./test/...
check-fmt-go:
gofmt -d ./src/go ./test
# Protobuf
.PHONY: run-proto
run-proto:
@docker build -t $(PROTOBUF_DOCKER_IMAGE) -f $(PROTOBUF_DOCKERFILE) .
@docker run --rm -v $(PWD):/workspace \
$(PROTOBUF_DOCKER_IMAGE) \
generate
compile-proto:
@make run-proto
lint-proto:
buf lint
fmt-proto:
buf format src/proto
check-fmt-proto:
buf format -d src/proto
# General
.PHONY: install build test lint fmt check-fmt
install:
forge install
build: build-solidity vet-go compile-proto
test: test-solidity test-go
lint: lint-solidity
fmt: fmt-solidity fmt-go fmt-proto
check-fmt: check-fmt-solidity check-fmt-go check-fmt-proto
# CI
ci: build test lint check-fmt
# Run e2e tests using docker compose
test-e2e-docker:
@echo "----- Running e2e tests on docker compose -----"
@docker compose -f local.compose.yaml up
# Start API Server using Docker
run-api-server-docker:
@echo "----- Starging Astraeus API Server... -----"
@docker compose -f compose.yaml up