forked from gnolang/gno
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (37 loc) · 1.52 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
.PHONY: help
help:
@echo "Available make commands:"
@cat Makefile | grep '^[a-z][^:]*:' | cut -d: -f1 | sort | sed 's/^/ /'
rundep=go run -modfile ../misc/devdeps/go.mod
.PHONY: build
_build.tools: _build.aminoscan _build.goscan _build.logjack _build.iaviewer
_build.aminoscan:; go build -o build/aminoscan ./pkg/amino/cmd/aminoscan
_build.goscan:; go build -o build/goscan ./pkg/amino/cmd/goscan
_build.logjack:; go build -o build/logjack ./pkg/autofile/cmd
_build.iaviewer:; go build -o build/iaviewer ./pkg/iavl/cmd/iaviewer
.PHONY: install
install:
# go install ./cmd/...
.PHONY: clean
clean:
rm -rf ./build/
.PHONY: fmt
GOFMT_FLAGS ?= -w
fmt:
$(rundep) mvdan.cc/gofumpt $(GOFMT_FLAGS) .
.PHONY: lint
lint:
$(rundep) github.com/golangci/golangci-lint/cmd/golangci-lint run --config ../.github/golangci.yml ./...
########################################
# Test suite
.PHONY: test
test: _test.pkg.amino _test.pkg.bft _test.pkg.others _test.flappy
_test.flappy:
# flappy tests should work "sometimes" (at least once).
# TODO: support coverage for flappy tests.
TEST_STABILITY=flappy $(rundep) moul.io/testman test -test.v -timeout=20m -retry=10 -run ^TestFlappy \
./pkg/bft/consensus ./pkg/bft/blockchain ./pkg/bft/mempool ./pkg/p2p ./pkg/bft/privval
GOTEST_FLAGS ?= -v -p 1 -timeout=30m
_test.pkg.others:; go test $(GOTEST_FLAGS) `go list ./pkg/... | grep -v pkg/amino/ | grep -v pkg/bft/`
_test.pkg.amino:; go test $(GOTEST_FLAGS) ./pkg/amino/...
_test.pkg.bft:; go test $(GOTEST_FLAGS) ./pkg/bft/...