Skip to content

Commit

Permalink
Renaming parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
ArminJo committed Jul 14, 2020
1 parent 0d2e989 commit e318067
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 75 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/arduino-test-compile-ActionTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- arduino:avr:uno
- arduino:avr:uno|trace
- arduino:avr:uno|All-DEBUG
- digistump:avr:digispark-tiny1
- digistump:avr:digispark-tiny:clock=clock1
- ATTinyCore:avr:attinyx5:chip=85,clock=1internal
- esp8266:esp8266:huzzah:eesz=4M3M,xtal=80
- esp32:esp32:featheresp32:FlashFreq=80
Expand All @@ -54,49 +54,49 @@ jobs:
#############################################################################################################
include:
- arduino-boards-fqbn: arduino:avr:uno
examples-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build
examples-build-properties:
sketches-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build
build-properties:
WhistleSwitch:
-DDEBUG
-DFREQUENCY_RANGE_LOW
SimpleFrequencyDetector:
-DINFO

- arduino-boards-fqbn: arduino:avr:uno|All-DEBUG # UNO board with -DDEBUG for all examples
examples-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build
examples-build-properties:
sketches-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build
build-properties:
All:
-DDEBUG

- arduino-boards-fqbn: arduino:avr:uno|trace # UNO board with different build properties
arduino-platform: arduino:[email protected]
examples-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build
examples-build-properties:
sketches-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build
build-properties:
WhistleSwitch:
-DDEBUG
-DTRACE

- arduino-boards-fqbn: digistump:avr:digispark-tiny1 # ATtiny85 board @1 MHz
- arduino-boards-fqbn: digistump:avr:digispark-tiny:clock=clock1 # ATtiny85 board @1 MHz
platform-url: https://raw.githubusercontent.com/ArminJo/DigistumpArduino/master/package_digistump_index.json
examples-exclude: WhistleSwitch,"Blink" # Comma separated list of (unique substrings of) example names to exclude in build
sketches-exclude: WhistleSwitch,"Blink" # Comma separated list of (unique substrings of) example names to exclude in build

- arduino-boards-fqbn: ATTinyCore:avr:attinyx5:chip=85,clock=1internal
arduino-platform: digistump:avr,ATTinyCore:avr
platform-url: http://drazzy.com/package_drazzy.com_index.json,https://raw.githubusercontent.com/ArminJo/DigistumpArduino/master/package_digistump_index.json

examples-build-properties:
build-properties:
WhistleSwitch:
-DFREQUENCY_RANGE_LOW

- arduino-boards-fqbn: esp8266:esp8266:huzzah:eesz=4M3M,xtal=80
#"<URL> <URL>" whis space as separator is deprecated but works also
#platform-url: "https://arduino.esp8266.com/stable/package_esp8266com_index.json https://raw.githubusercontent.com/ArminJo/DigistumpArduino/master/package_digistump_index.json"
platform-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json
examples-exclude: WhistleSwitch,50Hz,SimpleFrequencyDetector
sketches-exclude: WhistleSwitch,50Hz,SimpleFrequencyDetector

- arduino-boards-fqbn: esp32:esp32:featheresp32:FlashFreq=80
platform-url: https://dl.espressif.com/dl/package_esp32_index.json
examples-exclude: WhistleSwitch,50Hz,SimpleFrequencyDetector
sketches-exclude: WhistleSwitch,50Hz,SimpleFrequencyDetector

# Do not cancel all jobs / architectures if one job fails
fail-fast: false
Expand All @@ -120,8 +120,8 @@ jobs:
arduino-platform: ${{ matrix.arduino-platform }}
platform-url: ${{ matrix.platform-url }}
required-libraries: ${{ env.REQUIRED_LIBRARIES }}
examples-exclude: ${{ matrix.examples-exclude }}
examples-build-properties: ${{ toJson(matrix.examples-build-properties) }}
sketches-exclude: ${{ matrix.sketches-exclude }}
examples-build-properties: ${{ toJson(matrix.build-properties) }}
sketch-names:
WhistleSwitch.ino,
50Hz.ino,
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/arduino-test-compile-ScriptTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,57 +43,57 @@ jobs:
- arduino:avr:uno
- arduino:avr:uno|trace
- arduino:avr:uno|All-DEBUG
- digistump:avr:digispark-tiny1
- digistump:avr:digispark-tiny:clock=clock1
- ATTinyCore:avr:attinyx5:chip=85,clock=1internal
- esp8266:esp8266:huzzah:eesz=4M3M,xtal=80
- esp32:esp32:featheresp32:FlashFreq=80

