Skip to content

Commit cf2c1a6

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 6dec3e8 commit cf2c1a6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.github/workflows/compile-examples.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ jobs:
5757
board:
5858
- fqbn: arduino:mbed_portenta:envie_m7
5959
platform-name: arduino:mbed_portenta
60+
artifact-name-suffix: arduino-mbed_portenta-envie_m7
6061
- fqbn: arduino:mbed_giga:giga
6162
platform-name: arduino:mbed_giga
63+
artifact-name-suffix: arduino-mbed_giga-giga
6264

6365
include:
6466
- board:
@@ -99,6 +101,6 @@ jobs:
99101
- name: Save memory usage change report as artifact
100102
uses: actions/upload-artifact@v4
101103
with:
102-
name: ${{ env.SKETCHES_REPORTS_PATH }}
104+
name: sketches-report-${{ matrix.board.artifact-name-suffix }}
103105
if-no-files-found: error
104106
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)