Skip to content

Commit 149b405

Browse files
tac0turtleclaude
andcommitted
build: add recipe groupings to justfile
Groups: build, test, proto, lint, codegen, run, tools. Uses --unsorted to preserve logical ordering within groups. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8b907f6 commit 149b405

File tree

1 file changed

+60
-13
lines changed

1 file changed

+60
-13
lines changed

justfile

Lines changed: 60 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ tool_ldflags := "-X main.Version=" + version + " -X main.GitSHA=" + gitsha
1212
build_dir := justfile_directory() / "build"
1313

1414
# List available recipes when running `just` with no args
15+
[group('help')]
1516
default:
16-
@just --list
17+
@just --list --unsorted
1718

1819
# ─── Build ────────────────────────────────────────────────────────────────────
1920

2021
# Build Testapp CLI
22+
[group('build')]
2123
build:
2224
@echo "--> Building Testapp CLI"
2325
@mkdir -p {{ build_dir }}
@@ -27,6 +29,7 @@ build:
2729
@echo " Check the binary with: {{ build_dir }}/testapp"
2830

2931
# Install Testapp CLI to Go bin directory
32+
[group('build')]
3033
install:
3134
@echo "--> Installing Testapp CLI"
3235
@cd apps/testapp && go install -ldflags "{{ ldflags }}" .
@@ -35,6 +38,7 @@ install:
3538
@echo " Check the binary with: which testapp"
3639

3740
# Build all ev-node binaries
41+
[group('build')]
3842
build-all:
3943
@echo "--> Building all ev-node binaries"
4044
@mkdir -p {{ build_dir }}
@@ -47,27 +51,31 @@ build-all:
4751
@echo "--> All ev-node binaries built!"
4852

4953
# Build Testapp Bench
54+
[group('build')]
5055
build-testapp-bench:
5156
@echo "--> Building Testapp Bench"
5257
@mkdir -p {{ build_dir }}
5358
@cd apps/testapp && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/testapp-bench ./kv/bench
5459
@echo " Check the binary with: {{ build_dir }}/testapp-bench"
5560

5661
# Build EVM binary
62+
[group('build')]
5763
build-evm:
5864
@echo "--> Building EVM"
5965
@mkdir -p {{ build_dir }}
6066
@cd apps/evm && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/evm .
6167
@echo " Check the binary with: {{ build_dir }}/evm"
6268

6369
# Build local-da binary
70+
[group('build')]
6471
build-da:
6572
@echo "--> Building local-da"
6673
@mkdir -p {{ build_dir }}
6774
@cd tools/local-da && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/local-da .
6875
@echo " Check the binary with: {{ build_dir }}/local-da"
6976

7077
# Build Docker image for local testing
78+
[group('build')]
7179
docker-build:
7280
@echo "--> Building Docker image for local testing"
7381
@docker build -t evstack:local-dev -f apps/testapp/Dockerfile .
@@ -76,6 +84,7 @@ docker-build:
7684
@docker images evstack:local-dev
7785

7886
# Clean build artifacts
87+
[group('build')]
7988
clean:
8089
@echo "--> Cleaning build directory"
8190
@rm -rf {{ build_dir }}
@@ -84,50 +93,60 @@ clean:
8493
# ─── Testing ──────────────────────────────────────────────────────────────────
8594

8695
# Clear test cache
96+
[group('test')]
8797
clean-testcache:
8898
@echo "--> Clearing testcache"
8999
@go clean --testcache
90100

91101
# Run unit tests for all go.mods
102+
[group('test')]
92103
test:
93104
@echo "--> Running unit tests"
94105
@go run -tags='run integration' scripts/test.go
95106

96107
# Run all tests including Docker E2E
108+
[group('test')]
97109
test-all: test test-docker-e2e
98110
@echo "--> All tests completed"
99111

100112
# Run integration tests
113+
[group('test')]
101114
test-integration:
102115
@echo "--> Running integration tests"
103116
@cd node && go test -mod=readonly -failfast -timeout=15m -tags='integration' ./...
104117

105118
# Run e2e tests
119+
[group('test')]
106120
test-e2e: build build-da build-evm docker-build-if-local
107121
@echo "--> Running e2e tests"
108122
@cd test/e2e && go test -mod=readonly -failfast -timeout=15m -tags='e2e evm' ./... --binary=../../build/testapp --evm-binary=../../build/evm
109123

110124
# Run integration tests with coverage
125+
[group('test')]
111126
test-integration-cover:
112127
@echo "--> Running integration tests with coverage"
113128
@cd node && go test -mod=readonly -failfast -timeout=15m -tags='integration' -coverprofile=coverage.txt -covermode=atomic ./...
114129

115130
# Generate code coverage report
131+
[group('test')]
116132
test-cover:
117133
@echo "--> Running unit tests"
118134
@go run -tags=cover -race scripts/test_cover.go
119135