# Specify parameters for each board.
# Parameters can be: examples-exclude and examples-build-properties
# Parameters can be: sketches-exclude and build-properties
#############################################################################################################
include:
- arduino-boards-fqbn: arduino:avr:uno
examples-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build
examples-build-properties:
sketches-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build
build-properties:
WhistleSwitch:
-DDEBUG
-DFREQUENCY_RANGE_LOW
SimpleFrequencyDetector:
-DINFO

- arduino-boards-fqbn: arduino:avr:uno|All-DEBUG # UNO board with -DDEBUG for all examples
examples-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build
examples-build-properties:
sketches-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build
build-properties:
All:
-DDEBUG

- arduino-boards-fqbn: arduino:avr:uno|trace # UNO board with different build properties
examples-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build
examples-build-properties:
sketches-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build
build-properties:
WhistleSwitch:
-DDEBUG
-DTRACE

- arduino-boards-fqbn: digistump:avr:digispark-tiny1 # ATtiny85 board @1 MHz
- arduino-boards-fqbn: digistump:avr:digispark-tiny:clock=clock1 # ATtiny85 board @1 MHz
platform-url: https://raw.githubusercontent.com/ArminJo/DigistumpArduino/master/package_digistump_index.json
examples-exclude: WhistleSwitch,"Blink" # Comma separated list of (unique substrings of) example names to exclude in build
examples-build-properties:
sketches-exclude: WhistleSwitch,"Blink" # Comma separated list of (unique substrings of) example names to exclude in build
build-properties:
SimpleFrequencyDetector:
-DINFO

- arduino-boards-fqbn: ATTinyCore:avr:attinyx5:chip=85,clock=1internal
platform-url: http://drazzy.com/package_drazzy.com_index.json
examples-build-properties:
build-properties:
WhistleSwitch:
-DFREQUENCY_RANGE_LOW

- arduino-boards-fqbn: esp8266:esp8266:huzzah:eesz=4M3M,xtal=80
platform-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json
examples-exclude: WhistleSwitch,50Hz,SimpleFrequencyDetector
sketches-exclude: WhistleSwitch,50Hz,SimpleFrequencyDetector

- arduino-boards-fqbn: esp32:esp32:featheresp32:FlashFreq=80
platform-url: https://dl.espressif.com/dl/package_esp32_index.json
examples-exclude: WhistleSwitch,50Hz,SimpleFrequencyDetector
sketches-exclude: WhistleSwitch,50Hz,SimpleFrequencyDetector

