forked from strangelove-ventures/poa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
79 lines (55 loc) · 1.72 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
#!/usr/bin/make -f
DOCKER := $(shell which docker)
export GO111MODULE = on
####################
### Building ####
####################
include simapp/Makefile
install:
$(MAKE) -C simapp/ install
####################
### Testing ####
####################
include e2e/Makefile
test:
@echo "--> Running tests"
go test -v ./...
ictest-poa:
$(MAKE) -C e2e/ ictest-poa
ictest-jail:
$(MAKE) -C e2e/ ictest-jail
###############################################################################
### Docker ###
###############################################################################
local-image:
docker build . -t poa:local
###################
### Protobuf ####
###################
protoVer=0.13.2
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)
proto-all: proto-format proto-lint proto-gen
proto-gen:
@echo "Generating protobuf files..."
@$(protoImage) sh ./scripts/protocgen.sh
@go mod tidy
proto-format:
@$(protoImage) find ./ -name "*.proto" -exec clang-format -i {} \;
proto-lint:
@$(protoImage) buf lint
.PHONY: proto-all proto-gen proto-format proto-lint
##################
### Linting ####
##################
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 15m
lint-fix:
@echo "--> Running linter and fixing issues"
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
@$(golangci_lint_cmd) run ./... --fix --timeout 15m
.PHONY: lint lint-fix