8000 add travis build test · raph84/arduinoWebSockets@3f5c7e1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3f5c7e1

Browse files
committed
add travis build test
1 parent 7c5113f commit 3f5c7e1

File tree

7 files changed

+92
-0
lines changed

7 files changed

+92
-0
lines changed

.travis.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
sudo: false
2+
language: bash
3+
os:
4+
- linux
5+
env:
6+
matrix:
7+
- CPU="esp8266" BOARD="esp8266com:esp8266:generic:CpuFrequency=80" IDE_VERSION=1.6.5
8+
- CPU="esp8266" BOARD="esp8266com:esp8266:generic:CpuFrequency=80,FlashSize=1M0,FlashMode=qio,FlashFreq=80" IDE_VERSION=1.8.5
9+
- CPU="esp8266" BOARD="esp8266com:esp8266:generic:CpuFrequency=80,Debug=Serial1" IDE_VERSION=1.6.5
10+
- CPU="avr" BOARD="arduino:avr:mega:cpu=atmega2560" IDE_VERSION=1.6.5
11+
12+
script:
13+
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16
14+
- sleep 3
15+
- export DISPLAY=:1.0
16+
- wget http://downloads.arduino.cc/arduino-$IDE_VERSION-linux64.tar.xz
17+
- tar xf arduino-$IDE_VERSION-linux64.tar.xz
18+
- mv arduino-$IDE_VERSION $HOME/arduino_ide
19+
- export PATH="$HOME/arduino_ide:$PATH"
20+
- which arduino
21+
- mkdir -p $HOME/Arduino/libraries
22+
- cp -r $TRAVIS_BUILD_DIR $HOME/Arduino/libraries/arduinoWebSockets
23+
- source $TRAVIS_BUILD_DIR/travis/common.sh
24+
- get_core $CPU
25+
- cd $TRAVIS_BUILD_DIR
26+
- arduino --board $BOARD --save-prefs
27+
- arduino --get-pref sketchbook.path
28+
- build_sketches arduino $HOME/Arduino/libraries/arduinoWebSockets/examples/$CPU $CPU
29+
30+
notifications:
31+
email:
32+
on_success: change
33+
on_failure: change
34+
webhooks:
35+
urls:
36+
- https://webhooks.gitter.im/e/1aa78fbe15080b0c2e37
37+
on_success: change # options: [always|never|change] default: always
38+
on_failure: always # options: [always|never|change] default: always
39+
on_start: false # default: false

travis/common.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/bash
2+
3+
function build_sketches()
4+
{
5+
local arduino=$1
6+
local srcpath=$2
7+
local platform=$3
8+
local sketches=$(find $srcpath -name *.ino)
9+
for sketch in $sketches; do
10+
local sketchdir=$(dirname $sketch)
11+
if [[ -f "$sketchdir/.$platform.skip" ]]; then
12+
echo -e "\n\n ------------ Skipping $sketch ------------ \n\n";
13+
continue
14+
fi
15+
echo -e "\n\n ------------ Building $sketch ------------ \n\n";
16+
$arduino --verify $sketch;
17+
local result=$?
18+
if [ $result -ne 0 ]; then
19+
echo "Build failed ($sketch) build verbose..."
20+
$arduino --verify --verbose --preserve-temp-files $sketch
21+
result=$?
22+
fi
23+
if [ $result -ne 0 ]; then
24+
echo "Build failed ($1) $sketch"
25+
return $result
26+
fi
27+
done
28+
}
29+
30+
31+
function get_core()
32+
{
33+
echo Setup core for $1
34+
35+
cd $HOME/arduino_ide/hardware
36+
37+
if [ "$1" = "esp8266" ] ; then
38+
mkdir esp8266com
39+
cd esp8266com
40+
git clone https://github.com/esp8266/Arduino.git esp8266
41+
cd esp8266/tools
42+
python get.py
43+
fi
44+
45+
if [ "$1" = "esp32" ] ; then
46+
mkdir espressif
47+
cd espressif
48+
git clone https://github.com/espressif/arduino-esp32.git esp32
49+
cd esp32/tools
50+
python get.py
51+
fi
52+
53+
}

0 commit comments

Comments
 (0)
0