-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathMakefile.toml
More file actions
234 lines (197 loc) · 6.34 KB
/
Makefile.toml
File metadata and controls
234 lines (197 loc) · 6.34 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
[tasks.check-all-fast]
description = "Run all fast checks"
dependencies = [
"crate-names",
"kebab-file-names",
"todo-format",
"assert-matches",
"use-in-fn",
"ruff-format",
"ruff-check",
"fmt",
"cargo-sort",
"cargo-shear",
"cargo-deny-no-advisories",
"zizmor",
"check-markdown-links",
"sandbox-image-version",
"check",
"check-docs",
"clippy",
"clippy-all-features",
]
[tasks.check-all]
description = "Run all checks"
dependencies = ["check-all-fast", "nextest"]
[tasks.check-extra]
description = "Run extra checks"
dependencies = ["cargo-deny"]
[tasks.check]
command = "cargo"
args = ["check"]
[tasks.clippy-all-features]
command = "cargo"
args = [
"clippy",
"--all-features",
"--all-targets",
"--locked",
"--",
"-D",
"warnings",
]
[tasks.clippy]
command = "cargo"
args = ["clippy", "--all-targets", "--locked", "--", "-D", "warnings"]
[tasks.fmt]
command = "cargo"
args = ["fmt", "--", "--check"]
[tasks.cargo-sort]
command = "cargo"
args = ["sort", "--workspace", "--grouped", "--check", "--check-format"]
[tasks.cargo-shear]
command = "cargo"
args = ["shear"]
[tasks.nextest]
command = "cargo"
args = [
"nextest",
"run",
"--cargo-profile=test-release",
"--all-features",
"--all-targets",
"--locked",
]
[tasks.ruff-format]
command = "ruff"
args = ["format", "--diff", "--exclude", "libs/nearcore"]
[tasks.ruff-check]
command = "ruff"
args = ["check", "--diff", "--exclude", "libs/nearcore"]
[tasks.zizmor]
command = "zizmor"
args = [".github/"]
[tasks.crate-names]
command = "bash"
args = ["scripts/check-crates-kebab-case.sh"]
[tasks.kebab-file-names]
command = "bash"
args = ["scripts/check-kebab-case-files.sh"]
[tasks.todo-format]
command = "bash"
args = ["scripts/check-todo-format.sh"]
[tasks.check-contract-size]
description = "Check reproducible contract WASM size against baseline"
command = "bash"
args = ["scripts/check-contract-wasm-size.sh"]
[tasks.assert-matches]
description = "Check for assert!(matches!(...)) — use assert_matches!() instead"
command = "bash"
args = ["scripts/check-assert-matches.sh"]
[tasks.use-in-fn]
description = "Check for use statements inside function bodies"
command = "python"
args = ["scripts/check-use-in-fn.py"]
[tasks.cargo-deny]
description = "Run cargo deny"
command = "cargo"
args = ["deny", "--all-features", "check"]
[tasks.cargo-deny-no-advisories]
description = "Run cargo deny without advisories"
command = "cargo"
args = ["deny", "--all-features", "check", "licenses", "bans", "sources"]
[tasks.license-file]
command = "bash"
args = ["scripts/check-third-party-licenses.sh"]
[tasks.check-docs]
description = "Check rustdoc for broken intra-doc links"
command = "cargo"
args = ["doc", "--workspace", "--no-deps"]
[tasks.check-docs.env]
RUSTDOCFLAGS = "-D warnings"
[tasks.check-markdown-links]
command = "lychee"
args = ["--no-progress", "."]
[tasks.sandbox-image-version]
description = "Check that sandbox Docker image version matches nearcore"
command = "bash"
args = ["scripts/check-sandbox-image-version.sh"]
# These build tasks are the single source of truth for both local and CI builds.
# CI (`mpc-pytest-build` and `mpc-e2e-tests` jobs) invokes them via `cargo make`.
# All three are skipped when `E2E_SKIP_BUILD` is set (used by `e2e-tests-skip-build`).
[tasks.build-mpc-node-network-hardship-simulation]
description = "Build the mpc-node binary used by the E2E tests"
condition = { env_not_set = ["E2E_SKIP_BUILD"] }
command = "cargo"
args = [
"build",
"-p",
"mpc-node",
"--release",
"--features",
"network-hardship-simulation,test-utils",
"--locked",
]
[tasks.build-mpc-contract-optimized]
description = "Build the mpc-contract WASM used by the E2E tests"
condition = { env_not_set = ["E2E_SKIP_BUILD"] }
script = [
"cargo build -p mpc-contract --target=wasm32-unknown-unknown --profile=release-contract --locked",
"wasm-opt -Oz target/wasm32-unknown-unknown/release-contract/mpc_contract.wasm -o target/wasm32-unknown-unknown/release-contract/mpc_contract.wasm",
]
[tasks.build-test-parallel-contract-optimized]
description = "Build the test-parallel-contract WASM used by the E2E tests"
condition = { env_not_set = ["E2E_SKIP_BUILD"] }
script = [
"cargo build -p test-parallel-contract --target=wasm32-unknown-unknown --profile=release-contract --locked",
"wasm-opt -Oz target/wasm32-unknown-unknown/release-contract/test_parallel_contract.wasm -o target/wasm32-unknown-unknown/release-contract/test_parallel_contract.wasm",
]
[tasks.build-backup-cli]
description = "Build the backup-cli binary used by the E2E migration tests"
condition = { env_not_set = ["E2E_SKIP_BUILD"] }
command = "cargo"
args = ["build", "-p", "backup-cli", "--release", "--locked"]
# Kill orphan mpc-node processes left over from interrupted test runs.
# Ports are deterministic per test, so orphans from a previous run block the next one.
[tasks.kill-orphan-mpc-nodes]
description = "Kill orphan mpc-node processes left over from interrupted E2E test runs"
script = [
"pids=$(pgrep -f 'mpc-node start-with-config-file' || true)",
"if [ -n \"$pids\" ]; then echo \"Killing orphan mpc-node processes: $pids\"; kill $pids; sleep 1; else echo \"No orphan mpc-node processes found\"; fi",
]
# Shared logic for `e2e-tests` and `e2e-tests-skip-build`. Dependencies are
# skipped automatically when `E2E_SKIP_BUILD` is set.
[tasks._run-e2e-logic]
private = true
dependencies = [
"build-mpc-node-network-hardship-simulation",
"build-mpc-contract-optimized",
"build-test-parallel-contract-optimized",
"build-backup-cli",
]
command = "cargo"
args = [
"nextest",
"run",
"--cargo-profile=test-release",
"-p",
"e2e-tests",
"--all-features",
"--locked",
"--profile",
"ci-e2e",
]
[tasks._run-e2e-logic.env]
MPC_CONTRACT_WASM = "${CARGO_MAKE_WORKING_DIRECTORY}/target/wasm32-unknown-unknown/release-contract/mpc_contract.wasm"
MPC_PARALLEL_CONTRACT_WASM = "${CARGO_MAKE_WORKING_DIRECTORY}/target/wasm32-unknown-unknown/release-contract/test_parallel_contract.wasm"
# Build the mpc-node binary and both contract WASMs, then run the E2E tests.
[tasks.e2e-tests]
description = "Build required binaries and run the E2E tests"
run_task = "_run-e2e-logic"
# Reuse the binaries from a previous `cargo make e2e-tests` run.
[tasks.e2e-tests-skip-build]
description = "Run the E2E tests using previously built binaries"
env = { "E2E_SKIP_BUILD" = "true" }
run_task = "_run-e2e-logic"
[config]
default_to_workspace = false