forked from 0xPolygonMiden/miden-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.toml
99 lines (80 loc) · 2.77 KB
/
Makefile.toml
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Cargo Makefile
# If running cargo-make in a workspace you need to add this env variable to make sure it function correctly.
# See docs: https://github.com/sagiegurari/cargo-make?tab=readme-ov-file#usage
[env]
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
# --- linting -------------------------------------------------------------------------------------
[tasks.fix]
description = "Runs Fix"
command = "cargo"
toolchain = "nightly"
args = ["fix", "--allow-staged", "--allow-dirty", "--all-targets", "--all-features"]
[tasks.format]
toolchain = "nightly"
command = "cargo"
args = ["fmt", "--all"]
[tasks.format-check]
description = "Runs Rustfmt on check mode"
toolchain = "nightly"
command = "cargo"
args = ["fmt", "--all", "--", "--check"]
[tasks.clippy-default]
description = "Runs Clippy on default mode"
command = "cargo"
args = ["clippy","--workspace", "--all-targets", "--", "-D", "clippy::all", "-D", "warnings"]
[tasks.clippy-all-features]
description = "Runs Clippy with all features"
command = "cargo"
args = ["clippy","--workspace", "--all-targets", "--all-features", "--", "-D", "clippy::all", "-D", "warnings"]
[tasks.clippy]
description = "Runs all Clippy tasks"
dependencies = [
"clippy-default",
"clippy-all-features"
]
[tasks.lint]
description = "Runs all linting tasks (Clippy, fixing, formatting, docs)"
dependencies = [
"fix",
"format",
"clippy",
]
# --- docs ----------------------------------------------------------------------------------------
[tasks.doc]
description = "Runs docs verification"
env = { "RUSTDOCFLAGS" = "-D warnings" }
command = "cargo"
args = ["doc", "--all-features", "--keep-going", "--release"]
# --- testing -------------------------------------------------------------------------------------
[tasks.test]
disabled = true
[tasks.test-all]
description = "Runs all tests"
command = "cargo"
args = ["test", "--all-features", "--workspace", "--", "--nocapture"]
# --- docker -------------------------------------------------------------------------------------
[tasks.docker-build-node]
description = "Builds the Miden node using Docker"
workspace = false
script = '''
CREATED=$(date)
VERSION=$(cat bin/node/Cargo.toml | grep -m 1 '^version' | cut -d '"' -f 2)
COMMIT=$(git rev-parse HEAD)
docker build --build-arg CREATED="$CREATED" \
--build-arg VERSION="$VERSION" \
--build-arg COMMIT="$COMMIT" \
-f bin/node/Dockerfile \
-t miden-node-image .
'''
[tasks.docker-run-node]
description = "Runs the Miden node using Docker"
workspace = false
script = '''
docker volume create miden-db
ABSOLUTE_PATH="$(pwd)/bin/node/miden-node.toml"
docker run --name miden-node \
-p 57291:57291 \
-v miden-db:/db \
-v "${ABSOLUTE_PATH}:/miden-node.toml" \
-d miden-node-image
'''