Skip to content

Commit

Permalink
Fix regression: report size delta size on PR.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aentinger committed Feb 21, 2024
1 parent c2a9992 commit 0d01a96
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 24 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/compile-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- "src/**"

jobs:
build:
compile:
runs-on: ubuntu-latest

env:
Expand Down Expand Up @@ -283,18 +283,28 @@ jobs:
enable-deltas-report: "true"
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}

- name: Write data to size trends report spreadsheet
# Update report on every push to the master branch
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: arduino/report-size-trends@main
with:
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
google-key-file: ${{ secrets.GOOGLE_KEY_FILE }}
spreadsheet-id: 1I6NZkpZpf8KugBkE92adB1Z3_b7ZepOpCdYTOigJpN4

# This step is needed to pass the size data to the report job.
- name: Save memory usage change report as artifact
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: sketches-report-${{ matrix.board.artifact-name-suffix }}
path: ${{ env.SKETCHES_REPORTS_PATH }}

# When using a matrix to compile for multiple boards, it's necessary to use a separate job for the deltas report
report:
needs: compile # Wait for the compile job to finish to get the data for the report
if: github.event_name == 'pull_request' # Only run the job when the workflow is triggered by a pull request
runs-on: ubuntu-latest

steps:
# This step is needed to get the size data produced by the compile jobs
- name: Download sketches reports artifacts
uses: actions/download-artifact@v4
with:
# All workflow artifacts will be downloaded to this location.
path: ${{ env.SKETCHES_REPORTS_PATH }}

- uses: arduino/report-size-deltas@v1
with:
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}
14 changes: 0 additions & 14 deletions .github/workflows/report-size-deltas.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
*.orig
.vs
build
.idea/

0 comments on commit 0d01a96

Please sign in to comment.