Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Arduino library CI #41

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
25 changes: 21 additions & 4 deletions .github/workflows/arduino-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Arduino Library Checks

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the develop branch
# Triggers the workflow on push or pull request events but only for the develop and master branches
push:
branches: [develop,master]
pull_request:
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
verbose: true
fqbn: arduino:avr:uno
sketch-paths: |
- 'examples/RDMSerialRecv'
- examples

compile-leonardo:
needs: compile-uno
Expand All @@ -71,7 +71,7 @@ jobs:
verbose: true
fqbn: arduino:avr:leonardo
sketch-paths: |
- 'examples/RDMSerialRecv'
- examples

compile-mega:
needs: compile-uno
Expand All @@ -88,4 +88,21 @@ jobs:
verbose: true
fqbn: arduino:avr:mega
sketch-paths: |
- 'examples/RDMSerialRecv'
- examples

compile-nano:
needs: compile-uno
name: compile examples for nano
runs-on: ubuntu-latest
continue-on-error: true

steps:
- uses: actions/checkout@v2

- name: Compile for nano
uses: arduino/compile-sketches@v1
with:
verbose: true
fqbn: arduino:avr:nano
sketch-paths: |
- examples
92 changes: 92 additions & 0 deletions .github/workflows/compile-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Compile Examples

# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/compile-examples.yml"
- "examples/**"
- "src/**"
pull_request:
paths:
- ".github/workflows/compile-examples.yml"
- "examples/**"
- "src/**"
schedule:
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms).
- cron: "0 8 * * TUE"
workflow_dispatch:
repository_dispatch:

jobs:
build:
name: ${{ matrix.board.fqbn }}
runs-on: ubuntu-latest

env:
SKETCHES_REPORTS_PATH: sketches-reports

strategy:
fail-fast: false

matrix:
board:
- fqbn: arduino:avr:nano
platforms: |
- name: arduino:avr
- fqbn: arduino:avr:mega
platforms: |
- name: arduino:avr
- fqbn: arduino:avr:leonardo
platforms: |
- name: arduino:avr
# No serial port/incorrect serial config
#- fqbn: arduino:megaavr:nona4809
# platforms: |
# - name: arduino:megaavr
# No EEPROM library in all the below
#- fqbn: arduino:sam:arduino_due_x_dbg
# platforms: |
# - name: arduino:sam
#- fqbn: arduino:samd:mkrzero
# platforms: |
# - name: arduino:samd
#- fqbn: arduino:mbed_portenta:envie_m4
# platforms: |
# - name: arduino:mbed_portenta
#- fqbn: arduino:mbed_portenta:envie_m7
# platforms: |
# - name: arduino:mbed_portenta
#- fqbn: arduino:mbed_nano:nano33ble
# platforms: |
# - name: arduino:mbed_nano
#- fqbn: arduino:mbed_nano:nanorp2040connect
# platforms: |
# - name: arduino:mbed_nano

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Compile examples
uses: arduino/compile-sketches@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
fqbn: ${{ matrix.board.fqbn }}
platforms: ${{ matrix.board.platforms }}
libraries: |
# Install the library from the local path.
- source-path: ./
# Additional library dependencies can be listed here.
# See: https://github.com/arduino/compile-sketches#libraries
sketch-paths: |
- examples
enable-deltas-report: true
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}

- name: Save sketches report as workflow artifact
uses: actions/upload-artifact@v2
with:
if-no-files-found: error
path: ${{ env.SKETCHES_REPORTS_PATH }}
name: ${{ env.SKETCHES_REPORTS_PATH }}
24 changes: 24 additions & 0 deletions .github/workflows/report-size-deltas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Report Size Deltas

# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/report-size-deltas.yml"
schedule:
# Run at the minimum interval allowed by GitHub Actions.
# Note: GitHub Actions periodically has outages which result in workflow failures.
# In this event, the workflows will start passing again once the service recovers.
- cron: "*/5 * * * *"
workflow_dispatch:
repository_dispatch:

jobs:
report:
runs-on: ubuntu-latest
steps:
- name: Comment size deltas reports to PRs
uses: arduino/report-size-deltas@v1
with:
# The name of the workflow artifact created by the sketch compilation workflow
sketches-reports-source: sketches-reports
Comment on lines +1 to +24
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this file needs to be separate as it's got a different schedule.