-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (59 loc) · 1.95 KB
/
Makefile
File metadata and controls
75 lines (59 loc) · 1.95 KB
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
# Heavily inspired by Lighthouse: https://github.com/sigp/lighthouse/blob/stable/Makefile
# and Reth: https://github.com/paradigmxyz/reth/blob/main/Makefile
.DEFAULT_GOAL := help
VERSION := $(shell git describe --tags --always --dirty="-dev")
##@ Help
.PHONY: help
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
.PHONY: v
v: ## Show the version
@echo "Version: ${VERSION}"
##@ Build
.PHONY: build
build: ## Build the CLI
go build -ldflags "-X main.version=${VERSION}" -o ./builder-playground main.go
@echo "Binary built: ./builder-playground (version: ${VERSION})"
##@ Test & Development
.PHONY: test
test: ## Run tests
go test -v -count=1 ./...
.PHONY: e2e-test
e2e-test:
go build .
E2E_TESTS=true go test -v -count=1 ./e2e/...
.PHONY: generate-docs
generate-docs: ## Auto-generate recipe docs
go run main.go generate-docs
.PHONY: lint
lint: ## Run linters
output=$$(gofmt -d -s .) && [ -z "$$output" ] || { echo "$$output"; exit 1; }
output=$$(gofumpt -d -extra .) && [ -z "$$output" ] || { echo "$$output"; exit 1; }
go vet ./...
staticcheck ./...
# golangci-lint run || true
.PHONY: fmt
fmt: ## Format the code
gofmt -s -w .
gci write .
gofumpt -w -extra .
go mod tidy
.PHONY: gofumpt
gofumpt: ## Run gofumpt
gofumpt -l -w -extra .
.PHONY: lt
lt: lint test ## Run linters and tests
.PHONY: ci-release
ci-release:
docker run \
--rm \
-e CGO_ENABLED=1 \
-e GITHUB_TOKEN="$(GITHUB_TOKEN)" \
-v `pwd`:/workspace \
-w /workspace \
ghcr.io/goreleaser/goreleaser-cross:v1.21.12 \
release --clean --auto-snapshot
.PHONY: pregenerate-bls-keys
pregenerate-bls-keys: ## Pregenerate BLS keys for testing
go run ./tools/pregenerate_bls_keys/main.go > utils/keys/fixtures/bls_keys.json
@echo "BLS keys pregenerated in ./test_data/bls_keys.json"