Skip to content

Commit 990a6e3

Browse files
committed
add log messages
1 parent 3ad6ea7 commit 990a6e3

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

.github/scripts/on-push.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,11 @@ if [ "$BUILD_PIO" -eq 0 ]; then
8989
build "esp32h2" $FQBN_ESP32H2 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32
9090
build "esp32" $FQBN_ESP32 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32
9191

92+
93+
echo "Debug(board) - removing last comma from the last JSON object"
94+
9295
#remove last comma from the last JSON object
93-
sed -i '' -e '$ s/,$//' $sizes_file
96+
sed -i '$ s/.$//' "$sizes_file"
9497
#echo end of JSON array
9598
echo "]}" >> $sizes_file
9699

.github/scripts/sketch_utils.sh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,13 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
140140
build_dir="$HOME/.arduino/tests/$sketchname/build.tmp"
141141
fi
142142

143+
echo "Chunk index = $CHUNK_INDEX"
144+
143145
log_file="$HOME/.arduino/cli_compile_output.txt"
144146
sizes_file="$GITHUB_WORKSPACE/cli_compile_$CHUNK_INDEX.json"
145147

148+
echo "Sizes file = $sizes_file"
149+
146150
#echo board,target and start of sketches to sizes_file json
147151
echo "{ \"board\": \"$fqbn\",
148152
\"target\": \"$target\",
@@ -187,15 +191,15 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
187191
ram_bytes=$(grep -oE 'Global variables use ([0-9]+) bytes' $log_file | awk '{print $4}')
188192
ram_percentage=$(grep -oE 'Global variables use ([0-9]+) bytes \(([0-9]+)%\)' $log_file | awk '{print $6}' | tr -d '(%)')
189193

194+
# Extract the directory path excluding the filename
195+
directory_path=$(dirname "$sketch")
196+
echo "Debug (sketch)- directory path = $directory_path"
190197
# Define the constant part
191-
constant_path="$HOME/Arduino/hardware/espressif/esp32/libraries/"
192-
193-
# Extract the desired substring using awk
194-
lib_sketch_name=$(echo "$sketch" | sed "s|$constant_part\([^/]*\)/.*|\1|")
195-
196-
# Print the extracted substring
197-
echo "Extracted Path: $lib_sketch_name"
198-
198+
constant_part="/home/runner/Arduino/hardware/espressif/esp32/libraries/"
199+
echo "Debug (sketch)- constant part = $constant_part"
200+
# Extract the desired substring using sed
201+
lib_sketch_name=$(echo "$directory_path" | sed "s|$constant_part||")
202+
echo "Debug (sketch)- extracted path = $lib_sketch_name"
199203
#append json file where key is fqbn, sketch name, sizes -> extracted values
200204
echo "{\"name\": \"$lib_sketch_name\",
201205
\"sizes\": {
@@ -206,6 +210,7 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
206210
}
207211
}," >> "$sizes_file"
208212
#if i is the last index of the loop, remove the last comma
213+
echo "Debug (sketch)- removing last comma from the last JSON object"
209214
if [ $i -eq $(($len - 1)) ]; then
210215
sed -i '$ s/.$//' "$sizes_file"
211216
fi

0 commit comments

Comments
 (0)