diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index 7a5b724..363b2fd 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -74,6 +74,11 @@ jobs: working-directory: ${{env.GITHUB_WORKSPACE}} shell: bash run: ./ci/github/install_arduinocli.sh + + - name: Install Arduino cores + working-directory: ${{env.GITHUB_WORKSPACE}} + shell: bash + run: ./ci/github/install_arduino_cores.sh - name: Install Arduino library dependnecies working-directory: ${{env.GITHUB_WORKSPACE}} diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index 3a19f38..e54917e 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -66,6 +66,11 @@ jobs: working-directory: ${{env.GITHUB_WORKSPACE}} shell: cmd run: call ci\github\install_arduinocli.bat + + - name: Install Arduino cores + working-directory: ${{env.GITHUB_WORKSPACE}} + shell: cmd + run: call ci\github\install_arduino_cores.bat - name: Install Arduino library dependnecies working-directory: ${{env.GITHUB_WORKSPACE}} diff --git a/appveyor.yml b/appveyor.yml index ee1e4a8..5849d4d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -30,6 +30,7 @@ clone_folder: c:\projects\AnyRtttl install: - cmd: call %APPVEYOR_BUILD_FOLDER%\ci\appveyor\install_yamlpath.bat - cmd: call %APPVEYOR_BUILD_FOLDER%\ci\appveyor\install_arduinocli.bat +- cmd: call %APPVEYOR_BUILD_FOLDER%\ci\appveyor\install_arduino_cores.bat - cmd: call %APPVEYOR_BUILD_FOLDER%\ci\appveyor\arduino_install_libraries.bat - cmd: call %APPVEYOR_BUILD_FOLDER%\ci\appveyor\install_this.bat - cmd: call %APPVEYOR_BUILD_FOLDER%\ci\appveyor\install_googletest.bat diff --git a/ci/appveyor/install_arduino_cores.bat b/ci/appveyor/install_arduino_cores.bat new file mode 100644 index 0000000..8664e83 --- /dev/null +++ b/ci/appveyor/install_arduino_cores.bat @@ -0,0 +1,11 @@ +@echo off + +:: Validate appveyor's environment +if "%APPVEYOR_BUILD_FOLDER%"=="" ( + echo Please define 'APPVEYOR_BUILD_FOLDER' environment variable. + exit /B 1 +) + +:: Call matching script for windows +call "%APPVEYOR_BUILD_FOLDER%\ci\windows\%~n0.bat" +if %errorlevel% neq 0 exit /b %errorlevel% diff --git a/ci/github/install_arduino_cores.bat b/ci/github/install_arduino_cores.bat new file mode 100644 index 0000000..539218c --- /dev/null +++ b/ci/github/install_arduino_cores.bat @@ -0,0 +1,15 @@ +@echo off + +:: Validate GitHub CI's environment +if "%GITHUB_WORKSPACE%"=="" ( + echo Please define 'GITHUB_WORKSPACE' environment variable. + exit /B 1 +) + +:: Call matching script for windows +call "%GITHUB_WORKSPACE%\ci\windows\%~n0.bat" +if %errorlevel% neq 0 exit /b %errorlevel% + +:: Remember installation directory +echo Remember ARDUINO_CLI_INSTALL_DIR as %ARDUINO_CLI_INSTALL_DIR% in %GITHUB_ENV% +echo ARDUINO_CLI_INSTALL_DIR=%ARDUINO_CLI_INSTALL_DIR%>> %GITHUB_ENV% diff --git a/ci/github/install_arduino_cores.sh b/ci/github/install_arduino_cores.sh new file mode 100644 index 0000000..690c37c --- /dev/null +++ b/ci/github/install_arduino_cores.sh @@ -0,0 +1,17 @@ +# Any commands which fail will cause the shell script to exit immediately +set -e + +# Validate GitHub CI environment +if [ "$GITHUB_WORKSPACE" = "" ]; then + echo "Please define 'GITHUB_WORKSPACE' environment variable."; + exit 1; +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 + +# Remember installation directory +echo Remember ARDUINO_CLI_INSTALL_DIR as $ARDUINO_CLI_INSTALL_DIR in $GITHUB_ENV +echo ARDUINO_CLI_INSTALL_DIR=$ARDUINO_CLI_INSTALL_DIR>> $GITHUB_ENV diff --git a/ci/linux/arduinocli-core-esp8266.yaml b/ci/linux/arduinocli-core-esp8266.yaml new file mode 100644 index 0000000..0cdb190 --- /dev/null +++ b/ci/linux/arduinocli-core-esp8266.yaml @@ -0,0 +1,3 @@ +board_manager: + additional_urls: + - http://arduino.esp8266.com/stable/package_esp8266com_index.json diff --git a/ci/linux/install_arduino_cores.sh b/ci/linux/install_arduino_cores.sh new file mode 100644 index 0000000..17925db --- /dev/null +++ b/ci/linux/install_arduino_cores.sh @@ -0,0 +1,41 @@ +# Any commands which fail will cause the shell script to exit immediately +set -e + +# 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' +cat "$ARDUINO_CONFIG_PATH" +echo. +echo. + +echo Adding arduinocli-core-esp8266.yaml to arduino-cli config... +yaml-merge arduinocli-core-esp8266.yaml '$ARDUINO_CONFIG_PATH' --overwrite='$ARDUINO_CONFIG_PATH' +cat "$ARDUINO_CONFIG_PATH" +echo +echo + +echo Adding arduinocli-core-esp32.yaml to arduino-cli config... +yaml-merge arduinocli-core-esp32.yaml '$ARDUINO_CONFIG_PATH' --overwrite='$ARDUINO_CONFIG_PATH' +cat "$ARDUINO_CONFIG_PATH" +echo +echo + +echo Installing "arduino:avr" core... +arduino-cli core install "arduino:avr" +echo +echo + +echo Installing "esp8266:esp8266" core... +arduino-cli core install "esp8266:esp8266" +echo +echo + +echo Installing "esp32:esp32" core... +arduino-cli core install "esp32:esp32" +echo +echo + +echo Listing all installed cores... +arduino-cli core list +echo +echo diff --git a/ci/linux/install_arduinocli.sh b/ci/linux/install_arduinocli.sh index d7e7a31..0003f9f 100755 --- a/ci/linux/install_arduinocli.sh +++ b/ci/linux/install_arduinocli.sh @@ -36,29 +36,3 @@ echo Initialize configuration file... arduino-cli config init --overwrite echo echo - -echo Installing "arduino:avr" core... -arduino-cli core install "arduino:avr" -echo -echo - -echo Installing "esp8266:esp8266" core... -arduino-cli core install "esp8266:esp8266" -echo -echo - -echo Merging arduino-cli configuration file with temp-esp32.yaml... -yaml-merge temp-esp32.yaml '/home/$USER/.arduino15/arduino-cli.yaml' --overwrite='/home/$USER/.arduino15/arduino-cli.yaml' -cat '/home/$USER/.arduino15/arduino-cli.yaml' -echo -echo - -echo Installing "esp32:esp32" core... -arduino-cli core install "esp32:esp32" -echo -echo - -echo Listing all installed cores... -arduino-cli core list -echo -echo diff --git a/ci/windows/arduinocli-core-esp8266.yaml b/ci/windows/arduinocli-core-esp8266.yaml new file mode 100644 index 0000000..0cdb190 --- /dev/null +++ b/ci/windows/arduinocli-core-esp8266.yaml @@ -0,0 +1,3 @@ +board_manager: + additional_urls: + - http://arduino.esp8266.com/stable/package_esp8266com_index.json diff --git a/ci/windows/install_arduino_cores.bat b/ci/windows/install_arduino_cores.bat new file mode 100644 index 0000000..49e2b1f --- /dev/null +++ b/ci/windows/install_arduino_cores.bat @@ -0,0 +1,52 @@ +@echo off +cd /d %~dp0 + +:: 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%' +type "%ARDUINO_CONFIG_PATH%" +echo. +echo. + +echo Adding arduinocli-core-esp8266.yaml to arduino-cli config... +yaml-merge arduinocli-core-esp8266.yaml "%ARDUINO_CONFIG_PATH%" --overwrite="%ARDUINO_CONFIG_PATH%" +if %errorlevel% neq 0 exit /b %errorlevel% +type "%ARDUINO_CONFIG_PATH%" +echo. +echo. + +echo Adding arduinocli-core-esp32.yaml to arduino-cli config... +yaml-merge arduinocli-core-esp32.yaml "%ARDUINO_CONFIG_PATH%" --overwrite="%ARDUINO_CONFIG_PATH%" +if %errorlevel% neq 0 exit /b %errorlevel% +type "%ARDUINO_CONFIG_PATH%" +echo. +echo. + +echo Installing arduino:avr core... +REM Use `--skip-post-install` on AppVeyor to skip UAC prompt which is blocking the build. +arduino-cli core install arduino:avr --skip-post-install +if %errorlevel% neq 0 exit /b %errorlevel% +echo. +echo. + +echo Installing esp8266:esp8266 core... +arduino-cli core install esp8266:esp8266 +if %errorlevel% neq 0 exit /b %errorlevel% +echo. +echo. + +echo Installing esp32:esp32 core... +arduino-cli core update-index +if %errorlevel% neq 0 exit /b %errorlevel% +arduino-cli board listall +if %errorlevel% neq 0 exit /b %errorlevel% +arduino-cli core install esp32:esp32 +if %errorlevel% neq 0 exit /b %errorlevel% +echo. +echo. + +echo Listing all installed cores... +arduino-cli core list +if %errorlevel% neq 0 exit /b %errorlevel% +echo. +echo. diff --git a/ci/windows/install_arduinocli.bat b/ci/windows/install_arduinocli.bat index b9e9a3d..f078193 100644 --- a/ci/windows/install_arduinocli.bat +++ b/ci/windows/install_arduinocli.bat @@ -34,39 +34,3 @@ arduino-cli config init --overwrite if %errorlevel% neq 0 exit /b %errorlevel% echo. echo. - -echo Installing arduino:avr core... -REM Use `--skip-post-install` on AppVeyor to skip UAC prompt which is blocking the build. -arduino-cli core install arduino:avr --skip-post-install -if %errorlevel% neq 0 exit /b %errorlevel% -echo. -echo. - -echo Installing esp8266:esp8266 core... -arduino-cli core install esp8266:esp8266 -if %errorlevel% neq 0 exit /b %errorlevel% -echo. -echo. - -echo Merging arduino-cli configuration file with temp-esp32.yaml... -yaml-merge temp-esp32.yaml "C:\Users\%USERNAME%\AppData\Local\Arduino15\arduino-cli.yaml" --overwrite="C:\Users\%USERNAME%\AppData\Local\Arduino15\arduino-cli.yaml" -if %errorlevel% neq 0 exit /b %errorlevel% -type "C:\Users\%USERNAME%\AppData\Local\Arduino15\arduino-cli.yaml" -echo. -echo. - -echo Installing esp32:esp32 core... -arduino-cli core update-index -if %errorlevel% neq 0 exit /b %errorlevel% -arduino-cli board listall -if %errorlevel% neq 0 exit /b %errorlevel% -arduino-cli core install esp32:esp32 -if %errorlevel% neq 0 exit /b %errorlevel% -echo. -echo. - -echo Listing all installed cores... -arduino-cli core list -if %errorlevel% neq 0 exit /b %errorlevel% -echo. -echo.