Add zacus tooling entrypoint for VS Code tasks

This commit is contained in:
Clément SAILLANT
2026-02-15 16:37:57 +01:00
parent 633bf60bca
commit b8323ccc29
4 changed files with 128 additions and 0 deletions
+1
View File
@@ -3,6 +3,7 @@
# Local IDE settings
.vscode/
!.vscode/tasks.json
!hardware/firmware/.vscode/
hardware/firmware/.vscode/*
!hardware/firmware/.vscode/tasks.json
+87
View File
@@ -0,0 +1,87 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Zacus: Firmware · Bootstrap venv",
"type": "shell",
"command": "bash",
"args": ["-lc", "cd hardware/firmware && ./tools/dev/bootstrap_local.sh"],
"problemMatcher": [],
"presentation": { "panel": "dedicated", "group": "zacus", "reveal": "always" }
},
{
"label": "Zacus: Firmware · Build all (build_all.sh)",
"type": "shell",
"command": "bash",
"args": [
"-lc",
"cd hardware/firmware && ./tools/dev/bootstrap_local.sh && export PLATFORMIO_CORE_DIR=\"$HOME/.platformio\" && ./build_all.sh"
],
"problemMatcher": [],
"presentation": { "panel": "dedicated", "group": "zacus", "reveal": "always" }
},
{
"label": "Zacus: Firmware · RC live (require HW)",
"type": "shell",
"command": "bash",
"args": ["-lc", "./tools/dev/zacus.sh rc"],
"options": { "cwd": "${workspaceFolder}" },
"problemMatcher": [],
"presentation": { "panel": "dedicated", "group": "zacus", "reveal": "always" }
},
{
"label": "Zacus: Firmware · RC live FAST (--skip-build --skip-upload)",
"type": "shell",
"command": "bash",
"args": [
"-lc",
"cd hardware/firmware && ./tools/dev/bootstrap_local.sh && export PLATFORMIO_CORE_DIR=\"$HOME/.platformio\" && ZACUS_REQUIRE_HW=1 ./tools/dev/run_matrix_and_smoke.sh --skip-build --skip-upload"
],
"problemMatcher": [],
"presentation": { "panel": "dedicated", "group": "zacus", "reveal": "always" }
},
{
"label": "Zacus: Firmware · Ports watch (15s)",
"type": "shell",
"command": "bash",
"args": [
"-lc",
"cd hardware/firmware && ./tools/dev/bootstrap_local.sh && while true; do echo \"==== $(date) ====\"; ./.venv/bin/python -m serial.tools.list_ports -v || true; echo; sleep 15; done"
],
"problemMatcher": [],
"presentation": { "panel": "dedicated", "group": "zacus-watch", "reveal": "always" }
},
{
"label": "Zacus: Firmware · Tail last RC log (5s)",
"type": "shell",
"command": "bash",
"args": [
"-lc",
"cd hardware/firmware && while true; do d=$(ls -1dt artifacts/rc_live/* 2>/dev/null | head -n 1); if [ -n \"$d\" ]; then echo \"== $d ==\"; tail -n 60 \"$d/run_matrix_and_smoke.log\" 2>/dev/null || true; echo; fi; sleep 5; done"
],
"problemMatcher": [],
"presentation": { "panel": "dedicated", "group": "zacus-watch", "reveal": "always" }
},
{
"label": "Zacus: Firmware · Show last summary",
"type": "shell",
"command": "bash",
"args": [
"-lc",
"cd hardware/firmware && d=$(ls -1dt artifacts/rc_live/* 2>/dev/null | head -n 1); echo \"Last: ${d:-n/a}\"; [ -n \"$d\" ] && sed -n '1,220p' \"$d/summary.md\" || true"
],
"problemMatcher": [],
"presentation": { "panel": "dedicated", "group": "zacus", "reveal": "always" }
},
{
"label": "Zacus: Cockpit (ports + tail)",
"type": "shell",
"command": "bash",
"args": ["-lc", "echo \"Cockpit started (stop tasks to close watchers).\""],
"dependsOrder": "parallel",
"dependsOn": ["Zacus: Firmware · Ports watch (15s)", "Zacus: Firmware · Tail last RC log (5s)"],
"problemMatcher": [],
"presentation": { "panel": "dedicated", "group": "zacus", "reveal": "always" }
}
]
}
+4
View File
@@ -9,6 +9,7 @@
"-lc",
"set -euo pipefail; ROOT=$(git rev-parse --show-toplevel); \"$ROOT/tools/dev/zacus.sh\" rc"
],
"options": { "cwd": "${workspaceFolder}" },
"presentation": { "panel": "dedicated", "reveal": "always" },
"problemMatcher": []
},
@@ -20,6 +21,7 @@
"-lc",
"set -euo pipefail; ROOT=$(git rev-parse --show-toplevel); \"$ROOT/tools/dev/zacus.sh\" flash && \"$ROOT/tools/dev/zacus.sh\" rc"
],
"options": { "cwd": "${workspaceFolder}" },
"presentation": { "panel": "dedicated", "reveal": "always" },
"problemMatcher": []
},
@@ -31,6 +33,7 @@
"-lc",
"set -euo pipefail; ROOT=$(git rev-parse --show-toplevel); \"$ROOT/tools/dev/zacus.sh\" rc-autofix"
],
"options": { "cwd": "${workspaceFolder}" },
"presentation": { "panel": "dedicated", "reveal": "always" },
"problemMatcher": []
},
@@ -42,6 +45,7 @@
"-lc",
"set -euo pipefail; ROOT=$(git rev-parse --show-toplevel); \"$ROOT/tools/dev/zacus.sh\" ports"
],
"options": { "cwd": "${workspaceFolder}" },
"presentation": { "panel": "dedicated", "reveal": "always", "showReuseMessage": false },
"problemMatcher": []
}
+36
View File
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
FW_ROOT="$REPO_ROOT/hardware/firmware"
RC_GATE="$FW_ROOT/tools/dev/run_matrix_and_smoke.sh"
SMOKE_CMD="$FW_ROOT/tools/dev/serial_smoke.py"
usage() {
cat <<'USAGE'
Usage: zacus.sh <command> [args]
Commands:
rc Run the RC live gate (requires hardware)
smoke Invoke the serial smoke helper (passes args through)
help Show this usage
USAGE
}
command="${1:-help}"
shift || true
case "$command" in
rc)
(cd "$FW_ROOT" && "$RC_GATE")
;;
smoke)
(cd "$FW_ROOT" && python3 "$SMOKE_CMD" "$@")
;;
help|-h|--help)
usage
;;
*)
usage
exit 1
;;
esac