Skip to content

Commit cf7d0d3

Browse files
authored
Merge pull request #1150 from openmina/dw/add-makefile
Add Makefile
2 parents f66cf06 + a97c216 commit cf7d0d3

File tree

3 files changed

+59
-0
lines changed

3 files changed

+59
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ jobs:
202202
- name: Release build
203203
run: |
204204
cd node/web
205+
rustup component add rust-src rustfmt --toolchain nightly-x86_64-unknown-linux-gnu
205206
cargo +nightly build --release --target wasm32-unknown-unknown
206207
wasm-bindgen --keep-debug --web --out-dir pkg ../../target/wasm32-unknown-unknown/release/openmina_node_web.wasm
207208

Makefile

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# OpenMina Makefile
2+
3+
.PHONY: help
4+
help: ## Ask for help!
5+
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
6+
7+
.PHONY: build
8+
build: ## Build the project in debug mode
9+
cargo build
10+
11+
.PHONY: build-release
12+
build-release: ## Build the project in release mode
13+
cargo build --release --bin openmina
14+
15+
.PHONY: build-tests
16+
build-tests: ## Build test binaries
17+
cargo build --release --tests --package=openmina-node-testing --package=cli
18+
19+
.PHONY: build-wasm
20+
build-wasm: ## Build WebAssembly node
21+
cd node/web && cargo +nightly build --release --target wasm32-unknown-unknown
22+
23+
.PHONY: check
24+
check: ## Check code for compilation errors
25+
cargo check --all-targets
26+
27+
.PHONY: clean
28+
clean: ## Clean build artifacts
29+
cargo clean
30+
31+
.PHONY: fmt
32+
fmt: ## Format code using rustfmt
33+
cargo fmt --all
34+
35+
.PHONY: lint
36+
lint: ## Run linter (clippy)
37+
cargo clippy --all-targets -- -D warnings --allow clippy::mutable_key_type
38+
39+
.PHONY: test
40+
test: ## Run tests
41+
cargo test
42+
43+
.PHONY: test-ledger
44+
test-ledger: ## Run ledger tests
45+
cd ledger && cargo test --release
46+
47+
.PHONY: test-p2p
48+
test-p2p: ## Run P2P tests
49+
cargo test -p p2p --tests
50+
51+
.PHONY: test-release
52+
test-release: ## Run tests in release mode
53+
cargo test --release
54+
55+
.PHONY: test-vrf
56+
test-vrf: ## Run VRF tests
57+
cd vrf && cargo test --release

rust-toolchain

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.84

0 commit comments

Comments
 (0)