Skip to content

Commit 8693c9c

Browse files
committed
Don't upload multiple times to same artifact in sketch compilation workflow
The "Compile Examples" GitHub Actions workflow is configured to compile the example sketches for each of the supported boards. This is done by using a job matrix in the GitHub Actions workflow to generate a parallel job for each board. A GitHub Actions workflow artifact is used to transfer the sketches report files generated by the "arduino/compile-sketches" action between this workflow's job and the "Report Size Deltas" workflow that uses the "arduino/report-size-deltas" action to publish the data. The "actions/upload-artifact" action is used to upload the sketches report files to the workflow artifact. Previously, the sketches reports from all the boards were uploaded to a single artifact. However, support for uploading multiple times to a single artifact was dropped in version 4.0.0 of the "actions/upload-artifact" action. So it is now necessary for each of the jobs to use a separate artifact. The "arduino/report-size-deltas" action is configured to recognize these multiple artifacts by a regular expression that matches against a standardized prefix on the artifact names.
1 parent 1cb7979 commit 8693c9c

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

.github/workflows/compile-examples.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -36,28 +36,40 @@ jobs:
3636
matrix:
3737
board:
3838
- fqbn: "arduino:samd:mkr1000"
39+
artifact-name-suffix: arduino-samd-mkr1000
3940
platform-name: arduino:samd
4041
- fqbn: "arduino:samd:mkrwifi1010"
42+
artifact-name-suffix: arduino-samd-mkrwifi1010
4143
platform-name: arduino:samd
4244
- fqbn: "arduino:samd:nano_33_iot"
45+
artifact-name-suffix: arduino-samd-nano_33_iot
4346
platform-name: arduino:samd
4447
- fqbn: "arduino:samd:mkrgsm1400"
48+
artifact-name-suffix: arduino-samd-mkrgsm1400
4549
platform-name: arduino:samd
4650
- fqbn: "arduino:samd:mkrnb1500"
51+
artifact-name-suffix: arduino-samd-mkrnb1500
4752
platform-name: arduino:samd
4853
- fqbn: "arduino:mbed_portenta:envie_m7"
54+
artifact-name-suffix: arduino-mbed_portenta-envie_m7
4955
platform-name: arduino:mbed_portenta
5056
- fqbn: arduino:mbed_nano:nanorp2040connect
57+
artifact-name-suffix: arduino-mbed_nano-nanorp2040connect
5158
platform-name: arduino:mbed_nano
5259
- fqbn: arduino:mbed_nicla:nicla_vision
60+
artifact-name-suffix: arduino-mbed_nicla-nicla_vision
5361
platform-name: arduino:mbed_nicla
5462
- fqbn: arduino:mbed_opta:opta
63+
artifact-name-suffix: arduino-mbed_opta-opta
5564
platform-name: arduino:mbed_opta
5665
- fqbn: arduino:mbed_giga:giga
66+
artifact-name-suffix: arduino-mbed_giga-giga
5767
platform-name: arduino:mbed_giga
5868
- fqbn: arduino:renesas_portenta:portenta_c33
69+
artifact-name-suffix: arduino-renesas_portenta-portenta_c33
5970
platform-name: arduino:renesas_portenta
6071
- fqbn: arduino:renesas_uno:unor4wifi
72+
artifact-name-suffix: arduino-renesas_uno-unor4wifi
6173
platform-name: arduino:renesas_uno
6274

6375
include:
@@ -136,6 +148,6 @@ jobs:
136148
- name: Save memory usage change report as artifact
137149
uses: actions/upload-artifact@v4
138150
with:
139-
name: ${{ env.SKETCHES_REPORTS_PATH }}
151+
name: sketches-report-${{ matrix.board.artifact-name-suffix }}
140152
if-no-files-found: error
141153
path: ${{ env.SKETCHES_REPORTS_PATH }}

.github/workflows/report-size-deltas.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ jobs:
2020
- name: Comment size deltas reports to PRs
2121
uses: arduino/report-size-deltas@v1
2222
with:
23-
# The name of the workflow artifact created by the "Compile Examples" workflow
24-
sketches-reports-source: sketches-reports
23+
# Regex matching the names of the workflow artifacts created by the "Compile Examples" workflow
24+
sketches-reports-source: ^sketches-report-.+

0 commit comments

Comments
 (0)