Skip to content

Commit 8ec54ca

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 the compilation job and the "report-size-deltas" job 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. These multiple artifacts are downloaded in aggregate in the "report-size-deltas" job by the "actions/download-artifact" action, which downloads all artifacts by default.
1 parent 5423dc9 commit 8ec54ca

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.github/workflows/compile-examples.yml

+11-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ on:
2323

2424
env:
2525
SKETCHES_REPORTS_PATH: sketches-reports
26-
SKETCHES_REPORTS_ARTIFACT_NAME: sketches-reports
2726

2827
jobs:
2928
build:
@@ -39,14 +38,23 @@ jobs:
3938
matrix:
4039
board:
4140
- fqbn: arduino:mbed_portenta:envie_m7
41+
artifact-name-suffix: arduino-mbed_portenta-envie_m7
4242
- fqbn: arduino:mbed_nano:nanorp2040connect
43+
artifact-name-suffix: arduino-mbed__nano-nanorp2040connect
4344
- fqbn: arduino:mbed_nicla:nicla_vision
45+
artifact-name-suffix: arduino-mbed_nicla-nicla_vision
4446
- fqbn: arduino:mbed_nicla:nicla_sense
47+
artifact-name-suffix: arduino-mbed_nicla-nicla_sense
4548
- fqbn: arduino:mbed_nano:nano33ble
49+
artifact-name-suffix: arduino-mbed_nano-nano33ble
4650
- fqbn: arduino:renesas_portenta:portenta_c33
51+
artifact-name-suffix: arduino-renesas_portenta-portenta_c33
4752
- fqbn: arduino:renesas_uno:unor4wifi
53+
artifact-name-suffix: arduino-renesas_uno-unor4wifi
4854
- fqbn: arduino:samd:mkrwifi1010
55+
artifact-name-suffix: arduino-samd-mkrwifi1010
4956
- fqbn: arduino:esp32:nano_nora
57+
artifact-name-suffix: arduino-esp32-nano_nora
5058

5159
steps:
5260
- name: Checkout repository
@@ -66,7 +74,7 @@ jobs:
6674
with:
6775
if-no-files-found: error
6876
path: ${{ env.SKETCHES_REPORTS_PATH }}
69-
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
77+
name: sketches-report-${{ matrix.board.artifact-name-suffix }}
7078

7179
report-size-deltas:
7280
needs: build
@@ -82,12 +90,11 @@ jobs:
8290
continue-on-error: true # If compilation failed for all boards then there are no artifacts
8391
uses: actions/download-artifact@v4
8492
with:
85-
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
8693
path: ${{ env.SKETCHES_REPORTS_PATH }}
8794

8895
- name: Comment size deltas report to PR
8996
uses: arduino/report-size-deltas@v1
9097
# If actions/download-artifact failed, there are no artifacts to report from.
9198
if: steps.download-artifact.outcome == 'success'
9299
with:
93-
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}
100+
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}

0 commit comments

Comments
 (0)