From 8ec54cabcfb0ff8b4e98bdf974592a52152bb6bb Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 11 Mar 2025 01:37:16 -0700 Subject: [PATCH] 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. --- .github/workflows/compile-examples.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 274e2ba..720e13b 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -23,7 +23,6 @@ on: env: SKETCHES_REPORTS_PATH: sketches-reports - SKETCHES_REPORTS_ARTIFACT_NAME: sketches-reports jobs: build: @@ -39,14 +38,23 @@ jobs: matrix: board: - fqbn: arduino:mbed_portenta:envie_m7 + artifact-name-suffix: arduino-mbed_portenta-envie_m7 - fqbn: arduino:mbed_nano:nanorp2040connect + artifact-name-suffix: arduino-mbed__nano-nanorp2040connect - fqbn: arduino:mbed_nicla:nicla_vision + artifact-name-suffix: arduino-mbed_nicla-nicla_vision - fqbn: arduino:mbed_nicla:nicla_sense + artifact-name-suffix: arduino-mbed_nicla-nicla_sense - fqbn: arduino:mbed_nano:nano33ble + artifact-name-suffix: arduino-mbed_nano-nano33ble - fqbn: arduino:renesas_portenta:portenta_c33 + artifact-name-suffix: arduino-renesas_portenta-portenta_c33 - fqbn: arduino:renesas_uno:unor4wifi + artifact-name-suffix: arduino-renesas_uno-unor4wifi - fqbn: arduino:samd:mkrwifi1010 + artifact-name-suffix: arduino-samd-mkrwifi1010 - fqbn: arduino:esp32:nano_nora + artifact-name-suffix: arduino-esp32-nano_nora steps: - name: Checkout repository @@ -66,7 +74,7 @@ jobs: with: if-no-files-found: error path: ${{ env.SKETCHES_REPORTS_PATH }} - name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }} + name: sketches-report-${{ matrix.board.artifact-name-suffix }} report-size-deltas: needs: build @@ -82,7 +90,6 @@ jobs: continue-on-error: true # If compilation failed for all boards then there are no artifacts uses: actions/download-artifact@v4 with: - name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }} path: ${{ env.SKETCHES_REPORTS_PATH }} - name: Comment size deltas report to PR @@ -90,4 +97,4 @@ jobs: # If actions/download-artifact failed, there are no artifacts to report from. if: steps.download-artifact.outcome == 'success' with: - sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }} \ No newline at end of file + sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}