Skip to content

Commit 9b937f1

Browse files
committed
debug
1 parent 3b91dca commit 9b937f1

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/push.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,39 +85,52 @@ jobs:
8585
chunks_count=0
8686
8787
if [[ $core_changed == 'true' ]] || [[ $is_pr != 'true' ]]; then
88+
echo "Core files changed or not a PR. Building all."
8889
build_all=true
8990
chunks_count=${{ env.MAX_CHUNKS }}
9091
elif [[ $lib_changed == 'true' ]] || [[ $examples_changed == 'true' ]]; then
92+
echo "Libraries or examples changed. Building only affected sketches."
9193
sketches=""
9294
files="$LIB_FILES $EXAMPLES_FILES"
9395
for file in $files; do
9496
if [[ $file == "*.ino" ]]; then
9597
# If file ends with .ino, add it to the list of sketches
98+
echo "Sketch found: $file"
9699
sketches+="$file "
97100
continue
98101
elif [[ $(dirname $file) == "**/src" ]]; then
99102
# If file is in a src directory, find all sketches in the parent/examples directory
103+
echo "Library src file found: $file"
100104
lib=$(dirname $(dirname $file))
101-
sketches+=$(find $lib/examples -name *.ino)
105+
lib_sketches+=$(find $lib/examples -name *.ino)
106+
sketches+=$lib_sketches
107+
echo "Library sketches: $lib_sketches"
102108
else
103109
# If file is in a example folder but it is not a sketch, find all sketches in the current directory
104-
sketches+=$(find $(dirname $file) -name *.ino)
110+
echo "File in example folder found: $file"
111+
sketch=$(find $(dirname $file) -name *.ino)
112+
sketches+=$sketch
113+
echo "Sketch in example folder: $sketch"
105114
fi
106115
done
107116
108117
# Remove duplicates
109118
sketches=$(echo $sketches | tr ' ' '\n' | sort | uniq)
119+
echo "Unique sketches: $sketches"
110120
111121
for sketch in $sketches; do
112122
echo $sketch >> sketches_found.txt
113123
chunks_count=$((chunks_count+1))
114124
done
125+
126+
echo "Number of sketches found: $chunks_count"
115127
else
116128
echo "Unhandled change triggered the build. This should not happen."
117129
exit 1
118130
fi
119131
120132
if [[ $chunks_count -gt ${{ env.MAX_CHUNKS }} ]]; then
133+
echo "Too many sketches found. Limiting to ${{ env.MAX_CHUNKS }} sketches."
121134
chunks_count=${{ env.MAX_CHUNKS }}
122135
fi
123136

0 commit comments

Comments
 (0)