Skip to content

Commit c2d61a3

Browse files
committed
Add Travis tests;
Add Travis Icon on README;
1 parent b0552fb commit c2d61a3

File tree

3 files changed

+95
-1
lines changed

3 files changed

+95
-1
lines changed

.travis.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
sudo: false
2+
dist:
3+
- xenial
4+
addons:
5+
apt:
6+
packages:
7+
- xvfb
8+
language: bash
9+
os:
10+
- linux
11+
env:
12+
matrix:
13+
- CPU="esp8266" BOARD="esp8266com:esp8266:generic:xtal=80" IDE_VERSION=1.6.5
14+
- CPU="esp8266" BOARD="esp8266com:esp8266:generic:xtal=80,dbg=Serial1" IDE_VERSION=1.6.5
15+
- CPU="esp8266" BOARD="esp8266com:esp8266:generic:xtal=80,eesz=1M,FlashMode=qio,FlashFreq=80" IDE_VERSION=1.8.13
16+
script:
17+
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16
18+
- export DISPLAY=:1.0
19+
- sleep 3
20+
- wget http://downloads.arduino.cc/arduino-$IDE_VERSION-linux64.tar.xz
21+
- tar xf arduino-$IDE_VERSION-linux64.tar.xz
22+
- mv arduino-$IDE_VERSION $HOME/arduino_ide
23+
- export PATH="$HOME/arduino_ide:$PATH"
24+
- which arduino
25+
- mkdir -p $HOME/Arduino/libraries
26+
27+
- git clone https://github.com/timum-viw/socket.io-client.git SocketIoClient
28+
- mv SocketIoClient $HOME/Arduino/libraries/SocketIoClient
29+
- cp -r $TRAVIS_BUILD_DIR $HOME/arduino_ide/libraries/StreamlabsArduinoAlerts
30+
- source $TRAVIS_BUILD_DIR/travis/common.sh
31+
- get_core $CPU
32+
- cd $TRAVIS_BUILD_DIR
33+
- arduino --board $BOARD --save-prefs
34+
- arduino --get-pref sketchbook.path
35+
- arduino --pref update.check=false
36+
- build_sketches arduino $HOME/Arduino/libraries/StreamlabsArduinoAlerts/examples/$CPU $CPU
37+
38+
notifications:
39+
email:
40+
on_success: change
41+
on_failure: change

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Streamlabs Arduino Alerts
1+
# Streamlabs Arduino Alerts [![Build Status](https://travis-ci.com/lucalas/StreamlabsArduinoAlerts.svg?branch=master)](https://travis-ci.com/lucalas/StreamlabsArduinoAlerts)
22
A work in progress library to connect to your Streamlabs account and catch all the Twitch events.
33

44
## Twitch event catchable

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)