120136
# Run micro-benchmarks for internal cache
137+
[group('test')]
121138
bench:
122139
@echo "--> Running internal cache benchmarks"
123140
@go test -bench=. -benchmem -run='^$' ./block/internal/cache
124141

125142
# Run EVM tests
143+
[group('test')]
126144
test-evm:
127145
@echo "--> Running EVM tests"
128146
@cd execution/evm/test && go test -mod=readonly -failfast -timeout=15m ./... -tags=evm
129147

130148
# Run Docker E2E tests
149+
[group('test')]
131150
test-docker-e2e: docker-build-if-local
132151
@echo "--> Running Docker E2E tests"
133152
@echo "--> Verifying Docker image exists locally..."
@@ -139,16 +158,19 @@ test-docker-e2e: docker-build-if-local
139158
@just docker-cleanup-if-local
140159

141160
# Run Docker E2E Upgrade tests
161+
[group('test')]
142162
test-docker-upgrade-e2e:
143163
@echo "--> Running Docker Upgrade E2E tests"
144164
@cd test/docker-e2e && go test -mod=readonly -failfast -v -tags='docker_e2e evm' -timeout=30m -run '^TestEVMSingleUpgradeSuite$$/^TestEVMSingleUpgrade$$' ./...
145165

146166
# Run Docker E2E cross-version compatibility tests
167+
[group('test')]
147168
test-docker-compat:
148169
@echo "--> Running Docker Sync Compatibility E2E tests"
149170
@cd test/docker-e2e && go test -mod=readonly -failfast -v -tags='docker_e2e evm' -timeout=30m -run '^TestEVMCompatSuite$$/^TestCrossVersionSync$$' ./...
150171

151172
# Build Docker image if using local repository
173+
[group('test')]
152174
docker-build-if-local:
153175
@if [ -z "${EV_NODE_IMAGE_REPO:-}" ] || [ "${EV_NODE_IMAGE_REPO:-}" = "evstack" ]; then \
154176
if docker image inspect evstack:local-dev >/dev/null 2>&1; then \
@@ -162,6 +184,7 @@ docker-build-if-local:
162184
fi
163185

164186
# Clean up local Docker image if using local repository
187+
[group('test')]
165188
docker-cleanup-if-local:
166189
@if [ -z "${EV_NODE_IMAGE_REPO:-}" ] || [ "${EV_NODE_IMAGE_REPO:-}" = "evstack" ]; then \
167190
echo "--> Untagging local Docker image (preserving layers for faster rebuilds)..."; \
@@ -173,22 +196,26 @@ docker-cleanup-if-local:
173196
# ─── Protobuf ─────────────────────────────────────────────────────────────────
174197

175198
# Generate protobuf files
199+
[group('proto')]
176200
proto-gen:
177201
@echo "--> Generating Protobuf files"
178202
buf generate --path="./proto/evnode" --template="buf.gen.yaml" --config="buf.yaml"
179203
buf generate --path="./proto/execution/evm" --template="buf.gen.evm.yaml" --config="buf.yaml"
180204

181205
# Lint protobuf files (requires Docker)
206+
[group('proto')]
182207
proto-lint:
183208
@echo "--> Linting Protobuf files"
184209
@docker run --rm -v {{ justfile_directory() }}:/workspace --workdir /workspace bufbuild/buf:latest lint --error-format=json
185210

186211
# Generate Rust protobuf files
212+
[group('proto')]
187213
rust-proto-gen:
188214
@echo "--> Generating Rust protobuf files"
189215
@cd client/crates/types && EV_TYPES_FORCE_PROTO_GEN=1 cargo build
190216

191217
# Check if Rust protobuf files are up to date
218+
[group('proto')]
192219
rust-proto-check:
193220
@echo "--> Checking Rust protobuf files"
194221
@rm -rf client/crates/types/src/proto/*.rs
@@ -199,20 +226,10 @@ rust-proto-check:
199226
exit 1; \
200227
fi
201228

202-
# ─── Utilities ─────────────────────────────────────────────────────────────────
203-
204-
# Install dependencies and tidy all modules
205-
deps:
206-
@echo "--> Installing dependencies"
207-
@go mod download
208-
@go mod tidy
209-
@go run scripts/tidy.go
210-
211-
# Tidy all go.mod files
212-
tidy-all:
213-
@go run -tags=tidy scripts/tidy.go
229+
# ─── Lint ──────────────────────────────────────────────────────────────────────
214230

215231
# Run all linters
232+
[group('lint')]
216233
lint: vet
217234
@echo "--> Running golangci-lint"
218235
@golangci-lint run
@@ -228,89 +245,119 @@ lint: vet
228245
@actionlint
229246

230247
# Auto-fix linting issues
248+
[group('lint')]
231249
lint-fix:
232250
@echo "--> Formatting go"
233251
@golangci-lint run --fix
234252
@echo "--> Formatting markdownlint"
235253
@markdownlint --config .markdownlint.yaml --ignore './changelog.md' '**/*.md' -f
236254

