This repository has been archived by the owner on Oct 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
81 lines (66 loc) · 2.53 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
CONTAINER_NAME := mycel_i
DOCKERFILE := ./dockerfile-build
DOCKER_RUN_CMD := docker run --rm -it -v $(shell pwd):/mycel -w /mycel -p 1317:1317 -p 3000:3000 -p 4500:4500 -p 5000:5000 -p 26657:26657 --name mycel $(CONTAINER_NAME)
## Build
docker-build:
docker build -t $(CONTAINER_NAME) -f $(DOCKERFILE) .
docker-run:
$(DOCKER_RUN_CMD)
serve:
$(DOCKER_RUN_CMD) ignite chain serve -r
build:
$(DOCKER_RUN_CMD) ignite chain build
## Docker compose
docker-compose-build:
docker compose build
docker-compose-up:
docker compose up
docker-compose-build-arm:
docker compose -f compose-arm.yml build
docker-compose-up-arm:
docker compose -f compose-arm.yml up
## Test
test-all-module:
go test ./x/.../
test-all-keepers:
go test ./x/.../keeper
test-all-types:
go test ./x/.../types
test-module-%:
go test ./x/$*/.../
## Lint
golangci_lint_cmd=golangci-lint
golangci_version=v1.55.2
lint:
@echo "--> Running linter"
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
@$(golangci_lint_cmd) run --timeout=10m
lint-fix:
@echo "--> Running linter"
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
@$(golangci_lint_cmd) run --fix --out-format=tab --issues-exit-code=0
format:
@go install mvdan.cc/gofumpt@latest
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -path "./tests/mocks/*" -not -name "*.pb.go" -not -name "*.pb.gw.go" -not -name "*.pulsar.go" -not -path "./crypto/keys/secp256k1/*" | xargs gofumpt -w -l
$(golangci_lint_cmd) run --fix
.PHONY: format
###############################################################################
### Protobuf ###
###############################################################################
protoVer=0.14.0
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=docker run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)
#? proto-all: Run make proto-format proto-lint proto-gen
proto-all: proto-format proto-lint proto-gen
#? proto-gen: Generate Protobuf files
proto-gen:
@echo "Generating Protobuf files"
@$(protoImage) sh ./scripts/protocgen.sh
#? proto-format: Format proto file
proto-format:
@$(protoImage) find ./ -name "*.proto" -exec clang-format -i {} \;
#? proto-lint: Lint proto file
proto-lint:
@$(protoImage) buf lint --error-format=json
.PHONY: proto-all proto-gen proto-format proto-lint