From 02c82ef418225b5218f23ae8a25f26b3f016fffe Mon Sep 17 00:00:00 2001 From: Terry Moore Date: Thu, 4 Jul 2019 12:47:17 -0400 Subject: [PATCH 1/5] Fix #309: unswap ci targets in platformio.sh --- ci/platformio.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/platformio.sh b/ci/platformio.sh index e0cdfcd9..84002286 100755 --- a/ci/platformio.sh +++ b/ci/platformio.sh @@ -15,10 +15,10 @@ if [[ ! -v TARGET ]] then echo "ERROR: variable TARGET is not defined. Please run this scripts as shown next:" echo " TARGET='foo' $BASH_SOURCE" -elif [ "$TARGET" == "avr" ] +elif [ "$TARGET" == "esp32" ] then ################################################################################ - # TEST FOR TARGET "avr", i.e. BOARD heltec_wifi_lora_32 + # TEST FOR TARGET "esp32", i.e. BOARD heltec_wifi_lora_32 # Compile "ttn-otaa" example in all regions PLATFORMIO_BUILD_FLAGS='-D CFG_us915 -D CFG_sx1276_radio -D COMPILE_REGRESSION_TEST -D ARDUINO_LMIC_PROJECT_CONFIG_H_SUPPRESS' platformio ci --lib . --board heltec_wifi_lora_32 'examples/ttn-otaa/ttn-otaa.ino' @@ -97,11 +97,11 @@ then # Expect failure when compiling for more than one radio if [ "$(PLATFORMIO_BUILD_FLAGS='-D CFG_sx1272_radio -D CFG_sx1276_radio' platformio ci --lib . --board heltec_wifi_lora_32 'examples/ttn-otaa/ttn-otaa.ino' 1>&2; echo $?)" -eq 0 ]; then echo "ERROR: Compilation did not fail!"; exit 1; fi -elif [ "$TARGET" == "esp32" ] +elif [ "$TARGET" == "avr" ] then ################################################################################ - # TESTS FOR TARGET "esp32", i.e. BOARD feather32u4 + # TESTS FOR TARGET "avr", i.e. BOARD feather32u4 PLATFORMIO_BUILD_FLAGS='-D COMPILE_REGRESSION_TEST' platformio ci --lib . --board feather32u4 'examples/ttn-otaa-feather-us915/ttn-otaa-feather-us915.ino' PLATFORMIO_BUILD_FLAGS='-D COMPILE_REGRESSION_TEST -D ARDUINO_LMIC_PROJECT_CONFIG_H_SUPPRESS -D CFG_au921 -D CFG_sx1276_radio' platformio ci --lib . --board feather32u4 'examples/ttn-otaa-feather-us915/ttn-otaa-feather-us915.ino' From be50372451d4dbfa3e3d1e7f919784cbff1ee9cb Mon Sep 17 00:00:00 2001 From: Terry Moore Date: Thu, 4 Jul 2019 12:48:13 -0400 Subject: [PATCH 2/5] Fix shellcheck issue in error path --- ci/platformio.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/platformio.sh b/ci/platformio.sh index 84002286..76ae0ee3 100755 --- a/ci/platformio.sh +++ b/ci/platformio.sh @@ -14,7 +14,7 @@ set -o pipefail if [[ ! -v TARGET ]] then echo "ERROR: variable TARGET is not defined. Please run this scripts as shown next:" - echo " TARGET='foo' $BASH_SOURCE" + echo " TARGET='foo' ${BASH_SOURCE[*]}" elif [ "$TARGET" == "esp32" ] then ################################################################################ From 431a7f59fb2073c21c746e838bb8251f79bea72b Mon Sep 17 00:00:00 2001 From: Terry Moore Date: Thu, 4 Jul 2019 12:48:37 -0400 Subject: [PATCH 3/5] Add module headers to ci files. --- .travis.yml | 16 +++++++++++++++- ci/platformio.sh | 15 +++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b4d6d7df..afc52d18 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,18 @@ -# Travis script for test-building this library. +############################################################################## +# +# File: .travis.yml +# +# Function: +# Travis script for test-building this library. +# +# Copyright Notice: +# See LICENSE file accompanying this project. +# +# Author: +# Terry Moore, MCCI Corporation April 2018 +# +############################################################################## + language: c dist: trusty diff --git a/ci/platformio.sh b/ci/platformio.sh index 76ae0ee3..ce1718aa 100755 --- a/ci/platformio.sh +++ b/ci/platformio.sh @@ -1,5 +1,20 @@ #!/bin/bash +############################################################################## +# +# File: .travis.yml +# +# Function: +# Travis script for test-building this library. +# +# Copyright Notice: +# See LICENSE file accompanying this project. +# +# Author: +# Francesco Zardi March 2019 +# +############################################################################## + # Treat unset variables and parameters as an error set -o nounset From d12e4f6ed818c83ddc9c9ee0e17c2f5b17d4cea9 Mon Sep 17 00:00:00 2001 From: Terry Moore Date: Thu, 4 Jul 2019 12:51:19 -0400 Subject: [PATCH 4/5] Fix #337: use https to fetch IDE --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index afc52d18..79ff5ca9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,7 +48,7 @@ before_install: - export ARDUINO_IDE=arduino_ide/${IDE_VERSION} - export ARDUINO_LIBS="$HOME/Arduino/libraries" - if [ ! -d "$HOME/arduino_ide" ] ; then mkdir "$HOME/arduino_ide" ; fi - - if [ ! -d "$HOME/$ARDUINO_IDE" ] ; then { echo "fetch" && wget http://downloads.arduino.cc/arduino-${IDE_VERSION}-linux64.tar.xz && echo "untar" && tar xf arduino-${IDE_VERSION}-linux64.tar.xz && echo "move" && mv -f arduino-${IDE_VERSION} $HOME/${ARDUINO_IDE} ; } || { echo "IDE install failed"; exit 1; } ; else echo "IDE already installed" ; fi + - if [ ! -d "$HOME/$ARDUINO_IDE" ] ; then { echo "fetch" && wget https://downloads.arduino.cc/arduino-${IDE_VERSION}-linux64.tar.xz && echo "untar" && tar xf arduino-${IDE_VERSION}-linux64.tar.xz && echo "move" && mv -f arduino-${IDE_VERSION} $HOME/${ARDUINO_IDE} ; } || { echo "IDE install failed"; exit 1; } ; else echo "IDE already installed" ; fi - ln -sf $PWD $HOME/${ARDUINO_IDE}/libraries/Test_Library - export PATH="$HOME/${ARDUINO_IDE}:$PATH" # From a89f6cea066942b1294e43916b6a1946e8cdb633 Mon Sep 17 00:00:00 2001 From: Terry Moore Date: Thu, 4 Jul 2019 12:52:20 -0400 Subject: [PATCH 5/5] Fix #338: silence IDE noise during CI --- .travis.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.travis.yml b/.travis.yml index 79ff5ca9..e63f305e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ language: c dist: trusty +sudo: true env: global: @@ -51,6 +52,16 @@ before_install: - if [ ! -d "$HOME/$ARDUINO_IDE" ] ; then { echo "fetch" && wget https://downloads.arduino.cc/arduino-${IDE_VERSION}-linux64.tar.xz && echo "untar" && tar xf arduino-${IDE_VERSION}-linux64.tar.xz && echo "move" && mv -f arduino-${IDE_VERSION} $HOME/${ARDUINO_IDE} ; } || { echo "IDE install failed"; exit 1; } ; else echo "IDE already installed" ; fi - ln -sf $PWD $HOME/${ARDUINO_IDE}/libraries/Test_Library - export PATH="$HOME/${ARDUINO_IDE}:$PATH" + + # Arduino IDE adds a lot of noise caused by network traffic, trying to firewall it off + # (see 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 + # # functions to generate the board settings for SAMD, STM32L0, ... # keep args for these aligned for any common options. $1 is always board name, $2 is region.