@@ -168,7 +168,7 @@ jobs:
168168 runs-on : ubuntu-latest
169169 needs :
170170 - package-core
171- if : always()
171+ if : ${{ !cancelled() }}
172172 steps :
173173 -
uses :
geekyeggo/[email protected] 174174 with :
@@ -195,6 +195,13 @@ jobs:
195195 CORE_ARTIFACT : ArduinoCore-${{ matrix.artifact }}-${{ needs.build-env.outputs.CORE_HASH }}
196196 if : ${{ !cancelled() && needs.build-env.result == 'success' }}
197197 steps :
198+ - uses : actions/checkout@v4
199+ with :
200+ fetch-depth : 0
201+ persist-credentials : false
202+ sparse-checkout : |
203+ extra/ci_test_list.sh
204+
198205 - uses : actions/download-artifact@v4
199206 with :
200207 name : ${{ env.CORE_ARTIFACT }}
@@ -204,31 +211,38 @@ jobs:
204211 tar xf ${CORE_ARTIFACT}.tar.bz2 # will create ArduinoCore-zephyr/
205212 echo "REPORT_FILE=$(echo ${FQBN} | tr ':' '-').json" >> $GITHUB_ENV
206213
207- - name : Create Blink sketch
214+ - name : Get test sketches
208215 run : |
209216 mkdir Blink/
210217 wget -nv https://raw.githubusercontent.com/arduino/arduino-examples/refs/heads/main/examples/01.Basics/Blink/Blink.ino -P Blink/
211-
212- - name : Compile Blink for ${{ matrix.board }}
213- uses : pillo79/compile-sketches@main
218+ # wget -nv $(curl -s https://api.github.com/repos/arduino-libraries/ArduinoBLE/releases/latest | jq -r '.tarball_url') -O ArduinoBLE.tar.gz
219+ # tar zxf ArduinoBLE.tar.gz && mv arduino-libraries-ArduinoBLE* ArduinoCore-zephyr/libraries/ArduinoBLE
220+ wget -nv https://github.com/arduino-libraries/ArduinoBLE/archive/refs/heads/master.tar.gz
221+ tar zxf master.tar.gz && mv ArduinoBLE-master ArduinoCore-zephyr/libraries/ArduinoBLE
222+ # sets ALL_TESTS and ALL_LIBRARIES env vars
223+ extra/ci_test_list.sh ${{ matrix.variant }} Blink
224+
225+ - name : Compile tests for ${{ matrix.board }}
226+ uses : pillo79/compile-sketches@next
214227 with :
215228 fqbn : ${{ env.FQBN }}
216229 platforms : |
217- # Use Board Manager to install the latest release of Arduino Zephyr Boards to get the toolchain
218- - name: "arduino:zephyr"
219- source-url: "https://downloads.arduino.cc/packages/package_zephyr_index.json"
230+ # Use Board Manager version first, to install the toolchain
231+ - name: ${{ env.PLAT }}
220232 - name: ${{ env.PLAT }}
221233 source-path: "ArduinoCore-zephyr"
222- sketch-paths : Blink
234+ sketch-paths : |
235+ ${{ env.ALL_TESTS }}
236+ libraries : |
237+ ${{ env.ALL_LIBRARIES }}
223238 cli-compile-flags : |
224239 - '--build-property'
225240 - 'compiler.c.extra_flags=-Wno-type-limits -Wno-missing-field-initializers'
226241 - '--build-property'
227242 - 'compiler.cpp.extra_flags=-Wno-type-limits -Wno-missing-field-initializers'
228243 verbose : ' false'
229244 enable-deltas-report : ' false'
230- enable-warnings-report : ' true'
231- enable-warnings-log : ' true'
245+ enable-issues-report : ' true'
232246
233247 - name : Get job ID
234248 id : job_id
@@ -247,8 +261,9 @@ jobs:
247261 - name : Prepare log
248262 if : ${{ success() || failure() }}
249263 run : |
264+ [ ! -f sketches-reports/${REPORT_FILE} ] && mkdir -p sketches-reports && echo "{}" > sketches-reports/${REPORT_FILE}
250265 sed -i -e 's!/home/runner/.arduino15/packages/arduino/hardware/zephyr/[^/]*/!!g' sketches-reports/${REPORT_FILE}
251- cat sketches-reports/${REPORT_FILE} | jq -cr ".boards[0].sketches[0] += { job_id: ${{ steps.job_id.outputs.result }} }" > ${REPORT_FILE} && mv ${REPORT_FILE} sketches-reports/
266+ cat sketches-reports/${REPORT_FILE} | jq -cr ". += { job_id: ${{ steps.job_id.outputs.result }} }" > ${REPORT_FILE} && mv ${REPORT_FILE} sketches-reports/
252267
253268 - uses : actions/upload-artifact@v4
254269 if : ${{ success() || failure() }}
@@ -267,49 +282,18 @@ jobs:
267282 env :
268283 ALL_BOARD_DATA : ${{ needs.build-env.outputs.ALL_BOARD_DATA }}
269284 steps :
285+ - uses : actions/checkout@v4
286+ with :
287+ fetch-depth : 0
288+ persist-credentials : false
289+
270290 - uses : actions/download-artifact@v4
271291 with :
272292 path : .
273293 pattern : test-report-*
274294 merge-multiple : true
275295
276- - run : |
277- ARTIFACTS=$(jq -cr 'map(.artifact) | unique | .[]' <<< ${ALL_BOARD_DATA}) # this avoids the 'zephyr' artifact
278- for artifact in $ARTIFACTS ; do
279- echo "### \`$artifact\` test results:" >> "$GITHUB_STEP_SUMMARY"
280- jq -c "map(select(.artifact == \"$artifact\")) | .[]" <<< ${ALL_BOARD_DATA} | while read -r BOARD_DATA; do
281- BOARD=$(echo $BOARD_DATA | jq -cr '.board')
282- VARIANT=$(echo $BOARD_DATA | jq -cr '.variant')
283- SUBARCH=$(echo $BOARD_DATA | jq -cr '.subarch')
284- FQBN="arduino:$SUBARCH:$BOARD"
285- REPORT_FILE="$(echo $FQBN | tr ':' '-').json"
286- if [ ! -f $REPORT_FILE ]; then
287- echo "* :x: $BOARD (\`$VARIANT\`) - No report found?" >> "$GITHUB_STEP_SUMMARY"
288- else
289- REPORT=$(jq -cr '.boards[0].sketches[0]' $REPORT_FILE)
290- JOB_ID=$(echo $REPORT | jq -cr '.job_id')
291- JOB_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${JOB_ID}#step:5:2"
292- if ! $(echo $REPORT | jq -cr '.compilation_success') ; then
293- echo "* :x: [$BOARD]($JOB_URL) (\`$VARIANT\`) - Build failed" >> "$GITHUB_STEP_SUMMARY"
294- else
295- WARNINGS=$(echo $REPORT | jq -cr '.warnings.current.absolute // 0')
296- if [ $WARNINGS -eq 0 ]; then
297- echo "* :white_check_mark: $BOARD (\`$VARIANT\`) - Build successful" >> "$GITHUB_STEP_SUMMARY"
298- else
299- echo >> "$GITHUB_STEP_SUMMARY"
300- echo "<details><summary> :warning: <a href=\"$JOB_URL\">$BOARD</a> (<tt>$VARIANT</tt>) - $WARNINGS warnings:</summary>" >> "$GITHUB_STEP_SUMMARY"
301- echo >> "$GITHUB_STEP_SUMMARY"
302- echo "\`\`\`" >> "$GITHUB_STEP_SUMMARY"
303- echo $REPORT | jq -cr '.warnings_log[]' >> "$GITHUB_STEP_SUMMARY"
304- echo "\`\`\`" >> "$GITHUB_STEP_SUMMARY"
305- echo >> "$GITHUB_STEP_SUMMARY"
306- echo "</details>" >> "$GITHUB_STEP_SUMMARY"
307- echo >> "$GITHUB_STEP_SUMMARY"
308- fi
309- fi
310- fi
311- done
312- done
296+ - run : extra/ci_collect_logs.py > $GITHUB_STEP_SUMMARY
313297
314298 - name : Clean up intermediate artifacts
315299@@ -323,7 +307,7 @@ jobs:
323307 needs :
324308 - build-env
325309 - package-core
326- - test-core
310+ - collect-logs
327311 steps :
328312 - name : Notify failure
329313 run : exit 1
@@ -335,7 +319,7 @@ jobs:
335319 needs :
336320 - build-env
337321 - package-core
338- - test-core
322+ - collect-logs
339323 environment : production
340324 permissions :
341325 id-token : write
@@ -365,7 +349,7 @@ jobs:
365349 needs :
366350 - build-env
367351 - package-core
368- - test-core
352+ - collect-logs
369353 env :
370354 CORE_TAG : ${{ needs.build-env.outputs.CORE_TAG }}
371355 CORE_HASH : ${{ needs.build-env.outputs.CORE_HASH }}
0 commit comments