From 2b5d77bbeffe4cc9e120f9a6d507cd3ca3c61cc1 Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Mon, 1 Feb 2016 18:00:53 +0200 Subject: [PATCH] give travis a go --- .travis.yml | 37 +++++++++++++++++++++++++++++++++++++ travis/common.sh | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 .travis.yml create mode 100755 travis/common.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..dace7f1 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,37 @@ +sudo: false +language: bash +os: + - linux + +script: + - wget http://downloads.arduino.cc/arduino-1.6.5-linux64.tar.xz + - tar xf arduino-1.6.5-linux64.tar.xz + - mv arduino-1.6.5 $HOME/arduino_ide + - cd $HOME/arduino_ide/hardware + - mkdir esp8266com + - cd esp8266com + - ln -s $TRAVIS_BUILD_DIR esp8266 + - cd esp8266/tools + - python get.py + - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16 + - sleep 3 + - export DISPLAY=:1.0 + - export PATH="$HOME/arduino_ide:$PATH" + - which arduino + - cd $TRAVIS_BUILD_DIR + - source travis/common.sh + - arduino --board esp8266com:esp8266:generic --save-prefs + - arduino --get-pref sketchbook.path + - install_libraries + - build_sketches arduino $TRAVIS_BUILD_DIR + +notifications: + email: + on_success: change + on_failure: change +# webhooks: +# urls: +# - secure: "dnSY+KA7NK+KD+Z71copmANDUsyVePrZ0iXvXxmqMEQv+lp3j2Z87G5pHn7j0WNcNZrejJqOdbElJ9Q4QESRaAYxTR7cA6ameJeEKHiFJrQtN/4abvoXb9E1CxpL8aNON/xgnqCk+fycOK3nbWWXlJBodzBm7KN64vrcHO7et+M=" +# on_success: change # options: [always|never|change] default: always +# on_failure: always # options: [always|never|change] default: always +# on_start: false # default: false diff --git a/travis/common.sh b/travis/common.sh new file mode 100755 index 0000000..393cd40 --- /dev/null +++ b/travis/common.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +function build_sketches() +{ + local arduino=$1 + local srcpath=$HOME/Arduino/libraries/ESPAsyncWebServer/examples + local sketches=$(find $srcpath -name *.ino) + for sketch in $sketches; do + local sketchdir=$(dirname $sketch) + if [[ -f "$sketchdir/.test.skip" ]]; then + echo -e "\n\n ------------ Skipping $sketch ------------ \n\n"; + continue + fi + echo -e "\n\n ------------ Building $sketch ------------ \n\n"; + $arduino --verify $sketch; + local result=$? + if [ $result -ne 0 ]; then + echo "Build failed ($1)" + return $result + fi + done +} + +function install_libraries() +{ + mkdir -p $HOME/Arduino/libraries + pushd $HOME/Arduino/libraries + + # install ArduinoJson library + git clone https://github.com/bblanchon/ArduinoJson + git clone https://github.com/me-no-dev/ESPAsyncTCP + git clone https://github.com/me-no-dev/ESPAsyncWebServer + + popd +}