Skip to content

Commit 0d01a96

Browse files
committed
Fix regression: report size delta size on PR.
The necessary steps have in fact been documented here: https://github.com/arduino/report-size-deltas/blob/main/docs/FAQ.md#workflow-triggered-by-pull_request-event but I have overlooked them when I fixed the upload issue. With this PR the size deltas are - once again - reported within the PR.
1 parent c2a9992 commit 0d01a96

File tree

3 files changed

+21
-24
lines changed

3 files changed

+21
-24
lines changed

.github/workflows/compile-examples.yml

+20-10
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
- "src/**"
1414

1515
jobs:
16-
build:
16+
compile:
1717
runs-on: ubuntu-latest
1818

1919
env:
@@ -283,18 +283,28 @@ jobs:
283283
enable-deltas-report: "true"
284284
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
285285

286-
- name: Write data to size trends report spreadsheet
287-
# Update report on every push to the master branch
288-
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
289-
uses: arduino/report-size-trends@main
290-
with:
291-
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
292-
google-key-file: ${{ secrets.GOOGLE_KEY_FILE }}
293-
spreadsheet-id: 1I6NZkpZpf8KugBkE92adB1Z3_b7ZepOpCdYTOigJpN4
294-
286+
# This step is needed to pass the size data to the report job.
295287
- name: Save memory usage change report as artifact
296288
if: github.event_name == 'pull_request'
297289
uses: actions/upload-artifact@v4
298290
with:
299291
name: sketches-report-${{ matrix.board.artifact-name-suffix }}
300292
path: ${{ env.SKETCHES_REPORTS_PATH }}
293+
294+
# When using a matrix to compile for multiple boards, it's necessary to use a separate job for the deltas report
295+
report:
296+
needs: compile # Wait for the compile job to finish to get the data for the report
297+
if: github.event_name == 'pull_request' # Only run the job when the workflow is triggered by a pull request
298+
runs-on: ubuntu-latest
299+
300+
steps:
301+
# This step is needed to get the size data produced by the compile jobs
302+
- name: Download sketches reports artifacts
303+
uses: actions/download-artifact@v4
304+
with:
305+
# All workflow artifacts will be downloaded to this location.
306+
path: ${{ env.SKETCHES_REPORTS_PATH }}
307+
308+
- uses: arduino/report-size-deltas@v1
309+
with:
310+
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}

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

-14
This file was deleted.

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
*.orig
66
.vs
77
build
8+
.idea/

0 commit comments

Comments
 (0)