# Do not cancel all jobs / architectures if one job fails
fail-fast: false
Expand All @@ -116,8 +116,8 @@ jobs:
ENV_ARDUINO_BOARD_FQBN: ${{ matrix.arduino-boards-fqbn }}
ENV_PLATFORM_URL: ${{ matrix.platform-url }}
ENV_REQUIRED_LIBRARIES: ${{ env.REQUIRED_LIBRARIES }}
ENV_EXAMPLES_EXCLUDE: ${{ matrix.examples-exclude }}
ENV_EXAMPLES_BUILD_PROPERTIES: ${{ toJson(matrix.examples-build-properties) }}
ENV_SKETCHES_EXCLUDE: ${{ matrix.sketches-exclude }}
ENV_BUILD_PROPERTIES: ${{ toJson(matrix.build-properties) }}
ENV_SKETCH_NAMES: "*.ino"
ENV_SKETCH_NAMES_FILE_START: .
ENV_SAVE_GENERATED_FILES: true
Expand Down
64 changes: 34 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# arduino-test-compile [action](https://github.com/marketplace/actions/test-compile-for-arduino) / script
### Version 2.5.2
### Version 2.6.0

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://spdx.org/licenses/MIT.html)
[![Build Status](https://github.com/ArminJo/arduino-test-compile/workflows/arduino-test-compile-ActionTest/badge.svg)](https://github.com/ArminJo/arduino-test-compile/actions)
Expand Down Expand Up @@ -90,31 +90,31 @@ required-libraries: Servo,Adafruit [email protected]
Comma separated list without double quotes around the list or a library name. A list of correct library names can be found [here](https://www.arduinolibraries.info/).


### `examples-exclude`
Examples to be **excluded from build**. Comma or space separated list of complete sketch / example names to exclude in build.<br/>
Environment name for script usage is `ENV_EXAMPLES_EXCLUDE`.
### `sketches-exclude`
Sketches to be **excluded from build**. Comma or space separated list of complete sketch / example names to exclude in build.<br/>
Environment name for script usage is `ENV_SKETCHES_EXCLUDE`.

```yaml
examples-exclude: QuadrupedControl,RobotArmControl # QuadrupedControl and RobotArmControl because of missing EEprom
sketches-exclude: QuadrupedControl,RobotArmControl # QuadrupedControl and RobotArmControl because of missing EEprom
```

### `examples-build-properties`
### `build-properties`
Build parameter like `-DDEBUG` for each example specified or for all examples, if example name is `All`. If an example specific parameter is specified, the value for All is ignored for this example. <br/>
Environment name for script usage is `ENV_EXAMPLES_BUILD_PROPERTIES`.<br/>
Environment name for script usage is `ENV_BUILD_PROPERTIES`.<br/>

In the `include:` section you may specify:

```yaml
include:
...
examples-build-properties:
build-properties:
WhistleSwitch:
-DDEBUG
-DFREQUENCY_RANGE_LOW
SimpleFrequencyDetector:
-DINFO
...
examples-build-properties:
build-properties:
All:
-DDEBUG
...
Expand All @@ -124,14 +124,14 @@ and reference it in the `with:` section by:

```yaml
with:
examples-build-properties: ${{ toJson(matrix.examples-build-properties) }}
build-properties: ${{ toJson(matrix.build-properties) }}
```

If you want to specify it directly in the `with:` section it must be:

```yaml
with:
examples-build-properties: '{ "WhistleSwitch": "-DDEBUG -DFREQUENCY_RANGE_LOW", "SimpleFrequencyDetector": "-DINFO", "All": "-DDEBUG" }'
build-properties: '{ "WhistleSwitch": "-DDEBUG -DFREQUENCY_RANGE_LOW", "SimpleFrequencyDetector": "-DINFO", "All": "-DDEBUG" }'
```

### `cli-version`
Expand Down Expand Up @@ -216,8 +216,8 @@ jobs:
arduino-board-fqbn: esp8266:esp8266:huzzah:eesz=4M3M,xtal=80
platform-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json
required-libraries: Servo,Adafruit NeoPixel
examples-exclude: WhistleSwitch 50Hz
examples-build-properties: '{ "WhistleSwitch": "-DDEBUG -DFREQUENCY_RANGE_LOW", "SimpleFrequencyDetector": "-DINFO" }'
sketches-exclude: WhistleSwitch 50Hz
build-properties: '{ "WhistleSwitch": "-DDEBUG -DFREQUENCY_RANGE_LOW", "SimpleFrequencyDetector": "-DINFO" }'
```

## One board with 2x2 compile parameter matrix
Expand Down Expand Up @@ -258,7 +258,7 @@ jobs:
arduino-board-fqbn: ${{ matrix.arduino-boards-fqbn }}
platform-url: ${{ matrix.platform-url }}
required-libraries: ${{ env.REQUIRED_LIBRARIES }}
examples-build-properties: '{ "All": "${{ matrix.log-options }} ${{ matrix.other-options }}" }'
build-properties: '{ "All": "${{ matrix.log-options }} ${{ matrix.other-options }}" }'
```

Expand Down Expand Up @@ -291,28 +291,28 @@ jobs:
include:
- arduino-boards-fqbn: arduino:avr:uno
sketch-names: WhistleSwitch.ino,SimpleFrequencyDetector.ino # Comma separated list of sketch names (no path required) or patterns to use in build
examples-build-properties:
build-properties:
WhistleSwitch:
-DDEBUG
-DFREQUENCY_RANGE_LOW
SimpleFrequencyDetector:
-DINFO
- arduino-boards-fqbn: arduino:avr:uno|All-DEBUG # UNO board with -DDEBUG for all examples
examples-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build
examples-build-properties:
sketches-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build
build-properties:
All:
-DDEBUG
- arduino-boards-fqbn: arduino:avr:uno|trace # UNO board with different build properties
examples-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build
examples-build-properties:
sketches-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build
build-properties:
WhistleSwitch:
-DDEBUG
-DTRACE
- arduino-boards-fqbn: esp8266:esp8266:huzzah:eesz=4M3M,xtal=80
examples-exclude: WhistleSwitch,50Hz,SimpleFrequencyDetector
sketches-exclude: WhistleSwitch,50Hz,SimpleFrequencyDetector
fail-fast: false
Expand All @@ -328,8 +328,8 @@ jobs:
platform-url: ${{ matrix.platform-url }}
required-libraries: ${{ env.REQUIRED_LIBRARIES }}
sketch-names: ${{ matrix.sketch-names }}
examples-exclude: ${{ matrix.examples-exclude }}
examples-build-properties: ${{ toJson(matrix.examples-build-properties) }}
sketches-exclude: ${{ matrix.sketches-exclude }}
build-properties: ${{ toJson(matrix.build-properties) }}
```

## Multiple boards with parameter using the **script directly**
Expand Down Expand Up @@ -363,28 +363,28 @@ jobs:
include:
- arduino-boards-fqbn: arduino:avr:uno
sketch-names: WhistleSwitch.ino,SimpleFrequencyDetector.ino # Comma separated list of sketch names (no path required) or patterns to use in build
examples-build-properties:
build-properties:
WhistleSwitch:
-DDEBUG
-DFREQUENCY_RANGE_LOW
SimpleFrequencyDetector:
-DINFO
- arduino-boards-fqbn: arduino:avr:uno|All-DEBUG # UNO board with -DDEBUG for all examples
examples-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build
examples-build-properties:
sketches-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build
build-properties:
All:
-DDEBUG
- arduino-boards-fqbn: arduino:avr:uno|trace # UNO board with different build properties
examples-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build
examples-build-properties:
sketches-exclude: 50Hz # Comma separated list of (unique substrings of) example names to exclude in build
build-properties:
WhistleSwitch:
-DDEBUG
-DTRACE
- arduino-boards-fqbn: esp8266:esp8266:huzzah:eesz=4M3M,xtal=80
examples-exclude: WhistleSwitch,50Hz,SimpleFrequencyDetector
sketches-exclude: WhistleSwitch,50Hz,SimpleFrequencyDetector
fail-fast: false
Expand All @@ -398,8 +398,8 @@ jobs:
ENV_PLATFORM_DEFAULT_URL: ${{ env.PLATFORM_DEFAULT_URL }}
ENV_PLATFORM_URL: ${{ matrix.platform-url }}
ENV_REQUIRED_LIBRARIES: ${{ env.REQUIRED_LIBRARIES }}
ENV_EXAMPLES_EXCLUDE: ${{ matrix.examples-exclude }}
ENV_EXAMPLES_BUILD_PROPERTIES: ${{ toJson(matrix.examples-build-properties) }}
ENV_SKETCHES_EXCLUDE: ${{ matrix.sketches-exclude }}
ENV_BUILD_PROPERTIES: ${{ toJson(matrix.build-properties) }}
ENV_SKETCH_NAMES: ${{ matrix.sketch-names }}
ENV_SKETCH_NAMES_FILE_START: examples/ # Not really required here, but serves as an usage example.
run: |
Expand Down Expand Up @@ -465,6 +465,10 @@ Samples for using `arduino-test-compile.sh script` instead of `ArminJo/arduino-t

# Revision History

### Version v2.6.0
- Renamed `examples-exclude` to `sketches-exclude`. Old name is still valid.
- Renamed `examples-build-properties` to `build-properties`. Old name is still valid.

### Version v2.5.0 -> 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.
- Fixed skipped compile of examples, if one *.ino file is present in the repository root.
- `examples-build-properties` now used also for **c and S* extra_flags.
Expand Down
16 changes: 15 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,29 @@ inputs:
required: false

examples-exclude:
description: 'Deprecated in favor of sketches-exclude. Comma or space separated list of complete names of all sketches / examples to be excluded in the build for this board.'
default: ''
required: false

sketches-exclude:
description: 'Comma or space separated list of complete names of all sketches / examples to be excluded in the build for this board.'
default: ''
required: false

examples-build-properties:
description: |
Build parameter like -DDEBUG for each example specified or for all examples, if example name is "All". In json format.
Deprecated in favor of build-properties. Build parameter like -DDEBUG for each example specified or for all examples, if example name is "All". In json format.
For example: examples-build-properties: '{ "WhistleSwitch": "-DDEBUG -DFREQUENCY_RANGE_LOW", "SimpleFrequencyDetector": "-DINFO" }'
default: ''
required: false

build-properties:
description: |
Build parameter like -DDEBUG for each example specified or for all examples, if example name is "All". In json format.
For example: build-properties: '{ "WhistleSwitch": "-DDEBUG -DFREQUENCY_RANGE_LOW", "SimpleFrequencyDetector": "-DINFO" }'
default: ''
required: false

set-build-path:
description: 'Flag to set the build directory (arduino-cli paramer --build-path) to /build subdirectory of compiled example.'
default: 'false'
Expand Down Expand Up @@ -82,7 +94,9 @@ runs:
- ${{ inputs.platform-default-url }}
- ${{ inputs.platform-url }}
- ${{ inputs.required-libraries }}
- ${{ inputs.sketches-exclude }}
- ${{ inputs.examples-exclude }}
- ${{ inputs.build-properties }}
- ${{ inputs.examples-build-properties }}
- ${{ inputs.set-build-path }}
- ${{ inputs.debug-compile }}
Expand Down
Loading

0 comments on commit e318067

Please sign in to comment.