Skip to content

Examples improved

Examples improved #204

Workflow file for this run

# LibraryBuild.yml
# Github workflow script to test compile all examples of an Arduino library repository.
#
# Copyright (C) 2020-2024 Armin Joachimsmeyer
# https://github.com/ArminJo/Github-Actions
#
# This is the name of the workflow, visible on GitHub UI.
name: LibraryBuild
on:
workflow_dispatch: # To run it manually
description: 'manual build check'
push: # see: https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request
paths:
- '**.ino'
- '**.cpp'
- '**.hpp'
- '**.h'
- '**LibraryBuild.yml'
pull_request:
jobs:
build:
name: ${{ matrix.arduino-boards-fqbn }} - test compiling examples
runs-on: ubuntu-latest # I picked Ubuntu to use shell scripts.
env:
# Comma separated list without double quotes around the list.
REQUIRED_LIBRARIES: Servo,LiquidCrystal
strategy:
matrix:
# The matrix will produce one job for each configuration parameter of type `arduino-boards-fqbn`
# In the Arduino IDE, the fqbn is printed in the first line of the verbose output for compilation as parameter -fqbn=... for the "arduino-builder -dump-prefs" command
#
# Examples: arduino:avr:uno, arduino:avr:leonardo, arduino:avr:nano, arduino:avr:mega
# arduino:sam:arduino_due_x, arduino:samd:arduino_zero_native"
# ATTinyCore:avr:attinyx5:chip=85,clock=1internal, digistump:avr:digispark-tiny, digistump:avr:digispark-pro
# STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8
# esp8266:esp8266:huzzah:eesz=4M3M,xtal=80, esp32:esp32:featheresp32:FlashFreq=80
# You may add a suffix behind the fqbn with "|" to specify one board for e.g. different compile options like arduino:avr:uno|trace
#############################################################################################################
arduino-boards-fqbn:
- arduino:avr:uno
- arduino:avr:leonardo
- arduino:avr:mega
- arduino:sam:arduino_due_x
- esp8266:esp8266:huzzah:eesz=4M3M,xtal=80
- esp32:esp32:esp32doit-devkit-v1
- STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8
- stm32duino:STM32F1:genericSTM32F103C
# Specify parameters for each board.
# With sketches-exclude you may exclude specific examples for a board. Use a comma separated list.
#############################################################################################################
include:
- arduino-boards-fqbn: arduino:avr:leonardo
sketches-exclude: SimpleTouchScreenDSO,TouchGuiDemo # Too big
- arduino-boards-fqbn: arduino:sam:arduino_due_x
sketches-exclude: SimpleTouchScreenDSO,SimpleDSO_BlueDisplay,TwoButtonsOnLocalDisplay,BTModuleProgrammer,ShowSensorValues,TouchGuiDemo,ChartForMHZ19_CO2 # missing random()
- arduino-boards-fqbn: MegaCore:avr:128:bootloader=no_bootloader,eeprom=keep,BOD=2v7,LTO=Os,clock=8MHz_internal
platform-url: https://mcudude.github.io/MegaCore/package_MCUdude_MegaCore_index.json
arduino-platform: arduino:avr,MegaCore:avr # gcc is taken from arduino:avr
sketches-exclude: SimpleTouchScreenDSO,SimpleDSO_BlueDisplay,TwoButtonsOnLocalDisplay,ServoExample,ChartForMHZ19_CO2 # ServoEasing not available for Mega Core
- arduino-boards-fqbn: esp8266:esp8266:huzzah:eesz=4M3M,xtal=80
platform-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json
sketches-exclude: SimpleTouchScreenDSO,SimpleDSO_BlueDisplay,TwoButtonsOnLocalDisplay,BTModuleProgrammer,ChartForMHZ19_CO2
- arduino-boards-fqbn: esp32:esp32:esp32doit-devkit-v1
platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
sketches-exclude: SimpleTouchScreenDSO,SimpleDSO_BlueDisplay,TwoButtonsOnLocalDisplay,RcCarControl,BTModuleProgrammer,ServoExample,ChartForMHZ19_CO2
# build-properties: # the flags were put in compiler.cpp.extra_flags
# ShowSensorValues: -Wno-error=format-overflow # https://github.com/espressif/arduino-esp32/issues/7024 !!using this in ESP 3.x gives strange errors!!!
- arduino-boards-fqbn: STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8
platform-url: https://raw.githubusercontent.com/stm32duino/BoardManagerFiles/main/package_stmicroelectronics_index.json
sketches-exclude: SimpleTouchScreenDSO,SimpleDSO_BlueDisplay,TwoButtonsOnLocalDisplay,ChartForMHZ19_CO2 # Comma separated list of example names to exclude in build
- arduino-boards-fqbn: stm32duino:STM32F1:genericSTM32F103C # Roger Clark version
platform-url: http://dan.drown.org/stm32duino/package_STM32duino_index.json
sketches-exclude: SimpleTouchScreenDSO,SimpleDSO_BlueDisplay,TwoButtonsOnLocalDisplay,BTModuleProgrammer,ChartForMHZ19_CO2 # Comma separated list of example names to exclude in build
# fail-fast: false # false -> do not cancel all jobs / architectures if one job fails
steps:
- name: Checkout
uses: actions/checkout@master
- name: Compile all examples using the arduino-test-compile action
uses: ArminJo/arduino-test-compile@master
with:
arduino-board-fqbn: ${{ matrix.arduino-boards-fqbn }}
arduino-platform: ${{ matrix.arduino-platform }} # for MegaCore
platform-url: ${{ matrix.platform-url }}
required-libraries: ${{ env.REQUIRED_LIBRARIES }}
sketches-exclude: ${{ matrix.sketches-exclude }}
build-properties: ${{ toJson(matrix.build-properties) }}
# build-properties: '{ "All": "-DOMIT_BD_DEPRECATED_FUNCTIONS{{ matrix.build-properties }}" }'
# build-properties: '{ "SimpleTouchScreenDSO": "-DBD_USE_SIMPLE_SERIAL" }'
# debug-install: true
# debug-compile: true