Skip to content

Compile Examples

Compile Examples #159

name: Compile Examples
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/compile-examples.ya?ml"
- "library.properties"
- "examples/**"
- "src/**"
pull_request:
paths:
- ".github/workflows/compile-examples.ya?ml"
- "library.properties"
- "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:
permissions:
contents: read
jobs:
build:
name: ${{ matrix.board.fqbn }}
runs-on: ubuntu-latest
env:
UNIVERSAL_SKETCH_PATHS: |
- examples/BasicUsage
- examples/ReadWriteRegs
SKETCHES_REPORTS_PATH: sketches-reports
strategy:
fail-fast: false
matrix:
board:
- fqbn: arduino:mbed_nicla:nicla_vision
# See: https://github.com/arduino/compile-sketches#platforms
platforms: |
- name: arduino:mbed_nicla
sketch-paths:
artifact-name-suffix: arduino-mbed_nicla-nicla_vision
- fqbn: arduino:mbed_portenta:envie_m7:target_core=cm4
platforms: |
- name: arduino:mbed_portenta
sketch-paths:
artifact-name-suffix: arduino-mbed_portenta-envie_m7-target_core-cm4
- fqbn: arduino:mbed_portenta:envie_m7
platforms: |
- name: arduino:mbed_portenta
sketch-paths:
artifact-name-suffix: arduino-mbed_portenta-envie_m7
- fqbn: arduino:renesas_portenta:portenta_c33
platforms: |
- name: arduino:renesas_portenta
sketch-paths: |
- examples/C33-Low-Power
artifact-name-suffix: arduino-renesas_portenta-portenta_c33
steps:
- name: Checkout repository
uses: actions/checkout@v4
- 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: |
${{ env.UNIVERSAL_SKETCH_PATHS }}
${{ matrix.sketch-paths }}
enable-deltas-report: true
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
- name: Save sketches report as workflow artifact
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
path: ${{ env.SKETCHES_REPORTS_PATH }}
name: sketches-report-${{ matrix.board.artifact-name-suffix }}