Skip to content

Commit 8d5f053

Browse files
committed
Fix regression re report-size-deltas after updating actions/upload-artifact.
For more information see https://github.com/arduino/report-size-deltas/blob/main/docs/FAQ.md#workflow-triggered-by-pull_request-event .
1 parent 41c33b9 commit 8d5f053

File tree

2 files changed

+20
-26
lines changed

2 files changed

+20
-26
lines changed

.github/workflows/compile-examples.yml

+20-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919
repository_dispatch:
2020

2121
jobs:
22-
build:
22+
compile:
2323
name: ${{ matrix.board.fqbn }}
2424
runs-on: ubuntu-latest
2525

@@ -95,9 +95,27 @@ jobs:
9595
enable-deltas-report: true
9696
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
9797

98-
- name: Save sketches report as workflow artifact
98+
- name: Upload sketches report to workflow artifact
9999
uses: actions/upload-artifact@v4
100100
with:
101101
if-no-files-found: error
102102
path: ${{ env.SKETCHES_REPORTS_PATH }}
103103
name: sketches-report-${{ matrix.board.artifact-name-suffix }}
104+
105+
# When using a matrix to compile for multiple boards, it's necessary to use a separate job for the deltas report
106+
report:
107+
needs: compile # Wait for the compile job to finish to get the data for the report
108+
if: github.event_name == 'pull_request' # Only run the job when the workflow is triggered by a pull request
109+
runs-on: ubuntu-latest
110+
111+
steps:
112+
# This step is needed to get the size data produced by the compile jobs
113+
- name: Download sketches reports artifacts
114+
uses: actions/download-artifact@v4
115+
with:
116+
# All workflow artifacts will be downloaded to this location.
117+
path: ${{ env.SKETCHES_REPORTS_PATH }}
118+
119+
- uses: arduino/report-size-deltas@v1
120+
with:
121+
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}

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

-24
This file was deleted.

0 commit comments

Comments
 (0)