[tasks.check-all-fast] description = "Run all fast checks" dependencies = [ "crate-names", "kebab-file-names", "todo-format", "editorconfig", "assert-matches", "use-in-fn", "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.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.editorconfig] description = "Enforce .editorconfig rules across all tracked files" command = "editorconfig-checker" [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 = "ast-grep" args = ["scan", "--rule", "lints/no-use-in-fn.yml", "crates/"] [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's `mpc-e2e-tests` job 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", ] # Build via cargo-near, the same tool that produces the deployed/reproducible # artifact. It sets `--cfg near` (required by near-sdk's host bindings — e.g. # `env::panic_str` -> `panic_utf8`) and runs wasm-opt. A plain `cargo build` # omits `--cfg near`, which makes contract panics compile to raw `unreachable` # traps instead of readable errors. Output: target/near//.wasm. [tasks.build-mpc-contract-optimized] description = "Build the mpc-contract WASM used by the E2E tests" condition = { env_not_set = ["E2E_SKIP_BUILD"] } command = "cargo" args = [ "near", "build", "non-reproducible-wasm", "--no-abi", "--profile=release-contract", "--manifest-path", "crates/contract/Cargo.toml", "--locked", ] [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"] } command = "cargo" args = [ "near", "build", "non-reproducible-wasm", "--no-abi", "--profile=release-contract", "--manifest-path", "crates/test-parallel-contract/Cargo.toml", "--locked", ] [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/near/mpc_contract/mpc_contract.wasm" MPC_PARALLEL_CONTRACT_WASM = "${CARGO_MAKE_WORKING_DIRECTORY}/target/near/test_parallel_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