Skip to content

Commit 4a85fec

Browse files
authored
CI: Add arduino/report-size-deltas action. (#354)
This action comments on the pull request with a report on the resulting change in memory usage of the Arduino sketches compiled by the arduino/compile-sketches action.
1 parent d965fa2 commit 4a85fec

File tree

2 files changed

+94
-13
lines changed

2 files changed

+94
-13
lines changed

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

+70-13
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,86 @@
11
name: Compile Examples
2+
3+
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
24
on:
3-
- push
4-
- pull_request
5+
push:
6+
paths:
7+
- ".github/workflows/compile-examples.yml"
8+
- "examples/**"
9+
- "src/**"
10+
pull_request:
11+
paths:
12+
- ".github/workflows/compile-examples.yml"
13+
- "examples/**"
14+
- "src/**"
15+
schedule:
16+
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms).
17+
- cron: "0 8 * * TUE"
18+
workflow_dispatch:
19+
repository_dispatch:
520

621
jobs:
722
build:
23+
name: ${{ matrix.board.fqbn }}
824
runs-on: ubuntu-latest
925

26+
env:
27+
SKETCHES_REPORTS_PATH: sketches-reports
28+
1029
strategy:
30+
fail-fast: false
31+
1132
matrix:
12-
fqbn:
13-
- arduino:samd:mkrwifi1010
14-
- arduino:samd:nano_33_iot
15-
- arduino:megaavr:uno2018:mode=on
16-
- arduino:mbed:nano33ble
17-
- arduino:mbed_nano:nanorp2040connect
18-
- arduino:renesas_uno:unor4wifi
33+
board:
34+
- fqbn: arduino:samd:mkrwifi1010
35+
platforms: |
36+
- name: arduino:samd
37+
artifact-name-suffix: arduino-samd-mkrwifi1010
38+
- fqbn: arduino:samd:nano_33_iot
39+
platforms: |
40+
- name: arduino:samd
41+
artifact-name-suffix: arduino-samd-nano_33_iot
42+
- fqbn: arduino:megaavr:uno2018:mode=on
43+
platforms: |
44+
- name: arduino:megaavr
45+
artifact-name-suffix: arduino-megaavr-uno2018
46+
- fqbn: arduino:mbed_nano:nano33ble
47+
platforms: |
48+
- name: arduino:mbed_nano
49+
artifact-name-suffix: arduino-mbed_nano-nano33ble
50+
- fqbn: arduino:mbed_nano:nanorp2040connect
51+
platforms: |
52+
- name: arduino:mbed_nano
53+
artifact-name-suffix: arduino-mbed_nano-nanorp2040connect
54+
- fqbn: arduino:renesas_uno:unor4wifi
55+
platforms: |
56+
- name: arduino:renesas_uno
57+
artifact-name-suffix: arduino-renesas_uno-unor4wifi
1958

2059
steps:
21-
- uses: actions/checkout@v4
22-
- uses: arduino/compile-sketches@v1
60+
- name: Checkout repository
61+
uses: actions/checkout@v4
62+
63+
- name: Compile examples
64+
uses: arduino/compile-sketches@v1
2365
with:
2466
github-token: ${{ secrets.GITHUB_TOKEN }}
25-
fqbn: ${{ matrix.fqbn }}
26-
67+
fqbn: ${{ matrix.board.fqbn }}
68+
platforms: ${{ matrix.board.platforms }}
69+
libraries: |
70+
# Install the library from the local path.
71+
- source-path: ./
72+
sketch-paths: |
73+
- examples
74+
enable-deltas-report: true
75+
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
76+
77+
- name: Save sketches report as workflow artifact
78+
uses: actions/upload-artifact@v4
79+
with:
80+
if-no-files-found: error
81+
path: ${{ env.SKETCHES_REPORTS_PATH }}
82+
name: sketches-report-${{ matrix.board.artifact-name-suffix }}
83+
2784
build-for-esp32:
2885
runs-on: ubuntu-latest
2986

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

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Report Size Deltas
2+
3+
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
4+
on:
5+
push:
6+
paths:
7+
- ".github/workflows/report-size-deltas.yml"
8+
schedule:
9+
# Run at the minimum interval allowed by GitHub Actions.
10+
# Note: GitHub Actions periodically has outages which result in workflow failures.
11+
# In this event, the workflows will start passing again once the service recovers.
12+
- cron: "*/5 * * * *"
13+
workflow_dispatch:
14+
repository_dispatch:
15+
16+
jobs:
17+
report:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Comment size deltas reports to PRs
21+
uses: arduino/report-size-deltas@v1
22+
with:
23+
# Regex matching the names of the workflow artifacts created by the "Compile Examples" workflow
24+
sketches-reports-source: ^sketches-report-.+

0 commit comments

Comments
 (0)