Skip to content

Commit 21afb4f

Browse files
committed
feat(ci): add functionality to copy ci.json to build directory if it exists during sketch build process
1 parent bd3d36c commit 21afb4f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/scripts/sketch_utils.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,12 @@ function build_sketch { # build_sketch <ide_path> <user_path> <path-to-ino> [ext
348348
exit "$exit_status"
349349
fi
350350

351+
# Copy ci.json to build directory if it exists
352+
if [ -f "$sketchdir/ci.json" ]; then
353+
echo "Copying ci.json to build directory: $build_dir"
354+
cp "$sketchdir/ci.json" "$build_dir/"
355+
fi
356+
351357
if [ -n "$log_compilation" ]; then
352358
#Extract the program storage space and dynamic memory usage in bytes and percentage in separate variables from the output, just the value without the string
353359
flash_bytes=$(grep -oE 'Sketch uses ([0-9]+) bytes' "$output_file" | awk '{print $3}')
@@ -391,6 +397,13 @@ function build_sketch { # build_sketch <ide_path> <user_path> <path-to-ino> [ext
391397
echo "ERROR: Compilation failed with error code $exit_status"
392398
exit $exit_status
393399
fi
400+
401+
# Copy ci.json to build directory if it exists
402+
if [ -f "$sketchdir/ci.json" ]; then
403+
echo "Copying ci.json to build directory: $build_dir"
404+
cp "$sketchdir/ci.json" "$build_dir/"
405+
fi
406+
394407
# $ide_path/arduino-builder -compile -logger=human -core-api-version=10810 \
395408
# -fqbn=\"$currfqbn\" \
396409
# -warnings="all" \

0 commit comments

Comments
 (0)