Skip to content

Commit 7a6b39a

Browse files
authored
Fix regression: report size delta size on PR. (#172)
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 9625575 commit 7a6b39a

File tree

3 files changed

+24
-28
lines changed

3 files changed

+24
-28
lines changed

Diff for: .github/workflows/compile-examples.yml

+23-4
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ on:
1818
workflow_dispatch:
1919
repository_dispatch:
2020

21+
env:
22+
# It's convenient to set variables for values used multiple times in the workflow.
23+
SKETCHES_REPORTS_PATH: sketches-reports
24+
2125
jobs:
22-
build:
26+
compile:
2327
name: ${{ matrix.board.fqbn }}
2428
runs-on: ubuntu-latest
2529

26-
env:
27-
SKETCHES_REPORTS_PATH: sketches-reports
28-
2930
strategy:
3031
fail-fast: false
3132

@@ -61,3 +62,21 @@ jobs:
6162
if-no-files-found: error
6263
path: ${{ env.SKETCHES_REPORTS_PATH }}
6364
name: sketches-report-${{ matrix.board.artifact-name-suffix }}
65+
66+
# When using a matrix to compile for multiple boards, it's necessary to use a separate job for the deltas report
67+
report:
68+
needs: compile # Wait for the compile job to finish to get the data for the report
69+
if: github.event_name == 'pull_request' # Only run the job when the workflow is triggered by a pull request
70+
runs-on: ubuntu-latest
71+
72+
steps:
73+
# This step is needed to get the size data produced by the compile jobs
74+
- name: Download sketches reports artifacts
75+
uses: actions/download-artifact@v4
76+
with:
77+
# All workflow artifacts will be downloaded to this location.
78+
path: ${{ env.SKETCHES_REPORTS_PATH }}
79+
80+
- uses: arduino/report-size-deltas@v1
81+
with:
82+
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}

Diff for: .github/workflows/report-size-deltas.yml

-24
This file was deleted.

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ examples/node_test_server/node_modules/
33
*.DS_Store
44
*/.DS_Store
55
examples/.DS_Store
6+
.idea/

0 commit comments

Comments
 (0)