Skip to content

Commit b26acea

Browse files
authored
Fix regression: report size delta size on PR. (#63)
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 66f991a commit b26acea

File tree

3 files changed

+24
-25
lines changed

3 files changed

+24
-25
lines changed

.github/workflows/compile-examples.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ on:
2020
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#repository_dispatch
2121
repository_dispatch:
2222

23+
env:
24+
# It's convenient to set variables for values used multiple times in the workflow.
25+
SKETCHES_REPORTS_PATH: sketches-reports
26+
2327
jobs:
24-
build:
28+
compile:
2529
runs-on: ubuntu-latest
2630

27-
env:
28-
SKETCHES_REPORTS_PATH: sketches-reports
29-
3031
strategy:
3132
fail-fast: false
3233

@@ -83,3 +84,21 @@ jobs:
8384
with:
8485
name: sketches-report-${{ matrix.board.artifact-name-suffix }}
8586
path: ${{ env.SKETCHES_REPORTS_PATH }}
87+
88+
# When using a matrix to compile for multiple boards, it's necessary to use a separate job for the deltas report
89+
report:
90+
needs: compile # Wait for the compile job to finish to get the data for the report
91+
if: github.event_name == 'pull_request' # Only run the job when the workflow is triggered by a pull request
92+
runs-on: ubuntu-latest
93+
94+
steps:
95+
# This step is needed to get the size data produced by the compile jobs
96+
- name: Download sketches reports artifacts
97+
uses: actions/download-artifact@v4
98+
with:
99+
# All workflow artifacts will be downloaded to this location.
100+
path: ${{ env.SKETCHES_REPORTS_PATH }}
101+
102+
- uses: arduino/report-size-deltas@v1
103+
with:
104+
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}

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

Lines changed: 0 additions & 21 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea/

0 commit comments

Comments
 (0)