forked from jgromes/RadioLib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
195 lines (170 loc) · 7.73 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
env:
global:
matrix:
# see https://github.com/arduino/Arduino/blob/master/build/shared/manpage.adoc#options
# and https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification#boardstxt
- BOARD="arduino:avr:uno"
- BOARD="arduino:avr:mega:cpu=atmega2560"
- BOARD="arduino:avr:leonardo"
- BOARD="esp8266:esp8266:generic:xtal=80,ResetMethod=ck,CrystalFreq=26,FlashFreq=40,FlashMode=qio,eesz=512K"
- BOARD="esp32:esp32:esp32"
- BOARD="STM32:stm32:GenF3:pnum=BLACKPILL_F303CC"
- BOARD="arduino:samd:arduino_zero_native"
- BOARD="arduino:sam:arduino_due_x"
- BOARD="adafruit:nrf52:feather52832:softdevice=s132v6,debug=l0"
- BOARD="Intel:arc32:arduino_101"
- BOARD="arduino:megaavr:uno2018:mode=on"
- BOARD="SparkFun:apollo3:amap3redboard"
- BOARD="arduino:mbed:nano33ble"
- BOARD="stm32duino:STM32F1:mapleMini:bootloader_version=original,cpu_speed=speed_72mhz"
- BOARD="adafruit:samd:adafruit_feather_m0:usbstack=arduino,debug=off"
- BOARD="arduino-beta:mbed:envie_m4"
addons:
apt:
packages:
# required for Adafruit nRF52 (adafruit-nrfutil package)
- python3
- python3-pip
- python3-setuptools
before_install:
# install Arduino CLI
- curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
- export PATH=$PATH:$PWD/bin
# check every board in matrix and install 3rd party definitions
- |
if [[ "$BOARD" =~ "arduino:avr:uno" ]]; then
export BUILD_EXAMPLES=true;
export WARNINGS=all;
arduino-cli core update-index;
arduino-cli core install arduino:avr;
elif [[ "$BOARD" =~ "arduino:avr:mega" ]]; then
export BUILD_EXAMPLES=false;
export WARNINGS=all;
arduino-cli core update-index;
arduino-cli core install arduino:avr;
elif [[ "$BOARD" =~ "arduino:avr:leonardo" ]]; then
export BUILD_EXAMPLES=false;
export WARNINGS=all;
arduino-cli core update-index;
arduino-cli core install arduino:avr;
elif [[ "$BOARD" =~ "esp8266:esp8266:" ]]; then
export BUILD_EXAMPLES=false;
export WARNINGS=all;
arduino-cli core update-index --additional-urls http://arduino.esp8266.com/stable/package_esp8266com_index.json;
arduino-cli core install esp8266:esp8266 --additional-urls http://arduino.esp8266.com/stable/package_esp8266com_index.json;
export SKIP_PAT='(HTTP|MQTT).*ino';
elif [[ "$BOARD" =~ "esp32:esp32:" ]]; then
export BUILD_EXAMPLES=false;
export WARNINGS=all;
arduino-cli core update-index --additional-urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json;
arduino-cli core install esp32:esp32 --additional-urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json;
elif [[ "$BOARD" =~ "STM32:stm32:" ]]; then
export BUILD_EXAMPLES=false;
export WARNINGS=all;
arduino-cli core update-index --additional-urls https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json;
arduino-cli core install STM32:stm32 --additional-urls https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json;
elif [[ "$BOARD" =~ "arduino:samd:" ]]; then
export BUILD_EXAMPLES=false;
export WARNINGS=all;
arduino-cli core update-index;
arduino-cli core install arduino:samd;
elif [[ "$BOARD" =~ "arduino:sam:" ]]; then
export BUILD_EXAMPLES=false;
export WARNINGS=all;
arduino-cli core update-index;
arduino-cli core install arduino:sam;
elif [[ "$BOARD" =~ "adafruit:nrf52:" ]]; then
pip3 install --user adafruit-nrfutil;
export BUILD_EXAMPLES=false;
export WARNINGS=all;
arduino-cli core update-index --additional-urls https://www.adafruit.com/package_adafruit_index.json;
arduino-cli core install adafruit:nrf52 --additional-urls https://www.adafruit.com/package_adafruit_index.json;
elif [[ "$BOARD" =~ "Intel:arc32:" ]]; then
export BUILD_EXAMPLES=false;
export WARNINGS=all;
arduino-cli core update-index;
arduino-cli core install Intel:arc32;
elif [[ "$BOARD" =~ "arduino:megaavr:" ]]; then
export BUILD_EXAMPLES=false;
export WARNINGS=all;
arduino-cli core update-index;
arduino-cli core install arduino:megaavr;
elif [[ "$BOARD" =~ "SparkFun:apollo3:" ]]; then
export BUILD_EXAMPLES=false;
export WARNINGS=none;
arduino-cli core update-index --additional-urls https://raw.githubusercontent.com/sparkfun/Arduino_Boards/master/IDE_Board_Manager/package_sparkfun_index.json;
arduino-cli core install SparkFun:apollo3 --additional-urls https://raw.githubusercontent.com/sparkfun/Arduino_Boards/master/IDE_Board_Manager/package_sparkfun_index.json;
elif [[ "$BOARD" =~ "arduino:mbed:" ]]; then
export BUILD_EXAMPLES=false;
export WARNINGS=all;
arduino-cli core update-index;
arduino-cli core install arduino:mbed;
export SKIP_PAT='(HTTP|MQTT).*ino';
elif [[ "$BOARD" =~ "stm32duino:STM32F1:" ]]; then
export BUILD_EXAMPLES=false;
export WARNINGS=all;
arduino-cli core update-index --additional-urls http://dan.drown.org/stm32duino/package_STM32duino_index.json;
arduino-cli core install stm32duino:STM32F1 --additional-urls http://dan.drown.org/stm32duino/package_STM32duino_index.json;
elif [[ "$BOARD" =~ "adafruit:samd:" ]]; then
export BUILD_EXAMPLES=false;
export WARNINGS=all;
arduino-cli core update-index --additional-urls https://www.adafruit.com/package_adafruit_index.json
arduino-cli core install adafruit:samd --additional-urls https://www.adafruit.com/package_adafruit_index.json
elif [[ "$BOARD" =~ "arduino-beta:mbed:" ]]; then
export BUILD_EXAMPLES=false;
export WARNINGS=all;
arduino-cli core update-index;
arduino-cli core install arduino-beta:mbed;
export SKIP_PAT='(HTTP|MQTT).*ino';
fi
# check if this release commit (or forced build) and if so, build for every board
- if [[ "$TRAVIS_COMMIT_MESSAGE" =~ "Bump version to" || "$TRAVIS_COMMIT_MESSAGE" =~ "TRAVIS_FORCE_BUILD" ]]; then
export BUILD_EXAMPLES=true;
fi
# create directory to save the library and create symbolic link
install:
- mkdir -p $HOME/Arduino/libraries
- ln -s $PWD $HOME/Arduino/libraries/RadioLib
# only build the master branch
branches:
only:
- master
script:
# build all example sketches
- |
if [ ! -z "$BUILD_EXAMPLES" ] && [ "$BUILD_EXAMPLES" = true ] ; then
for example in $(find $PWD/examples -name '*.ino' | sort); do
# check whether to skip this sketch
if [ ! -z "$SKIP_PAT" ] && [[ ${example} =~ $SKIP_PAT ]]; then
# skip sketch
echo -e "\n\033[1;33mSkipped ${example##*/} (matched with $SKIP_PAT)\033[0m";
else
# build sketch
echo -e "\n\033[1;33mBuilding ${example##*/} ... \033[0m";
arduino-cli compile --fqbn $BOARD $example --warnings=$WARNINGS
if [ $? -ne 0 ]; then
echo -e "\033[1;31m${example##*/} build FAILED\033[0m\n";
exit 1;
else
echo -e "\033[1;32m${example##*/} build PASSED\033[0m\n";
fi
fi
done
else
echo -e "\n\033[1;33mExample builds skipped for $BOARD\033[0m";
fi
# generate Doxygen documentation (only for Arduino UNO)
- if [ $BOARD = "arduino:avr:uno" ]; then
sudo apt-get update;
sudo apt-get install -y doxygen;
doxygen Doxyfile;
fi
# deploy Doxygen docs on master branch and only when building for Arduino UNO
deploy:
provider: pages
skip_cleanup: true
local_dir: docs/html
github_token: $GH_REPO_TOKEN
on:
branch: master
condition: $BOARD = "arduino:avr:uno"