From f941053cd8123fb075c51b255602fcfd8a2e4482 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Fri, 30 Nov 2018 14:47:44 -0800 Subject: [PATCH] Split PIO job into even and odd builds --- .travis.yml | 4 +++- tests/common.sh | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index c2a99bae08..a992a5094e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,9 @@ matrix: - env: - BUILD_TYPE=debug_odd - env: - - BUILD_TYPE=platformio + - BUILD_TYPE=platformio_even + - env: + - BUILD_TYPE=platformio_odd - env: - BUILD_TYPE=docs - env: diff --git a/tests/common.sh b/tests/common.sh index c048e75fe5..f6e06a66b0 100755 --- a/tests/common.sh +++ b/tests/common.sh @@ -173,8 +173,15 @@ function build_sketches_with_platformio() set +e local srcpath=$1 local build_arg=$2 - local sketches=$(find $srcpath -name *.ino) + local build_mod=$3 + local build_rem=$4 + local sketches=$(find $srcpath -name *.ino | sort) + local testcnt=0 for sketch in $sketches; do + testcnt=$(( ($testcnt + 1) % $build_mod )) + if [ $testcnt -ne $build_rem ]; then + continue # Not ours to do + fi local sketchdir=$(dirname $sketch) local sketchdirname=$(basename $sketchdir) local sketchname=$(basename $sketch) @@ -274,7 +281,15 @@ elif [ "$BUILD_TYPE" = "debug_odd" ]; then elif [ "$BUILD_TYPE" = "platformio" ]; then # PlatformIO install_platformio - build_sketches_with_platformio $TRAVIS_BUILD_DIR/libraries "--board nodemcuv2 --verbose" + build_sketches_with_platformio $TRAVIS_BUILD_DIR/libraries "--board nodemcuv2 --verbose" 1 0 +elif [ "$BUILD_TYPE" = "platformio_even" ]; then + # PlatformIO + install_platformio + build_sketches_with_platformio $TRAVIS_BUILD_DIR/libraries "--board nodemcuv2 --verbose" 2 0 +elif [ "$BUILD_TYPE" = "platformio_odd" ]; then + # PlatformIO + install_platformio + build_sketches_with_platformio $TRAVIS_BUILD_DIR/libraries "--board nodemcuv2 --verbose" 2 1 elif [ "$BUILD_TYPE" = "docs" ]; then # Build documentation using Sphinx cd $TRAVIS_BUILD_DIR/doc