Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add makefile for rollup boost #102

Merged
merged 2 commits into from
Feb 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# 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

GIT_VER ?= $(shell git describe --tags --always --dirty="-dev")
GIT_TAG ?= $(shell git describe --tags --abbrev=0)

FEATURES ?=

##@ 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 current version
@echo "Version: ${GIT_VER}"

##@ Build

.PHONY: clean
clean: ## Clean up
cargo clean

.PHONY: build
build: ## Build (debug version)
cargo build --features "$(FEATURES)"

.PHONY: docker-image
docker-image: ## Build a rollup-boost Docker image
docker build --platform linux/amd64 --build-arg FEATURES="$(FEATURES)" . -t rollup-boost

##@ Dev

.PHONY: lint
lint: ## Run the linters
cargo fmt -- --check
cargo clippy --features "$(FEATURES)" -- -D warnings

.PHONY: test
test: ## Run the tests for rollup-boost
cargo test --verbose --features "$(FEATURES)"

Copy link
Collaborator

@ferranbt ferranbt Feb 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add another command for integration tests too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great point

.PHONY: test-integration
test-integration: ## Run the integration tests for rollup-boost
cargo test --verbose --features integration -- integration::integration_test::tests

.PHONY: lt
lt: lint test ## Run "lint" and "test"

.PHONY: fmt
fmt: ## Format the code
cargo fmt
cargo fix --allow-staged
cargo clippy --features "$(FEATURES)" --fix --allow-staged
Loading