Skip to content

Commit 30c000b

Browse files
committed
Use the Compile Examples workflow for the deltas report
Using a scheduled workflow for the size deltas report is not appropriate in private repositories because it uses a lot of minutes and, unlike public repositories, private repositories have a limited allotment of free GitHub Actions minutes. The `report-size-deltas` job is configured for use in private repositories which don't have the "Send write tokens to workflows from fork pull requests" setting enabled. This means that PRs submitted from forks won't get size deltas reports. If reports on PRs from forks are wanted, the repository can be configured to provide them with write tokens and the workflow adjusted so the job will run on PRs from forks Once the repository is made public, the workflow should be reconfigured to provide size deltas reports on PRs from forks. More information: https://github.com/arduino/report-size-deltas#sketches-reports-source
1 parent 9aab1ae commit 30c000b

File tree

2 files changed

+24
-15
lines changed

2 files changed

+24
-15
lines changed

.github/workflows/compile-examples.yml

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

15+
env:
16+
SKETCHES_REPORTS_PATH: sketches-reports
17+
SKETCHES_REPORTS_ARTIFACT_NAME: sketches-reports
18+
1519
jobs:
1620
compile-test:
1721
runs-on: ubuntu-latest
@@ -87,11 +91,29 @@ jobs:
8791
sketch-paths: |
8892
${{ env.UNIVERSAL_SKETCH_PATHS }}
8993
enable-deltas-report: 'true'
94+
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
95+
github-token: ${{ secrets.GITHUB_TOKEN }}
9096
verbose: 'true'
9197

9298
- name: Save memory usage change report as artifact
9399
if: github.event_name == 'pull_request'
94100
uses: actions/upload-artifact@v2
95101
with:
96-
name: 'size-deltas-reports'
97-
path: 'size-deltas-reports'
102+
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
103+
path: ${{ env.SKETCHES_REPORTS_PATH }}
104+
105+
report-size-deltas:
106+
needs: compile-test
107+
# Only run the job when the workflow is triggered by a pull request from this repository (because arduino/report-size-deltas requires write permissions)
108+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
109+
runs-on: ubuntu-latest
110+
steps:
111+
- name: Download sketches reports artifact
112+
uses: actions/download-artifact@v2
113+
with:
114+
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
115+
path: ${{ env.SKETCHES_REPORTS_PATH }}
116+
117+
- uses: arduino/report-size-deltas@main
118+
with:
119+
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}

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

-13
This file was deleted.

0 commit comments

Comments
 (0)