Skip to content

Commit a27655e

Browse files
authored
Fix regression: report size delta size on PR. (#83)
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 938ec7d commit a27655e

File tree

3 files changed

+24
-27
lines changed

3 files changed

+24
-27
lines changed

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

+23-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ on:
2020
workflow_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
name: ${{ matrix.board.fqbn }}
2630
runs-on: ubuntu-latest
2731

@@ -35,7 +39,6 @@ jobs:
3539
UNIVERSAL_SKETCH_PATHS: |
3640
- examples/SHA1
3741
- examples/SHA256
38-
SKETCHES_REPORTS_PATH: sketches-reports
3942
4043
strategy:
4144
fail-fast: false
@@ -95,3 +98,21 @@ jobs:
9598
if-no-files-found: error
9699
path: ${{ env.SKETCHES_REPORTS_PATH }}
97100
name: sketches-report-${{ matrix.board.artifact-name-suffix }}
101+
102+
# When using a matrix to compile for multiple boards, it's necessary to use a separate job for the deltas report
103+
report:
104+
needs: compile # Wait for the compile job to finish to get the data for the report
105+
if: github.event_name == 'pull_request' # Only run the job when the workflow is triggered by a pull request
106+
runs-on: ubuntu-latest
107+
108+
steps:
109+
# This step is needed to get the size data produced by the compile jobs
110+
- name: Download sketches reports artifacts
111+
uses: actions/download-artifact@v4
112+
with:
113+
# All workflow artifacts will be downloaded to this location.
114+
path: ${{ env.SKETCHES_REPORTS_PATH }}
115+
116+
- uses: arduino/report-size-deltas@v1
117+
with:
118+
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}

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

-25
This file was deleted.

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea/

0 commit comments

Comments
 (0)