knx/.travis.yml
2019-06-04 00:09:40 +02:00

56 lines
2.3 KiB
YAML

language: cpp
cache:
directories:
- ~/arduino_ide
- ~/.arduino15/packages/
matrix:
include:
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
- MODE=LINUX
- os: linux
env:
- MODE=ARDUINO
- BOARD=arduino:samd:arduino_zero_native
before_install:
- downloadArduinoLib() { wget -O $1.zip $2; unzip -o $1.zip -d $HOME/arduino_ide/libraries; }
- if [ "$MODE" = "LINUX" ]; then eval "${MATRIX_EVAL}"; fi
- if [ "$MODE" = "ARDUINO" ]; then source <(curl -SLs "https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/install.sh"); fi
- if [ "$MODE" = "ARDUINO" ]; then downloadArduinoLib FlashStorage "https://github.com/thelsing/FlashStorage/archive/master.zip"; fi
- if [ "$MODE" = "ARDUINO" ]; then downloadArduinoLib BSEC "https://github.com/BoschSensortec/BSEC-Arduino-library/archive/master.zip"; fi
# the HDC100X lib is not properly set up in githup so move things around a bit
- if [ "$MODE" = "ARDUINO" ]; then wget -O HDC100X.zip "https://github.com/RFgermany/HDC100X_Arduino_Library/archive/master.zip"; fi
- if [ "$MODE" = "ARDUINO" ]; then unzip -d "$HOME/HDC100X-Master" "HDC100X.zip" && f=("$HOME/HDC100X-Master"/*) && mv "$HOME/HDC100X-Master"/*/* "$HOME/HDC100X-Master" && rmdir "${f[@]}" && mv "$HOME/HDC100X-Master" $HOME/arduino_ide/libraries; fi
- buildExampleSketch() { arduino --verify --board $BOARD $PWD/examples/$1/$1.ino; }
install:
- if [ "$MODE" = "ARDUINO" ]; then arduino --install-library "WiFiManager"; fi
- if [ "$MODE" = "ARDUINO" ]; then ls -lR $HOME/arduino_ide/libraries; fi
script:
- if [ "$MODE" = "LINUX" ]; then cd knx-linux; fi
- if [ "$MODE" = "LINUX" ]; then mkdir -p build; fi
- if [ "$MODE" = "LINUX" ]; then cd build; fi
- if [ "$MODE" = "LINUX" ]; then cmake ..; fi
- if [ "$MODE" = "LINUX" ]; then make; fi
- if [ "$MODE" = "ARDUINO" ]; then buildExampleSketch knx-demo; fi
- if [ "$MODE" = "ARDUINO" ]; then buildExampleSketch knx-sonoffS20; fi
- if [ "$MODE" = "ARDUINO" ]; then buildExampleSketch knx-bme680; fi
- if [ "$MODE" = "ARDUINO" ]; then buildExampleSketch knx-hdc1008; fi
notifications:
email:
on_success: change
on_failure: change