forked from matter-labs/anvil-zksync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
76 lines (60 loc) · 2.11 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
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
76
# Fetch submodule system contracts
fetch-contracts:
git submodule update --init --recursive
# Build the system contracts
build-contracts:
cd contracts/system-contracts && yarn install --frozen-lockfile; yarn build;
cd contracts/l2-contracts && yarn install --frozen-lockfile; yarn build;
./scripts/refresh_contracts.sh
# Clean the system contracts
clean-contracts:
cd contracts/system-contracts && yarn clean
rm -rf src/deps/contracts
# Rebuild the system contracts
rebuild-contracts:
cd contracts/system-contracts && yarn build;
cd contracts/l2-contracts && yarn build;
./scripts/refresh_contracts.sh
./scripts/refresh_test_contracts.sh
# Build the Rust project
rust-build:
cargo build --release
# Run local after building everything
run: all
./target/release/anvil-zksync run
# Build the Rust project for a specific target. Primarily used for CI.
build-%:
cross build --bin anvil-zksync --target $* --release
# Build the Rust documentation
rust-doc:
cargo doc --no-deps --open
# Lint checks for Rust code
lint:
cd e2e-tests && yarn && yarn lint && yarn fmt && yarn typecheck
cargo fmt --all -- --check
cargo clippy --tests -p anvil-zksync -Zunstable-options -- -D warnings --allow clippy::unwrap_used
# Fix lint errors for Rust code
lint-fix:
cd e2e-tests && yarn && yarn lint:fix && yarn fmt:fix
cargo clippy --fix
cargo fmt
# Run unit tests for Rust code
test:
cargo test
# Run e2e tests against running anvil-zksync
test-e2e:
./scripts/execute-e2e-tests.sh
# Build everything
all: fetch-contracts build-contracts rust-build
# Clean everything
clean: clean-contracts
# Create new draft release based on Cargo.toml version
new-release-tag:
@VERSION_NUMBER=$$(grep '^version =' Cargo.toml | awk -F '"' '{print $$2}') && \
git tag -a v$$VERSION_NUMBER -m "Release v$$VERSION_NUMBER" && \
echo "\n\033[0;32mGit tag creation SUCCESSFUL! Use the following command to push the tag:\033[0m" && \
echo "git push origin v$$VERSION_NUMBER"
# Create the rust book
book:
mdbook build docs/rustbook
.PHONY: build-contracts clean-contracts rebuild-contracts rust-build lint test test-e2e all clean build-% new-release-tag book