Skip to content

Commit 064a2fc

Browse files
committed
rev3
1 parent 5a55b11 commit 064a2fc

File tree

24 files changed

+498
-54
lines changed

24 files changed

+498
-54
lines changed

.github/workflows/package_core.yml

Lines changed: 31 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -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,34 @@ 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/
218+
# sets ALL_TESTS and ALL_LIBRARIES env vars
219+
extra/ci_test_list.sh ${{ matrix.artifact }} ${{ matrix.variant }} Blink
211220
212-
- name: Compile Blink for ${{ matrix.board }}
213-
uses: pillo79/compile-sketches@main
221+
- name: Compile tests for ${{ matrix.board }}
222+
uses: pillo79/compile-sketches@next
214223
with:
215224
fqbn: ${{ env.FQBN }}
216225
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"
226+
# Use Board Manager version first, to install the toolchain
227+
- name: ${{ env.PLAT }}
220228
- name: ${{ env.PLAT }}
221229
source-path: "ArduinoCore-zephyr"
222-
sketch-paths: Blink
230+
sketch-paths: |
231+
${{ env.ALL_TESTS }}
232+
libraries: |
233+
${{ env.ALL_LIBRARIES }}
223234
cli-compile-flags: |
224235
- '--build-property'
225236
- 'compiler.c.extra_flags=-Wno-type-limits -Wno-missing-field-initializers'
226237
- '--build-property'
227238
- 'compiler.cpp.extra_flags=-Wno-type-limits -Wno-missing-field-initializers'
228239
verbose: 'false'
229240
enable-deltas-report: 'false'
230-
enable-warnings-report: 'true'
231-
enable-warnings-log: 'true'
241+
enable-issues-report: 'true'
232242

233243
- name: Get job ID
234244
id: job_id
@@ -247,8 +257,9 @@ jobs:
247257
- name: Prepare log
248258
if: ${{ success() || failure() }}
249259
run: |
260+
[ ! -f sketches-reports/${REPORT_FILE} ] && mkdir -p sketches-reports && echo "{}" > sketches-reports/${REPORT_FILE}
250261
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/
262+
cat sketches-reports/${REPORT_FILE} | jq -cr ". += { job_id: ${{ steps.job_id.outputs.result }} }" > ${REPORT_FILE} && mv ${REPORT_FILE} sketches-reports/
252263
253264
- uses: actions/upload-artifact@v4
254265
if: ${{ success() || failure() }}
@@ -267,49 +278,18 @@ jobs:
267278
env:
268279
ALL_BOARD_DATA: ${{ needs.build-env.outputs.ALL_BOARD_DATA }}
269280
steps:
281+
- uses: actions/checkout@v4
282+
with:
283+
fetch-depth: 0
284+
persist-credentials: false
285+
270286
- uses: actions/download-artifact@v4
271287
with:
272288
path: .
273289
pattern: test-report-*
274290
merge-multiple: true
275291

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>&nbsp;&nbsp; :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
292+
- run: extra/ci_collect_logs.py > $GITHUB_STEP_SUMMARY
313293

314294
- name: Clean up intermediate artifacts
315295
uses: geekyeggo/[email protected]
@@ -323,7 +303,7 @@ jobs:
323303
needs:
324304
- build-env
325305
- package-core
326-
- test-core
306+
- collect-logs
327307
steps:
328308
- name: Notify failure
329309
run: exit 1
@@ -335,7 +315,7 @@ jobs:
335315
needs:
336316
- build-env
337317
- package-core
338-
- test-core
318+
- collect-logs
339319
environment: production
340320
permissions:
341321
id-token: write
@@ -365,7 +345,7 @@ jobs:
365345
needs:
366346
- build-env
367347
- package-core
368-
- test-core
348+
- collect-logs
369349
env:
370350
CORE_TAG: ${{ needs.build-env.outputs.CORE_TAG }}
371351
CORE_HASH: ${{ needs.build-env.outputs.CORE_HASH }}

extra/artifacts/zephyr_contrib.exc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
libraries/Camera/
2+
libraries/Storage/
3+
libraries/Zephyr_SDRAM/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
# wget -nv $(curl -s https://api.github.com/repos/arduino-libraries/ArduinoBLE/releases/latest | jq -r '.tarball_url') -O ArduinoBLE.tar.gz
4+
# tar zxf ArduinoBLE.tar.gz && mv arduino-libraries-ArduinoBLE* ArduinoCore-zephyr/libraries/ArduinoBLE
5+
wget -nv https://github.com/arduino-libraries/ArduinoBLE/archive/refs/heads/master.tar.gz
6+
tar zxf master.tar.gz && mv ArduinoBLE-master ArduinoCore-zephyr/libraries/ArduinoBLE

extra/artifacts/zephyr_unoq.exc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
libraries/Camera/
2+
libraries/Ethernet/
3+
libraries/Storage/
4+
libraries/WiFi/
5+
libraries/Zephyr_SDRAM/

extra/artifacts/zephyr_unoq.only

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
libraries/Arduino_LED_Matrix/
2+
libraries/Arduino_RouterBridge/
3+
libraries/Arduino_RPClite/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
# wget -nv $(curl -s https://api.github.com/repos/arduino-libraries/ArduinoBLE/releases/latest | jq -r '.tarball_url') -O ArduinoBLE.tar.gz
4+
# tar zxf ArduinoBLE.tar.gz && mv arduino-libraries-ArduinoBLE* ArduinoCore-zephyr/libraries/ArduinoBLE
5+
wget -nv https://github.com/arduino-libraries/ArduinoBLE/archive/refs/heads/master.tar.gz
6+
tar zxf master.tar.gz && mv ArduinoBLE-master ArduinoCore-zephyr/libraries/ArduinoBLE

0 commit comments

Comments
 (0)