forked from Azure/azure-iot-arduino-utility
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
53 lines (49 loc) · 2.08 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
language: generic
env:
global:
- IDE_VERSION=1.6.12
matrix:
- BOARD="arduino:samd:arduino_zero_edbg"
- BOARD="arduino:samd:mkr1000"
- BOARD="esp8266:esp8266:huzzah:FlashSize=4M3M,CpuFrequency=80"
- BOARD="esp8266:esp8266:thing"
before_install:
- /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
- wget http://downloads.arduino.cc/arduino-$IDE_VERSION-linux64.tar.xz
- tar xf arduino-$IDE_VERSION-linux64.tar.xz
- mv arduino-$IDE_VERSION $HOME/arduino-ide
- export PATH=$PATH:$HOME/arduino-ide
- if [[ "$BOARD" =~ "arduino:samd:" ]]; then
arduino --install-boards arduino:samd;
arduino --install-library WiFi101;
arduino --install-library WiFi101;
arduino --install-library RTCZero;
arduino --install-library NTPClient;
fi
- if [[ "$BOARD" =~ "esp8266:esp8266:" ]]; then
arduino --pref "boardsmanager.additional.urls=http://arduino.esp8266.com/stable/package_esp8266com_index.json" --install-boards esp8266:esp8266;
arduino --pref "boardsmanager.additional.urls=" --save-prefs;
arduino --install-library NTPClient;
arduino --install-library NTPClient;
fi
- findAndReplace() { sed -i'' -e"s|$1|$2|g" "$3"; }
- buildExampleSketch() {
EXAMPLE_SKETCH=$PWD/examples/$1/$1.ino;
if [[ "$BOARD" =~ "esp8266:esp8266:" ]]; then
findAndReplace WiFi101 ESP8266WiFi $EXAMPLE_SKETCH;
findAndReplace WiFiSSLClient WiFiClientSecure $EXAMPLE_SKETCH;
findAndReplace WiFiUdp WiFiUdp $EXAMPLE_SKETCH;
fi
cat $EXAMPLE_SKETCH;
arduino --verbose-build --verify --board $BOARD $EXAMPLE_SKETCH;
}
install:
- arduino --install-library "AzureIoTUtility"
- arduino --install-library "AzureIoTProtocol_HTTP"
- ln -s $PWD $HOME/Arduino/libraries/.
script:
- buildExampleSketch simplesample_http