Skip to content

Commit 836771a

Browse files
authored
Fix regression: report size delta size on PR. (#429)
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 836771a

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed

.github/workflows/compile-examples.yml

+24-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ on:
1212
- "examples/**"
1313
- "src/**"
1414

15+
env:
16+
# It's convenient to set variables for values used multiple times in the workflow.
17+
SKETCHES_REPORTS_PATH: sketches-reports
18+
1519
jobs:
16-
build:
20+
compile:
1721
runs-on: ubuntu-latest
1822

1923
env:
@@ -31,7 +35,6 @@ jobs:
3135
- examples/ArduinoIoTCloud-Callbacks
3236
- examples/ArduinoIoTCloud-Schedule
3337
- examples/utility/ArduinoIoTCloud_Travis_CI
34-
SKETCHES_REPORTS_PATH: sketches-reports
3538
3639
strategy:
3740
fail-fast: false
@@ -292,9 +295,28 @@ jobs:
292295
google-key-file: ${{ secrets.GOOGLE_KEY_FILE }}
293296
spreadsheet-id: 1I6NZkpZpf8KugBkE92adB1Z3_b7ZepOpCdYTOigJpN4
294297

298+
# This step is needed to pass the size data to the report job.
295299
- name: Save memory usage change report as artifact
296300
if: github.event_name == 'pull_request'
297301
uses: actions/upload-artifact@v4
298302
with:
299303
name: sketches-report-${{ matrix.board.artifact-name-suffix }}
300304
path: ${{ env.SKETCHES_REPORTS_PATH }}
305+
306+
# When using a matrix to compile for multiple boards, it's necessary to use a separate job for the deltas report
307+
report:
308+
needs: compile # Wait for the compile job to finish to get the data for the report
309+
if: github.event_name == 'pull_request' # Only run the job when the workflow is triggered by a pull request
310+
runs-on: ubuntu-latest
311+
312+
steps:
313+
# This step is needed to get the size data produced by the compile jobs
314+
- name: Download sketches reports artifacts
315+
uses: actions/download-artifact@v4
316+
with:
317+
# All workflow artifacts will be downloaded to this location.
318+
path: ${{ env.SKETCHES_REPORTS_PATH }}
319+
320+
- uses: arduino/report-size-deltas@v1
321+
with:
322+
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)