kopia lustrzana https://github.com/jgromes/RadioLib
90 wiersze
3.3 KiB
YAML
90 wiersze
3.3 KiB
YAML
env:
|
|
global:
|
|
- ARDUINO_IDE_VERSION="1.8.9"
|
|
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="esp32:esp32:esp32"
|
|
- BOARD="STM32:stm32:GenF1:pnum=BLUEPILL_F103C6"
|
|
- BOARD="esp8266:esp8266:generic:xtal=80,ResetMethod=ck,CrystalFreq=26,FlashFreq=40,FlashMode=qio,eesz=512K"
|
|
- BOARD="arduino:samd:arduino_zero_native"
|
|
- BOARD="arduino:avr:uno"
|
|
- BOARD="arduino:avr:leonardo"
|
|
- BOARD="arduino:avr:mega:cpu=atmega2560"
|
|
|
|
before_install:
|
|
# install Arduino IDE
|
|
- wget https://downloads.arduino.cc/arduino-$ARDUINO_IDE_VERSION-linux64.tar.xz
|
|
- tar xf arduino-$ARDUINO_IDE_VERSION-linux64.tar.xz
|
|
- mv arduino-$ARDUINO_IDE_VERSION $HOME/arduino-ide
|
|
- export PATH=$PATH:$HOME/arduino-ide
|
|
|
|
# firewall Arduino IDE noise (https://github.com/per1234/arduino-ci-script/issues/1#issuecomment-504158113)
|
|
- sudo iptables -P INPUT DROP
|
|
- sudo iptables -P FORWARD DROP
|
|
- sudo iptables -P OUTPUT ACCEPT
|
|
- sudo iptables -A INPUT -i lo -j ACCEPT
|
|
- sudo iptables -A OUTPUT -o lo -j ACCEPT
|
|
- sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
|
|
|
|
# install 3rd party boards
|
|
- arduino --pref "boardsmanager.additional.urls=http://arduino.esp8266.com/stable/package_esp8266com_index.json,https://dl.espressif.com/dl/package_esp32_index.json,https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json" --save-prefs 2>&1
|
|
- if [[ "$BOARD" =~ "esp8266:esp8266:" ]]; then
|
|
arduino --install-boards esp8266:esp8266;
|
|
export SKIP_PAT='(HTTP|MQTT).*ino';
|
|
elif [[ "$BOARD" =~ "esp32:esp32:" ]]; then
|
|
arduino --install-boards esp32:esp32;
|
|
elif [[ "$BOARD" =~ "STM32:stm32:" ]]; then
|
|
arduino --install-boards STM32:stm32;
|
|
elif [[ "$BOARD" =~ "arduino:samd:" ]]; then
|
|
arduino --install-boards arduino:samd;
|
|
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
|
|
- |
|
|
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 --verify --board $BOARD $example;
|
|
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
|
|
|
|
# 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"
|