237255
# Run go vet
256+
[group('lint')]
238257
vet:
239258
@echo "--> Running go vet"
240259
@go vet ./...
241260

261+
# ─── Codegen ──────────────────────────────────────────────────────────────────
262+
242263
# Generate mocks
264+
[group('codegen')]
243265
mock-gen:
244266
@echo "-> Generating mocks"
245267
go run github.com/vektra/mockery/v3@latest
246268

269+
# Install dependencies and tidy all modules
270+
[group('codegen')]
271+
deps:
272+
@echo "--> Installing dependencies"
273+
@go mod download
274+
@go mod tidy
275+
@go run scripts/tidy.go
276+
277+
# Tidy all go.mod files
278+
[group('codegen')]
279+
tidy-all:
280+
@go run -tags=tidy scripts/tidy.go
281+
247282
# ─── Run ──────────────────────────────────────────────────────────────────────
248283

249284
# Run 'n' nodes (default: 1). Usage: just run-n 3
285+
[group('run')]
250286
run-n nodes="1": build build-da
251287
@go run -tags=run scripts/run.go --nodes={{ nodes }}
252288

253289
# Run EVM nodes (one sequencer and one full node)
290+
[group('run')]
254291
run-evm-nodes nodes="1": build-da build-evm
255292
@echo "Starting EVM nodes..."
256293
@go run -tags=run_evm scripts/run-evm-nodes.go --nodes={{ nodes }}
257294

258295
# ─── Tools ─────────────────────────────────────────────────────────────────────
259296

260297
# Build da-debug tool
298+
[group('tools')]
261299
build-tool-da-debug:
262300
@echo "--> Building da-debug tool"
263301
@mkdir -p {{ build_dir }}
264302
@cd tools/da-debug && go build -ldflags "{{ tool_ldflags }}" -o {{ build_dir }}/da-debug .
265303
@echo "--> da-debug built: {{ build_dir }}/da-debug"
266304

267305
# Build blob-decoder tool
306+
[group('tools')]
268307
build-tool-blob-decoder:
269308
@echo "--> Building blob-decoder tool"
270309
@mkdir -p {{ build_dir }}
271310
@cd tools/blob-decoder && go build -ldflags "{{ tool_ldflags }}" -o {{ build_dir }}/blob-decoder .
272311
@echo "--> blob-decoder built: {{ build_dir }}/blob-decoder"
273312

274313
# Build cache-analyzer tool
314+
[group('tools')]
275315
build-tool-cache-analyzer:
276316
@echo "--> Building cache-analyzer tool"
277317
@mkdir -p {{ build_dir }}
278318
@cd tools/cache-analyzer && go build -ldflags "{{ tool_ldflags }}" -o {{ build_dir }}/cache-analyzer .
279319
@echo "--> cache-analyzer built: {{ build_dir }}/cache-analyzer"
280320

281321
# Build all tools
322+
[group('tools')]
282323
build-tools: build-tool-da-debug build-tool-blob-decoder build-tool-cache-analyzer
283324
@echo "--> All tools built successfully!"
284325

285326
# Install da-debug tool to Go bin
327+
[group('tools')]
286328
install-tool-da-debug:
287329
@echo "--> Installing da-debug tool"
288330
@cd tools/da-debug && go install -ldflags "{{ tool_ldflags }}" .
289331
@echo "--> da-debug installed to Go bin"
290332

291333
# Install blob-decoder tool to Go bin
334+
[group('tools')]
292335
install-tool-blob-decoder:
293336
@echo "--> Installing blob-decoder tool"
294337
@cd tools/blob-decoder && go install -ldflags "{{ tool_ldflags }}" .
295338
@echo "--> blob-decoder installed to Go bin"
296339

297340
# Install cache-analyzer tool to Go bin
341+
[group('tools')]
298342
install-tool-cache-analyzer:
299343
@echo "--> Installing cache-analyzer tool"
300344
@cd tools/cache-analyzer && go install -ldflags "{{ tool_ldflags }}" .
301345
@echo "--> cache-analyzer installed to Go bin"
302346

303347
# Install all tools to Go bin
348+
[group('tools')]
304349
install-tools: install-tool-da-debug install-tool-blob-decoder install-tool-cache-analyzer
305350
@echo "--> All tools installed successfully!"
306351

307352
# Remove built tool binaries
353+
[group('tools')]
308354
clean-tools:
309355
@echo "--> Cleaning built tools"
310356
@rm -f {{ build_dir }}/da-debug {{ build_dir }}/blob-decoder {{ build_dir }}/cache-analyzer
311357
@echo "--> Tools cleaned"
312358

313359
# List available tools
360+
[group('tools')]
314361
list-tools:
315362
@echo "Available tools:"
316363
@echo " - da-debug"

0 commit comments

Comments
 (0)