Skip to content

Commit 9278f81

Browse files
committed
Revert "Fix regression: report size delta size on PR. (#429)"
This partially reverts commit 836771a. The repository infrastructure uses the "arduino/report-size-deltas" action to generate a report of the changes in memory usage of the example sketches that would result from merging a pull request. There are two use patterns for the "arduino/report-size-deltas" action: * Run from a workflow triggered by a `schedule` event. * Run from the same workflow as the "arduino/compile-sketches" action when triggered by a `pull_request` event. The latter use pattern is only suitable for private repositories. The reason is that, when a pull request is submitted from a fork, the permissions of the access token used by the "arduino/report-size-deltas" action are downgraded to read-only in workflows triggered by a `pull_request` event, which means it is unable to make the report comment. The reverted commit migrated the size deltas report infrastructure from the first use pattern to the second, which caused the "Compile Examples" workflow runs to fail on pull requests submitted from forks: Error: HTTPError: HTTP Error 403: Forbidden For this reason, the infrastructure must be reverted back to using the first use pattern.
1 parent 836771a commit 9278f81

File tree

2 files changed

+16
-24
lines changed

2 files changed

+16
-24
lines changed

.github/workflows/compile-examples.yml

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,8 @@ 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-
1915
jobs:
20-
compile:
16+
build:
2117
runs-on: ubuntu-latest
2218

2319
env:
@@ -35,6 +31,7 @@ jobs:
3531
- examples/ArduinoIoTCloud-Callbacks
3632
- examples/ArduinoIoTCloud-Schedule
3733
- examples/utility/ArduinoIoTCloud_Travis_CI
34+
SKETCHES_REPORTS_PATH: sketches-reports
3835

3936
strategy:
4037
fail-fast: false
@@ -295,28 +292,9 @@ jobs:
295292
google-key-file: ${{ secrets.GOOGLE_KEY_FILE }}
296293
spreadsheet-id: 1I6NZkpZpf8KugBkE92adB1Z3_b7ZepOpCdYTOigJpN4
297294

298-
# This step is needed to pass the size data to the report job.
299295
- name: Save memory usage change report as artifact
300296
if: github.event_name == 'pull_request'
301297
uses: actions/upload-artifact@v4
302298
with:
303299
name: sketches-report-${{ matrix.board.artifact-name-suffix }}
304300
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 }}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
on:
2+
schedule:
3+
- cron: '*/5 * * * *'
4+
5+
jobs:
6+
report:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Comment size deltas reports to PRs
11+
uses: arduino/report-size-deltas@v1
12+
with:
13+
# The name of the workflow artifact created by the "Compile Examples" workflow
14+
sketches-reports-source: sketches-reports

0 commit comments

Comments
 (0)