Skip to content

Commit

Permalink
Fixed scripts: install_yamlpath.* and install_arduino_cores.*.
Browse files Browse the repository at this point in the history
  • Loading branch information
end2endzone committed Aug 3, 2024
1 parent d77aa3a commit 25bc6f0
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 45 deletions.
3 changes: 1 addition & 2 deletions ci/github/install_yamlpath.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ if [ "$GITHUB_WORKSPACE" = "" ]; then
fi

# Call matching script for linux
# and execute the script under the current shell instead of loading another one
this_filename=`basename "$0"`
. $GITHUB_WORKSPACE/ci/linux/$this_filename
$GITHUB_WORKSPACE/ci/linux/$this_filename
7 changes: 7 additions & 0 deletions ci/linux/install_arduino_cores.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Any commands which fail will cause the shell script to exit immediately
set -e

# Check Arduino CLI installation
echo Expecting Arduino IDE installed in directory: $ARDUINO_CLI_INSTALL_DIR
echo Searching for arduino cli executable...
export PATH=$PATH:$ARDUINO_CLI_INSTALL_DIR
which arduino-cli
echo

# Set arduino-cli config file path
export ARDUINO_CONFIG_PATH="/home/$USER/.arduino15/arduino-cli.yaml"
echo ARDUINO_CONFIG_PATH set to '$ARDUINO_CONFIG_PATH'
Expand Down
57 changes: 14 additions & 43 deletions ci/linux/install_yamlpath.sh
Original file line number Diff line number Diff line change
@@ -1,53 +1,24 @@
# Any commands which fail will cause the shell script to exit immediately
set -e

# Set download filename
export ARDUINO_CLI_FILENAME=""
if [ "$RUNNER_OS" = "Linux" ]; then
export ARDUINO_CLI_FILENAME=arduino-cli_latest_Linux_64bit.tar.gz
elif [ "$RUNNER_OS" = "macOS" ]; then
export ARDUINO_CLI_FILENAME=arduino-cli_latest_macOS_64bit.tar.gz
fi
# Install yamlpath.
# https://github.com/wwkimball/yamlpath
# https://pypi.org/project/yamlpath/

# Download
echo Downloading file https://downloads.arduino.cc/arduino-cli/$ARDUINO_CLI_FILENAME
wget --no-verbose https://downloads.arduino.cc/arduino-cli/$ARDUINO_CLI_FILENAME
echo
echo

# Installing
export ARDUINO_CLI_INSTALL_DIR=$HOME/arduino-cli
echo Installing Arduino CLI to directory: $ARDUINO_CLI_INSTALL_DIR
mkdir -p $ARDUINO_CLI_INSTALL_DIR
tar xf $ARDUINO_CLI_FILENAME --directory $ARDUINO_CLI_INSTALL_DIR
echo
echo

# Verify
echo Searching for arduino cli executable...
export PATH=$PATH:$ARDUINO_CLI_INSTALL_DIR
which arduino-cli
arduino-cli version
echo
# Validate if python launcher is installed
which py.exe
echo Found python interpreter
python --version
echo

echo Initialize configuration file
# Expecting something like: Config file written: /home/$USER/.arduino15/arduino-cli.yaml
arduino-cli config init
echo
echo

echo Installing "arduino:avr" core...
arduino-cli core install "arduino:avr"
echo
# Validate if pip is installed
which pip.exe
echo

echo Installing "esp8266:esp8266" core...
arduino-cli core install "esp8266:esp8266"
# Installing yamlpath.
echo Proceeding with instaling yamlpath...
pip install yamlpath
echo
echo

if %errorlevel% neq 0 exit /b %errorlevel%


# Also install esp32:esp32 ?
echo yamlpath was installed on the system without error.
echo.
8 changes: 8 additions & 0 deletions ci/windows/install_arduino_cores.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
@echo off
cd /d %~dp0

:: Check Arduino CLI installation
echo Expecting Arduino CLI installed in directory: %ARDUINO_CLI_INSTALL_DIR%
echo Searching for arduino cli executable...
set PATH=%PATH%;%ARDUINO_CLI_INSTALL_DIR%
where arduino-cli.exe
if %errorlevel% neq 0 exit /b %errorlevel%
echo.

:: Set arduino-cli config file path
set ARDUINO_CONFIG_PATH=C:\Users\%USERNAME%\AppData\Local\Arduino15\arduino-cli.yaml
echo ARDUINO_CONFIG_PATH set to '%ARDUINO_CONFIG_PATH%'
Expand Down
3 changes: 3 additions & 0 deletions ci/windows/install_yamlpath.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ if errorlevel 1 (
)
echo Found python interpreter
python --version
echo.

:: Validate if pip is installed
where pip.exe >NUL 2>NUL
if errorlevel 1 (
echo Command failed. Please install pip ^(Package Installer Python^) to continue.
exit /B %errorlevel%
)
echo.

:: Installing yamlpath.
echo Proceeding with instaling yamlpath...
Expand All @@ -27,6 +29,7 @@ if errorlevel 1 (
echo Command failed. An error was found while installing yamlpath.
exit /B %errorlevel%
)
echo.

echo yamlpath was installed on the system without error.
echo.

0 comments on commit 25bc6f0

Please sign in to comment.