[Travis] Explicitly set build flag

This commit is contained in:
jgromes 2020-04-15 09:36:29 +02:00
parent 84938f276d
commit bbc35b969b

View file

@ -33,29 +33,37 @@ before_install:
- if [[ "$BOARD" =~ "arduino:avr:uno" ]]; then - if [[ "$BOARD" =~ "arduino:avr:uno" ]]; then
export BUILD_EXAMPLES=true; export BUILD_EXAMPLES=true;
elif [[ "$BOARD" =~ "arduino:avr:mega" ]]; then elif [[ "$BOARD" =~ "arduino:avr:mega" ]]; then
export BUILD_EXAMPLES=false;
elif [[ "$BOARD" =~ "arduino:avr:leonardo" ]]; then elif [[ "$BOARD" =~ "arduino:avr:leonardo" ]]; then
export BUILD_EXAMPLES=false;
elif [[ "$BOARD" =~ "esp8266:esp8266:" ]]; then elif [[ "$BOARD" =~ "esp8266:esp8266:" ]]; then
export BUILD_EXAMPLES=false;
arduino --pref "http://arduino.esp8266.com/stable/package_esp8266com_index.json" --save-prefs 2>&1; arduino --pref "http://arduino.esp8266.com/stable/package_esp8266com_index.json" --save-prefs 2>&1;
arduino --install-boards esp8266:esp8266; arduino --install-boards esp8266:esp8266;
export SKIP_PAT='(HTTP|MQTT).*ino'; export SKIP_PAT='(HTTP|MQTT).*ino';
elif [[ "$BOARD" =~ "esp32:esp32:" ]]; then elif [[ "$BOARD" =~ "esp32:esp32:" ]]; then
export BUILD_EXAMPLES=false;
arduino --pref "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json" --save-prefs 2>&1; arduino --pref "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json" --save-prefs 2>&1;
arduino --install-boards esp32:esp32; arduino --install-boards esp32:esp32;
elif [[ "$BOARD" =~ "STM32:stm32:" ]]; then elif [[ "$BOARD" =~ "STM32:stm32:" ]]; then
export BUILD_EXAMPLES=false;
arduino --pref "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json" --save-prefs 2>&1; arduino --pref "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json" --save-prefs 2>&1;
arduino --install-boards STM32:stm32; arduino --install-boards STM32:stm32;
elif [[ "$BOARD" =~ "arduino:samd:" ]]; then elif [[ "$BOARD" =~ "arduino:samd:" ]]; then
export BUILD_EXAMPLES=false;
arduino --pref "https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json" --save-prefs 2>&1; arduino --pref "https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json" --save-prefs 2>&1;
arduino --install-boards arduino:samd; arduino --install-boards arduino:samd;
elif [[ "$BOARD" =~ "arduino:sam:" ]]; then elif [[ "$BOARD" =~ "arduino:sam:" ]]; then
export BUILD_EXAMPLES=false;
arduino --install-boards arduino:sam; arduino --install-boards arduino:sam;
elif [[ "$BOARD" =~ "SparkFun:apollo3:" ]]; then elif [[ "$BOARD" =~ "SparkFun:apollo3:" ]]; then
export BUILD_EXAMPLES=false;
arduino --pref "https://raw.githubusercontent.com/sparkfun/Arduino_Boards/master/IDE_Board_Manager/package_sparkfun_index.json" --save-prefs 2>&1; arduino --pref "https://raw.githubusercontent.com/sparkfun/Arduino_Boards/master/IDE_Board_Manager/package_sparkfun_index.json" --save-prefs 2>&1;
arduino --install-boards SparkFun:apollo3; arduino --install-boards SparkFun:apollo3;
fi fi
# check if this release commit (or forced build) and if so, build for every board # check if this release commit (or forced build) and if so, build for every board
- if [[ "$TRAVIS_COMMIT_MESSAGE" =~ "Bump version to" ] || [ "$TRAVIS_COMMIT_MESSAGE" =~ "TRAVIS_FORCE_BUILD" ]]; then - if [[ "$TRAVIS_COMMIT_MESSAGE" =~ "Bump version to" || "$TRAVIS_COMMIT_MESSAGE" =~ "TRAVIS_FORCE_BUILD" ]]; then
export BUILD_EXAMPLES=true; export BUILD_EXAMPLES=true;
fi fi
@ -72,7 +80,7 @@ branches:
script: script:
# build all example sketches # build all example sketches
- | - |
if [ "$BUILD_EXAMPLES" = true ] ; then if [ ! -z "$BUILD_EXAMPLES" ] && [ "$BUILD_EXAMPLES" = true ] ; then
for example in $(find $PWD/examples -name '*.ino' | sort); do for example in $(find $PWD/examples -name '*.ino' | sort); do
# check whether to skip this sketch # check whether to skip this sketch
if [ ! -z "$SKIP_PAT" ] && [[ ${example} =~ $SKIP_PAT ]]; then if [ ! -z "$SKIP_PAT" ] && [[ ${example} =~ $SKIP_PAT ]]; then
@ -91,7 +99,7 @@ script:
fi fi
done done
else else
echo -e "\n\033[1;33mExample build skipped for $BOARD\033[0m"; echo -e "\n\033[1;33mExample builds skipped for $BOARD\033[0m";
fi fi
# generate Doxygen documentation (only for Arduino UNO) # generate Doxygen documentation (only for Arduino UNO)