Skip to content

Commit 29dde8c

Browse files
committed
feat: enhance upload and compile tasks with timing messages for better performance tracking
1 parent aeb34a6 commit 29dde8c

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

Taskfile.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,13 @@ tasks:
121121
cmds:
122122
- |
123123
adb push ./python/ /home/arduino/ArduinoApps/scratch-arduino-app/
124-
echo "🐍 files uploaded successfully"
125124
126125
CONTAINER_ID=$(adb shell "docker ps -q --filter 'ancestor=ghcr.io/arduino/app-bricks/python-apps-base:0.5.0'")
127126
if [ -n "$CONTAINER_ID" ]; then
127+
RESTART_START=$(date +%s)
128128
adb shell "docker restart $CONTAINER_ID"
129-
echo "🐍 Container restarted successfully"
129+
RESTART_END=$(date +%s)
130+
echo "🐍 Container restarted in $((RESTART_END - RESTART_START))s"
130131
else
131132
echo "[warning] No running container found with image ghcr.io/arduino/app-bricks/python-apps-base"
132133
fi
@@ -157,8 +158,17 @@ tasks:
157158
desc: "Compile and upload Arduino sketch"
158159
silent: true
159160
cmds:
160-
- arduino-cli compile --build-path .cache -b arduino:zephyr:unoq sketch/
161-
- arduino-cli upload -p /dev/ttyACM0 -b arduino:zephyr:unoq:flash_mode=ram --input-dir .cache sketch/
161+
- |
162+
C_START=$(date +%s)
163+
arduino-cli compile --build-path .cache -b arduino:zephyr:unoq sketch/
164+
C_END=$(date +%s)
165+
166+
U_START=$(date +%s)
167+
arduino-cli upload -p /dev/ttyACM0 -b arduino:zephyr:unoq:flash_mode=ram --input-dir .cache sketch/
168+
U_END=$(date +%s)
169+
echo "♾️ Compiled in $((C_END - C_START))s, Uploaded in $((U_END - U_START))s"
170+
# even if not necessary: the sketch folder is sync into the board to have the updated version
171+
- adb push ./sketch/ /home/arduino/ArduinoApps/scratch-arduino-app/
162172

163173
sketch:monitor:
164174
desc: "Open serial monitor for Arduino debugging"

0 commit comments

Comments
 (0)