Skip to content

Compile Examples

Compile Examples #299

name: Compile Examples
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
pull_request:
paths:
- .github/workflows/compile-examples.yml
- library.properties
- examples/**
- src/**
push:
paths:
- .github/workflows/compile-examples.yml
- 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:
jobs:
build:
name: ${{ matrix.board.fqbn }}
runs-on: ubuntu-latest
env:
# libraries to install for all boards
UNIVERSAL_LIBRARIES: |
# install the ArduinoBearSSL library from the local path
- source-path: ./
- name: ArduinoECCX08
# sketch paths to compile (recursive) for all boards
UNIVERSAL_SKETCH_PATHS: |
- examples/SHA1
- examples/SHA256
SKETCHES_REPORTS_PATH: sketches-reports
strategy:
fail-fast: false
matrix:
board:
- fqbn: arduino:samd:mkr1000
type: wifi101
artifact-name-suffix: arduino-samd-mkr1000
- fqbn: arduino:samd:mkrgsm1400
type: gsm
artifact-name-suffix: arduino-samd-mkrgsm1400
- fqbn: arduino:samd:mkrnb1500
type: nb
artifact-name-suffix: arduino-samd-mkrnb1500
- fqbn: arduino:mbed_portenta:envie_m7
type: mbed_portenta
artifact-name-suffix: arduino-mbed_portenta-envie_m7
- fqbn: arduino:mbed_nano:nanorp2040connect
type: nina
artifact-name-suffix: arduino-mbed_nano-nanorp2040connect
- fqbn: arduino:mbed_opta:opta
type: mbed_opta
artifact-name-suffix: arduino-mbed_opta-opta
- fqbn: arduino:mbed_giga:giga
type: mbed_giga
artifact-name-suffix: arduino-mbed_giga-giga
- fqbn: arduino:megaavr:uno2018
type: megaavr
artifact-name-suffix: arduino-megaavr-uno2018
# make board type-specific customizations to the matrix jobs
include:
# WiFi101-compatible boards
- board:
type: wifi101
libraries: |
- name: WiFi101
sketch-paths: |
- examples/WiFiSSLClient
# GSM boards
- board:
type: gsm
libraries: |
- name: MKRGSM
sketch-paths: |
- examples/MKRGSMSSLClient
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Compile examples
uses: arduino/compile-sketches@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
fqbn: ${{ matrix.board.fqbn }}
libraries: |
${{ env.UNIVERSAL_LIBRARIES }}
${{ matrix.libraries }}
sketch-paths: |
${{ env.UNIVERSAL_SKETCH_PATHS }}
${{ matrix.sketch-paths }}
verbose: true
enable-deltas-report: true
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
- name: Save sketches report as artifact
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
path: ${{ env.SKETCHES_REPORTS_PATH }}
name: sketches-report-${{ matrix.board.artifact-name-suffix }}