Skip to content

Commit

Permalink
Added parameter extra-arduino-lib-install-args
Browse files Browse the repository at this point in the history
  • Loading branch information
ArminJo committed Oct 20, 2021
1 parent 62b42a5 commit f62f016
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 7 deletions.
20 changes: 18 additions & 2 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 3.1.0
### Version 3.2.0

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://spdx.org/licenses/MIT.html)
[![Commits since latest](https://img.shields.io/github/commits-since/ArminJo/arduino-test-compile/latest)](https://github.com/ArminJo/arduino-test-compile/commits/master)
Expand Down Expand Up @@ -166,13 +166,26 @@ strategy:
...
steps:
- name: Arduino build
uses: ArminJo/arduino-test-compile@2e04e8c
uses: ArminJo/arduino-test-compile@master
with:
...
arduino-board-fqbn: ${{ matrix.arduino-board-fqbn }}
extra-arduino-cli-args: ${{ matrix.extra-arduino-cli-args }}
```

### `extra-arduino-lib-install-args`
This 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.

```yaml
steps:
- name: Arduino build
uses: ArminJo/arduino-test-compile@v3
with:
...
arduino-board-fqbn: ${{ matrix.arduino-board-fqbn }}
extra-arduino-lib-install-args: "--no-deps"
```

### `cli-version`
The version of `arduino-cli` to use.<br/>
Default is `latest`.<br/>
Expand Down Expand Up @@ -548,6 +561,9 @@ Samples for using action in workflow:
- Arduino core. DigistumpArduino [![TestCompile](https://github.com/ArminJo/DigistumpArduino/workflows/TestCompile/badge.svg)](https://github.com/ArminJo/DigistumpArduino/actions)

# Revision History
### Version v3.2.0
- Added parameter `extra-arduino-lib-install-args`.

### Version v3.1.0
- Suppress check for platform-url if core was manually installed before.
- Changed deprecated arduino-cli parameter build-properties to build-property. The build-properties parameter of the action is unaffected.
Expand Down
8 changes: 8 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ inputs:
default: ''
required: false

extra-arduino-lib-install-args:
description: |
This 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.
default: ''
required: false

set-build-path:
description: 'Flag to set the build directory (arduino-cli paramer --build-path) to /build subdirectory of compiled sketches.'
default: 'false'
Expand Down Expand Up @@ -95,6 +102,7 @@ runs:
ENV_SKETCHES_EXCLUDE: ${{ inputs.sketches-exclude }}
ENV_BUILD_PROPERTIES: ${{ inputs.build-properties }}
ENV_EXTRA_ARDUINO_CLI_ARGS: ${{ inputs.extra-arduino-cli-args }}
ENV_EXTRA_ARDUINO_LIB_INSTALL_ARGS: ${{ inputs.extra-arduino-lib-install-args }}
ENV_SET_BUILD_PATH: ${{ inputs.set-build-path }}
ENV_DEBUG_COMPILE: ${{ inputs.debug-compile }}
ENV_DEBUG_INSTALL: ${{ inputs.debug-install }}
Expand Down
13 changes: 8 additions & 5 deletions arduino-test-compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ EXAMPLES_EXCLUDE="${10}"
BUILD_PROPERTIES="${11}"
EXAMPLES_BUILD_PROPERTIES="${12}"
EXTRA_ARDUINO_CLI_ARGS="${13}"
SET_BUILD_PATH="${14}"
DEBUG_COMPILE="${15}"
DEBUG_INSTALL="${16}"
EXTRA_ARDUINO_LIB_INSTALL_ARGS="${14}"
SET_BUILD_PATH="${15}"
DEBUG_COMPILE="${16}"
DEBUG_INSTALL="${17}"

readonly RED='\033[0;31m'
readonly GREEN='\033[0;32m'
Expand All @@ -47,6 +48,7 @@ if [[ -n $ENV_EXAMPLES_EXCLUDE ]]; then EXAMPLES_EXCLUDE=$ENV_EXAMPLES_EXCLUDE;
if [[ -n $ENV_BUILD_PROPERTIES ]]; then BUILD_PROPERTIES=$ENV_BUILD_PROPERTIES; fi
if [[ -n $ENV_EXAMPLES_BUILD_PROPERTIES ]]; then EXAMPLES_BUILD_PROPERTIES=$ENV_EXAMPLES_BUILD_PROPERTIES; fi #deprecated
if [[ -n $ENV_EXTRA_ARDUINO_CLI_ARGS ]]; then EXTRA_ARDUINO_CLI_ARGS=$ENV_EXTRA_ARDUINO_CLI_ARGS; fi
if [[ -n $ENV_EXTRA_ARDUINO_LIB_INSTALL_ARGS ]]; then EXTRA_ARDUINO_LIB_INSTALL_ARGS=$ENV_EXTRA_ARDUINO_LIB_INSTALL_ARGS; fi
if [[ -n $ENV_SET_BUILD_PATH ]]; then SET_BUILD_PATH=$ENV_SET_BUILD_PATH; fi

if [[ -n $ENV_DEBUG_COMPILE ]]; then DEBUG_COMPILE=$ENV_DEBUG_COMPILE; fi
Expand Down Expand Up @@ -85,6 +87,7 @@ echo REQUIRED_LIBRARIES=$REQUIRED_LIBRARIES
echo SKETCHES_EXCLUDE=$SKETCHES_EXCLUDE
echo BUILD_PROPERTIES=$BUILD_PROPERTIES
echo EXTRA_ARDUINO_CLI_ARGS=$EXTRA_ARDUINO_CLI_ARGS
echo EXTRA_ARDUINO_LIB_INSTALL_ARGS=$EXTRA_ARDUINO_LIB_INSTALL_ARGS
echo SET_BUILD_PATH=$SET_BUILD_PATH

echo DEBUG_COMPILE=$DEBUG_COMPILE
Expand Down Expand Up @@ -262,9 +265,9 @@ else
declare -a REQUIRED_LIBRARIES_ARRAY=( $REQUIRED_LIBRARIES )
IFS="$BACKUP_IFS"
if [[ $DEBUG_INSTALL == true ]]; then
arduino-cli lib install "${REQUIRED_LIBRARIES_ARRAY[@]}"
arduino-cli lib install "${REQUIRED_LIBRARIES_ARRAY[@]}" $EXTRA_ARDUINO_LIB_INSTALL_ARGS
else
arduino-cli lib install "${REQUIRED_LIBRARIES_ARRAY[@]}" >/dev/null 2>&1
arduino-cli lib install "${REQUIRED_LIBRARIES_ARRAY[@]}" $EXTRA_ARDUINO_LIB_INSTALL_ARGS >/dev/null 2>&1
fi
if [[ $? -ne 0 ]]; then
echo "::error::Installation of $REQUIRED_LIBRARIES failed"
Expand Down

0 comments on commit f62f016

Please sign in to comment.