{"id":16218920,"url":"https://github.com/arminjo/arduino-test-compile","last_synced_at":"2025-03-19T10:31:18.083Z","repository":{"id":43655160,"uuid":"248499293","full_name":"ArminJo/arduino-test-compile","owner":"ArminJo","description":"Github Action to compile all examples of an Arduino library for one board and check for errors","archived":false,"fork":false,"pushed_at":"2023-02-06T15:45:20.000Z","size":104,"stargazers_count":38,"open_issues_count":0,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-17T23:42:13.631Z","etag":null,"topics":["arduino","arduino-library","continuous-testing","github-action","github-actions-docker"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArminJo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-19T12:37:37.000Z","updated_at":"2023-12-30T23:50:24.000Z","dependencies_parsed_at":"2023-02-19T09:21:22.418Z","dependency_job_id":null,"html_url":"https://github.com/ArminJo/arduino-test-compile","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArminJo%2Farduino-test-compile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArminJo%2Farduino-test-compile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArminJo%2Farduino-test-compile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArminJo%2Farduino-test-compile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArminJo","download_url":"https://codeload.github.com/ArminJo/arduino-test-compile/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244407846,"owners_count":20447859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","arduino-library","continuous-testing","github-action","github-actions-docker"],"created_at":"2024-10-10T11:51:31.719Z","updated_at":"2025-03-19T10:31:17.850Z","avatar_url":"https://github.com/ArminJo.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align = center\u003e\n\n# arduino-test-compile [action](https://github.com/marketplace/actions/test-compile-for-arduino)\nThis action does a test-compile of one or more [Arduino programs](https://github.com/ArminJo/Arduino-Simple-DSO/tree/master) in a repository for different boards\u003cbr/\u003e\neach with different compile parameters.\u003cbr/\u003e\nIt can be used e.g. to test-compile all examples contained in an [Arduino library repository](https://github.com/ArminJo/NeoPatterns/tree/master/examples).\n\n[![Badge License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)\n \u0026nbsp; \u0026nbsp; \n [![Badge Version](https://img.shields.io/github/v/release/ArminJo/arduino-test-compile?include_prereleases\u0026color=yellow\u0026logo=DocuSign\u0026logoColor=white)](https://github.com/ArminJo/arduino-test-compile/releases/latest)\n \u0026nbsp; \u0026nbsp; \n[![Badge Commits since latest](https://img.shields.io/github/commits-since/ArminJo/arduino-test-compile/latest?color=yellow)](https://github.com/ArminJo/arduino-test-compile/commits/master)\n \u0026nbsp; \u0026nbsp; \n[![Badge Build Status Action](https://github.com/ArminJo/Github-Actions/workflows/LibraryBuildWithAction/badge.svg)](https://github.com/ArminJo/Github-Actions/actions)\n \u0026nbsp; \u0026nbsp; \n[![Badge Build Status Script](https://github.com/ArminJo/Github-Actions/workflows/LibraryBuildWithScript/badge.svg)](https://github.com/ArminJo/Github-Actions/actions)\n \u0026nbsp; \u0026nbsp; \n![Badge Hit Counter](https://visitor-badge.laobi.icu/badge?page_id=ArminJo_arduino-test-compile)\n\u003cbr/\u003e\n\u003cbr/\u003e\n[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua)\n\n\u003c/div\u003e\n\n#### If you find this program useful, please give it a star.\n\n\u003cbr/\u003e\n\n### If you see errors like `Node.js 12 actions are deprecated`, update your checkout action from `actions/checkout@v2` to `actions/checkout@master`.\n\nThe action is a \"composite run steps\" action which uses the [arduino-cli program](https://github.com/arduino/arduino-cli) for compiling. All the work like loading libraries, installing board definitions and setting parameters is orchestrated by the [arduino-test-compile.sh](arduino-test-compile.sh) bash script.\n\nIn case of a compile error the **complete compile output** is logged in the *Compile all examples...* step, otherwise only a **green check** is printed. Examples can be found [here](https://github.com/ArminJo/ServoEasing/actions).\n\nIf you want to test compile a sketch, **it is not required that the sketch resides in a directory with the same name (as Arduino IDE requires it) or has the extension .ino**. Internally the file is renamed to be .ino and the appropriate directory is created on the fly at `/home/runner/\u003csketch-name\u003e` for test-compiling. See [parameter `sketch-names`](sketch-names).\n\nSince version 0.11.0 of arduino-cli, the **generated files** (.bin, .hex, .elf, .eep etc.) can be found in the build/\u003cFQBN\u003e subfolder of the example directory `$GITHUB_WORKSPACE/src/\u003cexample_name\u003e`  or in `$HOME/\u003csketch-name\u003e` for files not residing in a directory with the same name.\u003cbr/\u003e\n\n# Hints\n- If you require a **custom library for your build**, add an extra step for [loading a custom library](#using-custom-library).\u003cbr/\u003e\nBe aware to use the `path:` parameter for checkout, otherwise checkout will overwrite the last checkout content.\u003cbr/\u003e\nTake care that the path parameter matches the pattern `*Custom*` like [here](https://github.com/ArminJo/Arduino-Simple-DSO/blob/master/.github/workflows/TestCompile.yml#L24). You do not need to put the \"Custom\" library in the required-libraries list.\n\n- If you have problems with you workflow file, you find additional information in the output if you set the [flags](#debug-compile-and-debug-install) `debug-compile` and / or `debug-install` to `true`.\u003cbr/\u003e\n\n- If actions / workflow for your repository is not enabled, select `Allow all actions` it in your repositorys *Settings -\u003e Actions -\u003e General* menu.\n\n# Inputs\nSee [action.yml](https://github.com/ArminJo/arduino-test-compile/blob/master/action.yml) for comprehensive list of parameters.\n\n### `arduino-board-fqbn`\nThe fully qualified board name to use for compiling with arduino-cli. You may add a suffix behind the fqbn with `|` to specify one board for e.g. different compile options like `arduino:avr:uno|trace`.\u003cbr/\u003e\nDefault is `arduino:avr:uno`.\u003cbr/\u003e\n\n```yaml\narduino-board-fqbn: esp8266:esp8266:huzzah:eesz=4M3M,xtal=80\n```\n\n**For 3rd party boards**, you must also specify the Boards Manager URL `platform-default-url:` or `platform-url:`.\n\n### `platform-default-url`\nDefault value to take, if `platform-url` is not specified for a 3rd party board. Useful, if you want to test compile for different boards types of one architecture.\u003cbr/\u003e\nDefault is `\"\"`.\u003cbr/\u003e\n\n```yaml\nplatform-default-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json\n```\n\n### `platform-url`\nRequired for 3rd party boards, if `platform-default-url` is not specified or applicable. If you need, you may specify more than one URL as a comma separated list (without enclosing it in double quotes) like `http://drazzy.com/package_drazzy.com_index.json,https://raw.githubusercontent.com/ArminJo/DigistumpArduino/master/package_digistump_index.json`.\u003cbr/\u003e\nDefault is `\"\"`.\u003cbr/\u003e\n\n```yaml\n  platform-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json\n```\n\n[Unofficial list of 3. party URL's](https://github.com/arduino/Arduino/wiki/Unofficial-list-of-3rd-party-boards-support-urls)\n\nSome [sample URL's](https://github.com/arduino/Arduino/wiki/Unofficial-list-of-3rd-party-boards-support-urls) are:\n- http://drazzy.com/package_drazzy.com_index.json - for ATTiny boards\n- https://raw.githubusercontent.com/ArminJo/DigistumpArduino/master/package_digistump_index.json - for Digistump AVR boards. Up to 20% smaller code\n- https://files.pololu.com/arduino/package_pololu_index.json - for Pololu boards, esp. ATmega328PB boards\u003cbr/\u003e\u003cbr/\u003e\n- https://arduino.esp8266.com/stable/package_esp8266com_index.json - for ESP8266 based boards\n- https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json - for ESP32 based boards\u003cbr/\u003e\u003cbr/\u003e\n- https://github.com/stm32duino/BoardManagerFiles/raw/master/package_stmicroelectronics_index.json - STMicroelectronics:stm32 for STM32 boards\n- http://dan.drown.org/stm32duino/package_STM32duino_index.json - stmduino: for STM32 boards\n- https://raw.githubusercontent.com/sparkfun/Arduino_Boards/master/IDE_Board_Manager/package_sparkfun_index.json - for Sparkfun boards\n- https://raw.githubusercontent.com/sparkfun/Arduino_Apollo3/master/package_sparkfun_apollo3_index.json - for Sparkfun Apollo3 boards\n- https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json - for nRF528x based boards like Nano 33 BLE\u003cbr/\u003e\u003cbr/\u003e\n- https://downloads.arduino.cc/packages/package_index.json - Built in URL for default Arduino boards, not required to specify\n- https://mcudude.github.io/MegaCore/package_MCUdude_MegaCore_index.json - ATmega64, ATmega128, ATmega640, ATmega1280, ATmega1281, ATmega2560, ATmega2561 etc.\n- https://mcudude.github.io/MiniCore/package_MCUdude_MiniCore_index.json - ATmega328, ATmega168, ATmega88, ATmega48 and ATmega8. Two extra IO pins if using the internal oscillator\n\n### `arduino-platform`\nComma separated list of platform specifiers with optional version to specify multiple platforms for your board or a fixed version like `arduino:avr@1.8.2`.\u003cbr/\u003e\nThe suffix `@latest` is always removed from specified platform to enable usage of platform versions in a matrix.\u003cbr/\u003e\nIn general, use it only if you require another specifier than the one derived from the 2 first elements of the arduino-board-fqbn e.g. **esp8266:esp8266**:huzzah:eesz=4M3M,xtal=80, esp32:esp32:featheresp32:FlashFreq=80 -\u003e **esp8266:esp8266**. Do not forget to specify the related URL's, if it is not the arduino URL, which is built in.\u003cbr/\u003e\nUseful in the case you require a dedicated version of a core or two cores as for MegaCore, which requires the compiler from the Arduino core.\u003cbr/\u003e\nIt is also useful if you install the core manually, but require e.g. tools from another core.\u003cbr/\u003e\nDefault is `\"\"`.\u003cbr/\u003e\n\n```yaml\narduino-platform: arduino:avr,SparkFun:avr@1.1.13\nplatform-url: https://raw.githubusercontent.com/sparkfun/Arduino_Boards/master/IDE_Board_Manager/package_sparkfun_index.json # Arduino URL is not required here\n\n- arduino-boards-fqbn: MegaCore:avr:128:bootloader=no_bootloader,eeprom=keep,BOD=2v7,LTO=Os,clock=8MHz_internal\n  platform-url: https://mcudude.github.io/MegaCore/package_MCUdude_MegaCore_index.json\n  arduino-platform: MegaCore:avr,arduino:avr # gcc is taken from arduino:avr\n\n- arduino-boards-fqbn: esp32:esp32:esp32c3\n  platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json\n  arduino-platform: esp32:esp32@2.0.17 # latest 2.x version as of 5/2024\n\n```\n\n### `required-libraries`\nComma separated list of arduino library dependencies to install. You may add a version number like `@1.3.4`.\u003cbr/\u003e\nOnly libraries [available in the Arduino library manager](https://www.arduinolibraries.info/) can be installed this way.\u003cbr/\u003e\nIf you want to use other or custom libraries, you must put all the library files into the sketch directory or add an extra step as in [this example](#using-custom-library).\u003cbr/\u003e\nBe careful, some library names can contain spaces, e.g. `LiquidCrystal I2C` even if they are defined in *library.properties* with underscores like: `name=LiquidCrystal_I2C`.\u003cbr/\u003e\nDefault is `\"\"`.\u003cbr/\u003e\n\n```yaml\nrequired-libraries: Servo,Adafruit NeoPixel@1.3.4,${{ env.REQUIRED_LIBRARIES }},${{ matrix.required-libraries }}\n```\n\nA **list of correct Arduino library names** can be found [here](https://www.arduinolibraries.info/).\n\n\n### `sketches-exclude`\nSketches to be **excluded from build**. Comma or space separated list of complete sketch / example names to exclude in build. Comment is only allowed at the end of the list\u003cbr/\u003e\n\n```yaml\n  # 1.TinyWireM not usable; 2. incompatible I2C Hardware for Wire.h; 3. SoftPwm is not required and not working\n  sketches-exclude:\n    WiiClassicJoystick\n    BasicUsage,DigisparkOLED,DigiUSB2LCD\n    SoftPwm13Pins,TinySoftPwmDemo\n    DigisparkUSBDemo ArduinoNunchukDemo DigisparkJoystickDemo # Nunchuck library: incompatible I2C Hardware, the original library uses TinyWireM library\n\n```\n\n### `build-properties`\nBuild parameter like `-DDEBUG` for each example specified or for all examples which have no dedicated specification, if example name is `All`. I.e. if an example specific parameter is specified, the value for All is ignored for this example.\u003cbr/\u003e\nThe content is passed to the arduino-cli commandline in 3 parameters:\u003cbr/\u003e\n`--build-property compiler.[cpp,c,S].extra_flags=\"${GCC_EXTRA_FLAGS}\"`\n\nIn the `include:` section you may specify:\n\n```yaml\ninclude:\n...\n  build-properties:\n    SymmetricEasing:\n      -DDISABLE_COMPLEX_FUNCTIONS\n      -DDEBUG\n    AsymmetricEasing:\n      -DTRACE\n    Simple: -DPRINT_FOR_SERIAL_PLOTTER\n    PCA9685_ExpanderFor32Servos: -DTRACE -DENABLE_MICROS_AS_DEGREE_PARAMETER\n...\n  build-properties:\n    Simple:\n      -DPRINT_FOR_SERIAL_PLOTTER -DDEBUG\n    All:\n      -DDEBUG\n...\n```\n\nand reference it in the `with:` section by: \n\n```yaml\nwith:\n  build-properties: ${{ toJson(matrix.build-properties) }}\n```\n\nIf you want to specify it directly in the `with:` section it must be:\n\n```yaml\nwith:\n  build-properties: '{ \"WhistleSwitch\": \"-DDEBUG -DFREQUENCY_RANGE_LOW\", \"SimpleFrequencyDetector\": \"-DINFO\", \"All\": \"-DDEBUG\" }'\n```\n\n### `extra-arduino-cli-args`\nThis string is passed verbatim without additional quoting to the arduino-cli compile commandline as last argument before the filename.\nSee https://arduino.github.io/arduino-cli/commands/arduino-cli_compile/ for compile parameters.\u003cbr/\u003e\nE.g. if you specify `extra-arduino-cli-args: \"--warnings default\"`, this overwrites the default setting of `--warnings all` for compile, which may be especially useful for ESP32 source compilation.\u003cbr/\u003e\nBe aware, that you cannot add to `--build-property compiler.[cpp,c,S].extra_flags`, if you already specified `build-properties`, they will be overwritten by your content. See https://github.com/arduino/arduino-cli/pull/1044.\n\nThis example tells arduino-cli to do the lolin32 build for what the Arduino IDE calls *Tools \u003e Partition Scheme \u003e No OTA (Large APP)*, what can also be specified with `arduino-boards-fqbn: esp32:esp32:lolin32:PartitionScheme=no_ota`.\n\n```yaml\nstrategy:\n  matrix:\n    arduino-board-fqbn:\n    - esp32:esp32:lolin32\n    include:\n      - arduino-boards-fqbn: esp32:esp32:lolin32\n        extra-arduino-cli-args: \"--warnings default --build-property build.partitions=no_ota --build-property upload.maximum_size=2097152\"\n    ...\nsteps:\n- name: Arduino build\n  uses: ArminJo/arduino-test-compile@master\n  with:\n    ...\n    arduino-board-fqbn: ${{ matrix.arduino-board-fqbn }}\n    extra-arduino-cli-args: ${{ matrix.extra-arduino-cli-args }}\n```\n\n### `extra-arduino-lib-install-args`\nThis string is passed verbatim without double quotes to the arduino-cli lib install commandline as last argument before the library names. It can be used e.g. to suppress dependency resolving for libraries by using `--no-deps` as argument string.\n\n```yaml\nsteps:\n- name: Arduino build\n  uses: ArminJo/arduino-test-compile@v3\n  with:\n    ...\n    arduino-board-fqbn: ${{ matrix.arduino-board-fqbn }}\n    extra-arduino-lib-install-args: \"--no-deps\"\n```\n\n### `cli-version`\nThe version of `arduino-cli` to use.\u003cbr/\u003e\nDefault is `latest`.\u003cbr/\u003e\n\n```yaml\ncli-version: 0.9.0 # The current one (3/2020)\n```\n\n### `sketch-names`\nComma separated list of patterns or filenames (without path) of the sketch(es) to test compile. Useful if the sketch is a *.cpp or *.c file or only one sketch in the repository should be compiled. If first character is a `*` like in \"*.ino\" the list must be enclosed in double quotes!\u003cbr/\u003e\nThe **sketch names to compile are searched in the whole repository** by the command `find . -name \"$SKETCH_NAME\"` with `.` as the root of the repository, so you do not need to specify the full path.\u003cbr/\u003e\nIf you specify `sketch-names-find-start` then the find command is changed to `find ${PWD}/${SKETCH_NAMES_FIND_START} -name \"$SKETCH_NAME\"`.\u003cbr/\u003e\nSketches do not need to be in an example directory. This enables **[plain programs](https://github.com/ArminJo/Arduino-Simple-DSO/tree/master) to be test compiled**.\u003cbr/\u003e\nSince Arduino requires a sketch to end with .ino and to reside in a directory with the same name as the sketch, if required, the **renaming and directory creation is done internally** to fulfill the requirements of the Arduino IDE.\u003cbr/\u003e\nDefault is `*.ino`.\u003cbr/\u003e\n\n```yaml\nsketch-names: \"*.ino,SimpleTouchScreenDSO.cpp\"\n```\n\n### `sketch-names-find-start`\nThe **start directory to look for the sketch-names** to test compile. Can be a path like `digistump-avr/libraries/*/examples/`. Must be a path **relative to the root of the repository**. Used [here](https://github.com/ArminJo/DigistumpArduino/blob/master/.github/workflows/TestCompile.yml#L90) to compile all library examples of the board package.\nDefault is `.` (root of repository).\u003cbr/\u003e\n\n```yaml\nsketch-names-find-start: digistump-avr/libraries/*/examples/C*/\n```\n\n### `set-build-path`\nIf set to true, the build directory (arduino-cli paramer --build-path) is set to `$GITHUB_WORKSPACE/src/\u003cexample_name\u003e/build/`  or to `$HOME/\u003csketch-name\u003e/build/` for files not residing in a directory with the same name.\u003cbr/\u003e\nThis is useful, if you need to access the result files of the Arduino build in later workflow steps.\u003cbr/\u003e\nBut anyway, the build binaries are always available in the newly generated \"build/\u003cfqbn\u003e\" directory of the sketch. \nThey are logged if debug-compile is set to \"true\".\nDefault is `false`.\u003cbr/\u003e\n\n```yaml\nset-build-path: true\n```\n\n### `debug-compile` and `debug-install`\nIf you have problems with you workflow file, try to set this flags to `true`.\u003cbr/\u003e\nDefault is `false`.\u003cbr/\u003e\n\n# Workflow examples\n## Simple - without any parameter\nCompile all sketches / examples for the Uno board.\n\n```yaml\nname: SimpleBuild\non: push\njobs:\n  build:\n    name: Test compiling examples for Uno\n    runs-on: ubuntu-latest\n    steps:\n    - name: Checkout\n      uses: actions/checkout@v3\n    - name: Compile all examples\n      uses: ArminJo/arduino-test-compile@v3\n```\n\n## One ESP8266 board with parameter\n```yaml\nname: LibraryBuild\non: [push, pull_request]\njobs:\n  build:\n    name: Test compiling examples for esp8266\n    runs-on: ubuntu-latest\n\n    steps:\n    - name: Checkout\n      uses: actions/checkout@v3\n\n    - name: Compile all examples\n        uses: ArminJo/arduino-test-compile@v3\n      with:\n        arduino-board-fqbn: esp8266:esp8266:huzzah:eesz=4M3M,xtal=80\n        platform-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json\n        required-libraries: Servo,Adafruit NeoPixel\n        sketches-exclude: WhistleSwitch 50Hz\n        build-properties: '{ \"WhistleSwitch\": \"-DDEBUG -DFREQUENCY_RANGE_LOW\", \"SimpleFrequencyDetector\": \"-DINFO\" }'\n```\n\n## One board with 2x2 compile parameter matrix\n```yaml\nname: LibraryBuild with parameter matrix\non:\n  push: # see: https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request\n    paths:\n    - '**.ino'\n    - '**.cpp'\n    - '**.h'\n    - '**LibraryBuild.yml'\n  pull_request:\njobs:\n  build:\n    name: ${{ matrix.arduino-boards-fqbn }} ${{ matrix.log-options }} ${{ matrix.other-options }}\n    runs-on: ubuntu-latest\n    env:\n      REQUIRED_LIBRARIES: Servo,Adafruit NeoPixel\n    strategy:\n      matrix:\n        arduino-boards-fqbn:\n          - arduino:avr:uno\n\n        log-options: [-DDEBUG, -DINFO]\n\n        other-options: [-DTEST, -DDUMMY]\n\n      fail-fast: false\n\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n\n      - name: Compile all examples\n        uses: ArminJo/arduino-test-compile@v3\n        with:\n          arduino-board-fqbn: ${{ matrix.arduino-boards-fqbn }}\n          platform-url: ${{ matrix.platform-url }}\n          required-libraries: ${{ env.REQUIRED_LIBRARIES }}\n          build-properties: '{ \"All\": \"${{ matrix.log-options }} ${{ matrix.other-options }}\" }'\n\n```\n\n## Multiple boards with parameter\n```yaml\nname: LibraryBuild\non:\n  push: # see: https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request\n    paths:\n    - '**.ino'\n    - '**.cpp'\n    - '**.h'\n    - '**LibraryBuild.yml'\n  pull_request:\njobs:\n  build:\n    name: ${{ matrix.arduino-boards-fqbn }} - test compiling examples\n    runs-on: ubuntu-latest\n    env:\n      REQUIRED_LIBRARIES: Servo,Adafruit NeoPixel\n    strategy:\n      matrix:\n        arduino-boards-fqbn:\n          - arduino:avr:uno\n          - arduino:avr:uno|All-DEBUG\n          - arduino:avr:uno|trace\n          - esp8266:esp8266:huzzah:eesz=4M3M,xtal=80\n\n        include:\n          - arduino-boards-fqbn: arduino:avr:uno\n            sketch-names: WhistleSwitch.ino,SimpleFrequencyDetector.ino # Comma separated list of sketch names (no path required) or patterns to use in build\n            build-properties:\n              WhistleSwitch:\n                -DDEBUG\n                -DFREQUENCY_RANGE_LOW\n              SimpleFrequencyDetector:\n                -DINFO\n\n          - arduino-boards-fqbn: arduino:avr:uno|All-DEBUG # Uno board with -DDEBUG for all examples\n            sketches-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build\n            build-properties:\n              All:\n                -DDEBUG\n\n          - arduino-boards-fqbn: arduino:avr:uno|trace # Uno board with different build properties\n            sketches-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build\n            build-properties:\n              WhistleSwitch:\n                -DDEBUG\n                -DTRACE\n\n          - arduino-boards-fqbn: esp8266:esp8266:huzzah:eesz=4M3M,xtal=80\n            platform-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json\n            sketches-exclude: WhistleSwitch,50Hz,SimpleFrequencyDetector\n\n          - arduino-boards-fqbn: esp32:esp32:featheresp32:FlashFreq=80\n            platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json\n            required-libraries: ESP32 ESP32S2 AnalogWrite\n\n      fail-fast: false\n\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n\n      - name: Compile all examples\n        uses: ArminJo/arduino-test-compile@v3\n        with:\n          arduino-board-fqbn: ${{ matrix.arduino-boards-fqbn }}\n          platform-default-url: ${{ env.PLATFORM_DEFAULT_URL }}\n          platform-url: ${{ matrix.platform-url }}\n          required-libraries: ${{ env.REQUIRED_LIBRARIES }},${{ matrix.required-libraries }}\n          sketch-names: ${{ matrix.sketch-names }}\n          sketches-exclude: ${{ matrix.sketches-exclude }}\n          build-properties: ${{ toJson(matrix.build-properties) }}\n```\n\n## Using custom library\nAdd an extra step `Checkout custom library` for loading custom library. **You must use the `path:` parameter, otherwise checkout overwrites the last checkout content.**\u003cbr/\u003e\nTake care that the path parameter matches the pattern `*Custom*` like [here](https://github.com/ArminJo/Arduino-Simple-DSO/blob/master/.github/workflows/TestCompile.yml#L24).\u003cbr/\u003e\nYou do not need to put the custom libraries, you loaded manually, in the `required-libraries` list, since they are already loaded now!\u003cbr/\u003e\nBut if you use this library as **substitute for an Arduino library** take care to remove the substituted Arduino linrary in your `required-libraries` list.\n```yaml\n...\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n\n      - name: Checkout custom library\n        uses: actions/checkout@v3\n        with:\n          repository: ArminJo/ATtinySerialOut\n          ref: master\n          path: CustomLibrary # must contain string \"Custom\"\n          # No need to put \"Custom\" library in the required-libraries list\n\n      - name: Checkout second custom library # This name must be different from the one above\n        uses: actions/checkout@v3\n        with:\n          repository: ArminJo/Arduino-BlueDisplay\n          ref: master\n          path: CustomLibrary_BlueDisplay # This path must be different from the one above but must also contain string \"Custom\"\n...\n```\n\n## Single [program](https://github.com/ArminJo/Arduino-Simple-DSO/tree/master/src) using `sketch-names` parameter\n```yaml\nname: TestCompile\non: push\njobs:\n  build:\n    name: Test compiling examples for Uno\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n\n      - name: Compile all examples\n        uses: ArminJo/arduino-test-compile@master\n        with:\n          sketch-names: SimpleTouchScreenDSO.cpp\n          required-libraries: BlueDisplay\n```\n\n\n## Testing a core, which is not yet released using `arduino-platform` parameter like [here](https://github.com/ArminJo/DigistumpArduino/blob/master/.github/workflows/TestCompile.yml)\n```yaml\nname: TestCompile\non: push\njobs:\n  build:\n    name: Test compiling examples for Digispark\n    runs-on: ubuntu-latest\n    strategy:\n      matrix:\n        arduino-boards-fqbn:\n          - digistump:avr:digispark-tiny   # ATtiny85 board @16.5 MHz\n          - digistump:avr:MHETtiny88 # Chinese MH-Tiny ATTiny88\n        include:\n          - arduino-boards-fqbn: digistump:avr:MHETtiny88  # ATtiny88 China clone board @16 MHz\n            # 1.TinyWireM not usable; 2. incompatible I2C Hardware for Wire.h; 3. SoftPwm is not required and not working\n            sketches-exclude:\n              WiiClassicJoystick\n              BasicUsage,DigisparkOLED,DigiUSB2LCD\n              SoftPwm13Pins,TinySoftPwmDemo\n              DigisparkUSBDemo ArduinoNunchukDemo DigisparkJoystickDemo # Nunchuck library: incompatible I2C Hardware, the original library uses TinyWireM library\n      # Do not cancel all jobs / architectures if one job fails\n      fail-fast: false\n\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n\n      - name: Use this repo as Arduino core\n        run: |\n          mkdir --parents $HOME/.arduino15/packages/digistump/hardware/avr/0.0.7 # dummy release number\n          ln -s $GITHUB_WORKSPACE/digistump-avr/* $HOME/.arduino15/packages/digistump/hardware/avr/0.0.7\n\n      - name: Compile all examples\n        uses: ArminJo/arduino-test-compile@master\n        with:\n          arduino-board-fqbn: digistump:avr:digispark-tiny\n          arduino-platform: digistump:avr,arduino:avr # we require the C compiler from it. See dependencies of package_digistump_index.json\n          sketches-exclude: ${{ matrix.sketches-exclude }}\n          sketch-names: \"*.ino\"\n          sketch-names-find-start: digistump-avr/libraries/*/examples/\n```\n\n## Multiple boards with parameter using the **script directly**\n**This is not longer required since version v3.0.0.**\n\n```yaml\nname: LibraryBuild\non:\n  push: # see: https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request\n    paths:\n    - '**.ino'\n    - '**.cpp'\n    - '**.h'\n    - '**LibraryBuild.yml'\n  pull_request:\njobs:\n  build:\n    name: ${{ matrix.arduino-boards-fqbn }} - test compiling examples\n    runs-on: ubuntu-latest\n    env:\n      PLATFORM_DEFAULT_URL: https://arduino.esp8266.com/stable/package_esp8266com_index.json\n      REQUIRED_LIBRARIES: Adafruit NeoPixel,Servo\n    strategy:\n      matrix:\n        arduino-boards-fqbn:\n          - arduino:avr:uno\n          - arduino:avr:uno|All-DEBUG\n          - arduino:avr:uno|trace\n          - esp8266:esp8266:huzzah:eesz=4M3M,xtal=80\n\n        include:\n          - arduino-boards-fqbn: arduino:avr:uno\n            sketch-names: WhistleSwitch.ino,SimpleFrequencyDetector.ino # Comma separated list of sketch names (no path required) or patterns to use in build\n            build-properties:\n              WhistleSwitch:\n                -DDEBUG\n                -DFREQUENCY_RANGE_LOW\n              SimpleFrequencyDetector:\n                -DINFO\n\n          - arduino-boards-fqbn: arduino:avr:uno|All-DEBUG # Uno board with -DDEBUG for all examples\n            sketches-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build\n            build-properties:\n              All:\n                -DDEBUG\n\n          - arduino-boards-fqbn: arduino:avr:uno|trace # Uno board with different build properties\n            sketches-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build\n            build-properties:\n              WhistleSwitch:\n                -DDEBUG\n                -DTRACE\n\n          - arduino-boards-fqbn: esp8266:esp8266:huzzah:eesz=4M3M,xtal=80\n            sketches-exclude: WhistleSwitch,50Hz,SimpleFrequencyDetector\n\n      fail-fast: false\n\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n      - name: Compile all examples using the bash script arduino-test-compile.sh\n        env:\n          # Passing parameters to the script by setting the appropriate ENV_* variables.\n          ENV_ARDUINO_BOARD_FQBN: ${{ matrix.arduino-boards-fqbn }}\n          ENV_PLATFORM_DEFAULT_URL: ${{ env.PLATFORM_DEFAULT_URL }}\n          ENV_PLATFORM_URL: ${{ matrix.platform-url }}\n          ENV_REQUIRED_LIBRARIES: ${{ env.REQUIRED_LIBRARIES }}\n          ENV_SKETCHES_EXCLUDE: ${{ matrix.sketches-exclude }}\n          ENV_BUILD_PROPERTIES: ${{ toJson(matrix.build-properties) }}\n          ENV_SKETCH_NAMES: ${{ matrix.sketch-names }}\n          ENV_SKETCH_NAMES_FIND_START: examples/ # Not really required here, but serves as an usage example.\n        run: |\n          wget --quiet https://raw.githubusercontent.com/ArminJo/arduino-test-compile/master/arduino-test-compile.sh\n          chmod +x arduino-test-compile.sh\n          ./arduino-test-compile.sh\n```\n\nSamples for using action in workflow:\n- The simple example from above. LightweightServo [![Build Status](https://github.com/ArminJo/LightweightServo/workflows/LibraryBuild/badge.svg)](https://github.com/ArminJo/LightweightServo/blob/master/.github/workflows/LibraryBuild.yml)\n- One sketch, one library. Simple-DSO [![Build Status](https://github.com/ArminJo/Arduino-Simple-DSO/workflows/TestCompile/badge.svg)](https://github.com/ArminJo/Arduino-Simple-DSO/blob/master/.github/workflows/TestCompile.yml)\n- Arduino library, only arduino:avr boards. Talkie [![Build Status](https://github.com/ArminJo/Talkie/workflows/LibraryBuild/badge.svg)](https://github.com/ArminJo/Talkie/blob/master/.github/workflows/LibraryBuild.yml)\n- Arduino library, 2 boards, script used. Arduino-FrequencyDetector [![Build Status](https://github.com/ArminJo/Arduino-FrequencyDetector/workflows/LibraryBuildWithScript/badge.svg)](https://github.com/ArminJo/Arduino-FrequencyDetector/blob/master/.github/workflows/LibraryBuildWithAction.yml)\n\n- One sketch, one board, multiple options. RobotCar [![Build Status](https://github.com/ArminJo/Arduino-RobotCar/workflows/TestCompile/badge.svg)](https://github.com/ArminJo/Arduino-RobotCar/blob/master/.github/workflows/TestCompile.yml)\n- Arduino library, multiple boards. ServoEasing [![Build Status](https://github.com/ArminJo/ServoEasing/workflows/LibraryBuild/badge.svg)](https://github.com/ArminJo/ServoEasing/blob/master/.github/workflows/LibraryBuild.yml)\n- Arduino library, multiple boards. NeoPatterns [![Build Status](https://github.com/ArminJo/NeoPatterns/workflows/LibraryBuild/badge.svg)](https://github.com/ArminJo/NeoPatterns/blob/master/.github/workflows/LibraryBuild.yml)\n- Arduino core. DigistumpArduino [![TestCompile](https://github.com/ArminJo/DigistumpArduino/workflows/TestCompile/badge.svg)](https://github.com/ArminJo/DigistumpArduino/actions)\n\n# Revision History\n### Version v3.4.0\n- Automatic conversion of `build-properties` parameter from `-DDEBUG` to `'{ \"All\": \"-DDEBUG\" }'`.\n\n### Version v3.3.0\n- The suffix `@latest` is always removed from specified `arduino-platform`.\n- Early exit on platform install error as suggested by *tobozo*.\n\n### Version v3.2.1\n- Merged #26, which fixes filename problems, especially with filenames with multiple dots.\n- Extended debug output.\n\n### Version v3.2.0\n- Added parameter `extra-arduino-lib-install-args`.\n\n### Version v3.1.0\n- Suppress check for platform-url if core was manually installed before.\n- Changed deprecated arduino-cli parameter build-properties to build-property. The build-properties parameter of the action is unaffected.\n- Added parameter `extra-arduino-cli-args`.\n\n### Version v3.0.0\n- Converted from a \"Docker action\" to a much faster \"composite run steps\" action.\n- Removed deprecated parameter `examples-exclude` and `examples-build-properties` from action definition.\n\n### Version v2.6.0\n- Renamed `examples-exclude` to `sketches-exclude`. Old name is still valid.\n- Renamed `examples-build-properties` to `build-properties`. Old name is still valid.\n- Fixed print cli version bug.\n\n### Version v2.5.0 -\u003e Due to a Github failure/outage on 13.07.2020 the old 2.5.0 version from 10.07.20 (and 2.5.1 from 12.07.20 ) was removed.\n- Fixed skipped compile of examples, if one *.ino file is present in the repository root.\n- `examples-build-properties` now used also for **c and S* extra_flags.\n- Improved error and debug flags handling.\n- Added `set-build-path`.\n\n### Version v2.4.1\n- Only search for files when using `sketch-names`.\n\n### Version v2.4.0\n- Added parameter `sketch-names-find-start` to compile multiple libraries.\n- Added parameter `platform-default-url` to ease compiling for multiple boards of the same architecture.\n- Suppress warnings for install python and pip for ESP32.\n- Added debug parameters\n\n### Version v2.3.0\n- Support for custom libraries.\n\n### Version v2.2.0\n- Using ubuntu:18.04 for Docker container, since ubuntu:latest can not fetch python for ESP32 anymore.\n- `CPP_EXTRA_FLAGS` are now reseted.\n\n### Version v2.1.0 -\u003e as of 30.4.2020 internally upgraded to content of v2.2.0, because of ESP32 compile bug\n- Added missing newline after print of \"Install libraries $REQUIRED_LIBRARIES\".\n- Added semantic for example name `All` in `examples-build-properties`.\n\n### Version v2.0.0 -\u003e as of 30.4.2020 internally upgraded to content of v2.2.0, because of ESP32 compile bug\n- Changed `required-libraries` from **space** to **comma** separated list.\n- Renamed parameter `sketch-name` to `sketch-names` to enable comma separated list.\n- Accept comma separated list for `examples-exclude`.\n- Updated documentation. \n\n### Version v1.1.0 -\u003e as of 30.4.2020 internally upgraded to content of v2.2.0, because of ESP32 compile bug\n- Renamed parameter `libraries` to `required-libraries`.\n- Renamed script.\n- Script instead of action can be used in steps.\n- Added parameter `arduino-platform` to enable specifying the version of the required platform.\n\n### Version v1.0.0\n- Initial tested version.\n\n## Requests for modifications / extensions\nPlease write me a PM including your motivation/problem if you need a modification or an extension.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farminjo%2Farduino-test-compile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farminjo%2Farduino-test-compile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farminjo%2Farduino-test-compile/lists"}