77
77
libraries:
78
78
- 'libraries/**/examples/**'
79
79
- 'libraries/**/src/**'
80
+ networking:
81
+ - 'libraries/Network/src/**'
82
+ fs:
83
+ - 'libraries/FS/src/**'
80
84
static_sketeches:
81
85
- 'libraries/NetworkClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino'
82
86
- 'libraries/BLE/examples/Server/Server.ino'
@@ -97,78 +101,18 @@ jobs:
97
101
id : set-chunks
98
102
env :
99
103
LIB_FILES : ${{ steps.changed-files.outputs.libraries_all_changed_files }}
104
+ IS_PR : ${{ github.event_name == 'pull_request' }}
105
+ MAX_CHUNKS : ${{ env.MAX_CHUNKS }}
106
+ BUILD_PLATFORMIO : ${{ steps.changed-files.outputs.platformio_any_changed == 'true' }}
107
+ BUILD_IDF : ${{ steps.changed-files.outputs.idf_any_changed == 'true' }}
108
+ BUILD_LIBRARIES : ${{ steps.changed-files.outputs.libraries_any_changed == 'true' }}
109
+ BUILD_STATIC_SKETCHES : ${{ steps.changed-files.outputs.static_sketeches_any_changed == 'true' }}
110
+ FS_CHANGED : ${{ steps.changed-files.outputs.fs_any_changed == 'true' }}
111
+ NETWORKING_CHANGED : ${{ steps.changed-files.outputs.networking_any_changed == 'true' }}
112
+ CORE_CHANGED : ${{ steps.changed-files.outputs.core_any_changed == 'true' }}
113
+ LIB_CHANGED : ${{ steps.changed-files.outputs.libraries_any_changed == 'true' }}
100
114
run : |
101
- build_all=false
102
- chunks_count=0
103
- is_pr=${{ github.event_name == 'pull_request' }}
104
-
105
- build_platformio=${{ steps.changed-files.outputs.platformio_any_changed == 'true' }}
106
- build_idf=${{ steps.changed-files.outputs.idf_any_changed == 'true' }}
107
- build_libraries=${{ steps.changed-files.outputs.libraries_any_changed == 'true' }}
108
- build_static_sketches=${{ steps.changed-files.outputs.static_sketeches_any_changed == 'true' }}
109
-
110
- core_changed=${{ steps.changed-files.outputs.core_any_changed == 'true' }}
111
- lib_changed=${{ steps.changed-files.outputs.libraries_any_changed == 'true' }}
112
-
113
- if [[ $core_changed == 'true' ]] || [[ $is_pr != 'true' ]]; then
114
- echo "Core files changed or not a PR. Building all."
115
- build_all=true
116
- chunks_count=${{ env.MAX_CHUNKS }}
117
- elif [[ $lib_changed == 'true' ]]; then
118
- echo "Libraries changed. Building only affected sketches."
119
- sketches=""
120
- for file in $LIB_FILES; do
121
- if [[ $file == *.ino ]]; then
122
- # If file ends with .ino, add it to the list of sketches
123
- echo "Sketch found: $file"
124
- sketches+="$file "
125
- elif [[ $(basename $(dirname $file)) == "src" ]]; then
126
- # If file is in a src directory, find all sketches in the parent/examples directory
127
- echo "Library src file found: $file"
128
- lib=$(dirname $(dirname $file))
129
- lib_sketches=$(find $lib/examples -name *.ino)
130
- sketches+="$lib_sketches "
131
- echo "Library sketches: $lib_sketches"
132
- else
133
- # If file is in a example folder but it is not a sketch, find all sketches in the current directory
134
- echo "File in example folder found: $file"
135
- sketch=$(find $(dirname $file) -name *.ino)
136
- sketches+="$sketch "
137
- echo "Sketch in example folder: $sketch"
138
- fi
139
- echo ""
140
- done
141
- fi
142
-
143
- if [[ -n $sketches ]]; then
144
- # Remove duplicates
145
- sketches=$(echo $sketches | tr ' ' '\n' | sort | uniq)
146
- for sketch in $sketches; do
147
- echo $sketch >> sketches_found.txt
148
- chunks_count=$((chunks_count+1))
149
- done
150
- echo "Number of sketches found: $chunks_count"
151
- echo "Sketches: $sketches"
152
-
153
- if [[ $chunks_count -gt ${{ env.MAX_CHUNKS }} ]]; then
154
- echo "More sketches than the allowed number of chunks found. Limiting to ${{ env.MAX_CHUNKS }} chunks."
155
- chunks_count=${{ env.MAX_CHUNKS }}
156
- fi
157
- fi
158
-
159
- chunks='["0"'
160
- for i in $(seq 1 $(( $chunks_count - 1 )) ); do
161
- chunks+=",\"$i\""
162
- done
163
- chunks+="]"
164
-
165
- echo "build_all=$build_all" >> $GITHUB_OUTPUT
166
- echo "build_libraries=$build_libraries" >> $GITHUB_OUTPUT
167
- echo "build_static_sketches=$build_static_sketches" >> $GITHUB_OUTPUT
168
- echo "build_idf=$build_idf" >> $GITHUB_OUTPUT
169
- echo "build_platformio=$build_platformio" >> $GITHUB_OUTPUT
170
- echo "chunk_count=$chunks_count" >> $GITHUB_OUTPUT
171
- echo "chunks=$chunks" >> $GITHUB_OUTPUT
115
+ bash ./.github/scripts/set_push_chunks.sh
172
116
173
117
- name : Upload sketches found
174
118
if : ${{ steps.set-chunks.outputs.build_all == 'false' && steps.set-chunks.outputs.build_libraries == 'true' }}
@@ -336,9 +280,10 @@ jobs:
336
280
337
281
- name : Commit json files to gh-pages if on master
338
282
if : github.event_name == 'push' && github.ref == 'refs/heads/master'
283
+ continue-on-error : true
339
284
run : |
340
- git config user.name github-actions
341
- git config user.email github-actions@ github.com
285
+ git config user.name " github-actions[bot]"
286
+ git config user.email "41898282+ github-actions[bot]@users.noreply. github.com"
342
287
git add --all
343
288
git commit -m "Updated cli compile json files"
344
289
git push origin HEAD:gh-pages
0 commit comments