Skip to content

Commit 96180c4

Browse files
committed
add compile action workflows
1 parent 5144bf5 commit 96180c4

File tree

5 files changed

+638
-1
lines changed

5 files changed

+638
-1
lines changed

.github/actions/action.yml

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: 'Test compile for Arduino'
2+
description: 'Compile sketches or Arduino library examples for one board type using arduino-cli and check for errors'
3+
author: 'Armin Joachimsmeyer'
4+
inputs:
5+
cli-version:
6+
description: 'Version of arduino-cli to use when building. Current (8/2022) one is 0.26.0.'
7+
default: 'latest'
8+
required: false
9+
10+
sketch-names:
11+
description: 'Comma sepatated 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.'
12+
default: '*.ino'
13+
required: false
14+
15+
sketch-names-find-start:
16+
description: 'The start directory to look for the sketch-names to test compile. Can be a path like "digistump-avr/libraries/*/examples/C*/" .'
17+
default: '.'
18+
required: false
19+
20+
arduino-board-fqbn:
21+
#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
22+
description: 'Fully Qualified Board Name of the Arduino board. You may add a suffix behind the fqbn with "|" to specify one board for e.g. different compile options like arduino:avr:uno|trace.'
23+
default: 'arduino:avr:uno'
24+
required: false
25+
26+
arduino-platform:
27+
description: 'Comma separated list of platform specifiers, if you require a fixed version like "arduino:[email protected]" or do not want the specifier derived from the 2 first elements of the arduino-board-fqbn or need more than one core. The suffix "@latest" is always removed.'
28+
default: ''
29+
required: false
30+
31+
platform-default-url:
32+
description: 'The platform URL for the required board description if arduino-board-fqbn does not start with "arduino:" and not explicitly specified by platform-url.'
33+
default: ''
34+
required: false
35+
36+
platform-url:
37+
description: 'The platform URL for the required board description if arduino-board-fqbn does not start with "arduino:".'
38+
default: ''
39+
required: false
40+
41+
required-libraries:
42+
description: 'Comma separated list of arduino library names required for compiling the sketches / examples for this board.'
43+
default: ''
44+
required: false
45+
46+
sketches-exclude:
47+
description: 'Comma or space separated list of complete names of all sketches / examples to be excluded in the build for this board.'
48+
default: ''
49+
required: false
50+
51+
build-properties:
52+
description: |
53+
Build parameter like -DDEBUG for each example specified or for all examples, if example name is "All". In json format.
54+
For example: build-properties: '{ "WhistleSwitch": "-DDEBUG -DFREQUENCY_RANGE_LOW", "SimpleFrequencyDetector": "-DINFO" }'
55+
default: ''
56+
required: false
57+
58+
extra-arduino-cli-args:
59+
description: |
60+
This string is passed verbatim without double quotes to the arduino-cli compile commandline as last argument before the filename.
61+
See https://arduino.github.io/arduino-cli/commands/arduino-cli_compile/ for compile parameters.
62+
default: ''
63+
required: false
64+
65+
extra-arduino-lib-install-args:
66+
description: |
67+
This string is passed verbatim without double quotes to the arduino-cli lib install commandline as last argument before the library names.
68+
It can be used e.g. to suppress dependency resolving for libraries by using --no-deps as argument string.
69+
default: ''
70+
required: false
71+
72+
set-build-path:
73+
description: 'Flag to set the build directory (arduino-cli paramer --build-path) to /build subdirectory of compiled sketches.'
74+
default: 'false'
75+
required: false
76+
77+
debug-compile:
78+
description: 'If set to "true" the action logs verbose compile output even during successful builds'
79+
default: ''
80+
required: false
81+
82+
debug-install:
83+
description: 'If set to "true" the action logs verbose arduino-cli output during installation'
84+
default: ''
85+
required: false
86+
87+
runs:
88+
using: 'composite'
89+
steps:
90+
- name: Compile all sketches / examples using the bash script arduino-test-compile.sh
91+
env:
92+
# Passing parameters to the script by setting the appropriate ENV_* variables.
93+
# Direct passing as arguments is not possible because of blanks in the arguments.
94+
ENV_CLI_VERSION: ${{ inputs.cli-version }}
95+
ENV_SKETCH_NAMES: ${{ inputs.sketch-names }}
96+
ENV_SKETCH_NAMES_FIND_START: ${{ inputs.sketch-names-find-start }}
97+
ENV_ARDUINO_BOARD_FQBN: ${{ inputs.arduino-board-fqbn }}
98+
ENV_ARDUINO_PLATFORM: ${{ inputs.arduino-platform }}
99+
ENV_PLATFORM_DEFAULT_URL: ${{ inputs.platform-default-url }}
100+
ENV_PLATFORM_URL: ${{ inputs.platform-url }}
101+
ENV_REQUIRED_LIBRARIES: ${{ inputs.required-libraries }}
102+
ENV_SKETCHES_EXCLUDE: ${{ inputs.sketches-exclude }}
103+
ENV_BUILD_PROPERTIES: ${{ inputs.build-properties }}
104+
ENV_EXTRA_ARDUINO_CLI_ARGS: ${{ inputs.extra-arduino-cli-args }}
105+
ENV_EXTRA_ARDUINO_LIB_INSTALL_ARGS: ${{ inputs.extra-arduino-lib-install-args }}
106+
ENV_SET_BUILD_PATH: ${{ inputs.set-build-path }}
107+
ENV_DEBUG_COMPILE: ${{ inputs.debug-compile }}
108+
ENV_DEBUG_INSTALL: ${{ inputs.debug-install }}
109+
110+
run: ${{ github.action_path }}/arduino-test-compile.sh
111+
shell: bash
112+
113+
branding:
114+
icon: 'eye'
115+
color: 'red'

0 commit comments

Comments
 (0)