Skip to content

Non strict

Non strict #37

name: Build Arduino Example Apps
on:
workflow_dispatch:
push:
paths:
- src/**
- examples/arduino/**
- .github/workflows/build_arduino_examples.yml
jobs:
build-examples:
runs-on: ubuntu-latest
strategy:
matrix:
example:
- sniffer
- remote
- receiver
board:
- esp32:esp32:sparkfun_lora_gateway_1-channel
- adafruit:avr:feather32u4
- adafruit:samd:adafruit_feather_m0
include:
# Representative ESP32 board
- board: "esp32:esp32:sparkfun_lora_gateway_1-channel"
cores: "esp32:esp32"
board-url: |
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
board-defines: |
-DOPENRTS_BOARD_SPARKFUN_LORA_GATEWAY -DOPENRTS_BUTTON_2=0 -DOPENRTS_BUTTON_3=0 -DOPENRTS_BUTTON_4=0
# Representative AVR board
- board: "adafruit:avr:feather32u4"
cores: "arduino:avr adafruit:avr"
board-url: |
https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
board-defines: |
-DOPENRTS_BOARD_ADAFRUIT_32U4_RFM69 -DOPENRTS_BUTTON_1=0 -DOPENRTS_BUTTON_2=0 -DOPENRTS_BUTTON_3=0 -DOPENRTS_BUTTON_4=0
# Representative SAMD board
- board: "adafruit:samd:adafruit_feather_m0"
cores: "adafruit:samd"
board-url: |
https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
board-defines: |
-DOPENRTS_BOARD_ADAFRUIT_M0_RFM69 -DOPENRTS_BUTTON_1=0 -DOPENRTS_BUTTON_2=0 -DOPENRTS_BUTTON_3=0 -DOPENRTS_BUTTON_4=0
steps:
# Checkout the repo
- name: Checkout
uses: actions/checkout@v3
# Install arduino cli
- name: Setup Arduino CLI
uses: arduino/setup-arduino-cli@v1
# Add additional board URL, if required
- name: Add additional board URLs
run: |
arduino-cli config init
arduino-cli config add board_manager.additional_urls ${{ matrix.board-url }}
if: ${{ matrix.board-url }}
# Install cores
- name: Install platform
run: |
arduino-cli core update-index
arduino-cli core install ${{ matrix.cores }}
# Compile the example sketch
- name: Compile sketch
run: |
arduino-cli compile \
--fqbn ${{ matrix.board }} \
--build-property compiler.cpp.extra_flags="${{ matrix.board-defines }}" \
--library="$PWD" \
examples/arduino/${{matrix.example}}