Skip to content

Commit c1297cc

Browse files
Split PIO job into even and odd builds (#5405)
PIO is taking 27+ minutes now, very close to the runtime limit. Split into even and odd, just like standard Arduino. Each PIO job takes ~14-15 minutes and can go in parallel.
1 parent 7f7e658 commit c1297cc

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

.travis.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ matrix:
1717
- env:
1818
- BUILD_TYPE=debug_odd
1919
- env:
20-
- BUILD_TYPE=platformio
20+
- BUILD_TYPE=platformio_even
21+
- env:
22+
- BUILD_TYPE=platformio_odd
2123
- env:
2224
- BUILD_TYPE=docs
2325
- env:

tests/common.sh

+17-2
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,15 @@ function build_sketches_with_platformio()
173173
set +e
174174
local srcpath=$1
175175
local build_arg=$2
176-
local sketches=$(find $srcpath -name *.ino)
176+
local build_mod=$3
177+
local build_rem=$4
178+
local sketches=$(find $srcpath -name *.ino | sort)
179+
local testcnt=0
177180
for sketch in $sketches; do
181+
testcnt=$(( ($testcnt + 1) % $build_mod ))
182+
if [ $testcnt -ne $build_rem ]; then
183+
continue # Not ours to do
184+
fi
178185
local sketchdir=$(dirname $sketch)
179186
local sketchdirname=$(basename $sketchdir)
180187
local sketchname=$(basename $sketch)
@@ -274,7 +281,15 @@ elif [ "$BUILD_TYPE" = "debug_odd" ]; then
274281
elif [ "$BUILD_TYPE" = "platformio" ]; then
275282
# PlatformIO
276283
install_platformio
277-
build_sketches_with_platformio $TRAVIS_BUILD_DIR/libraries "--board nodemcuv2 --verbose"
284+
build_sketches_with_platformio $TRAVIS_BUILD_DIR/libraries "--board nodemcuv2 --verbose" 1 0
285+
elif [ "$BUILD_TYPE" = "platformio_even" ]; then
286+
# PlatformIO
287+
install_platformio
288+
build_sketches_with_platformio $TRAVIS_BUILD_DIR/libraries "--board nodemcuv2 --verbose" 2 0
289+
elif [ "$BUILD_TYPE" = "platformio_odd" ]; then
290+
# PlatformIO
291+
install_platformio
292+
build_sketches_with_platformio $TRAVIS_BUILD_DIR/libraries "--board nodemcuv2 --verbose" 2 1
278293
elif [ "$BUILD_TYPE" = "docs" ]; then
279294
# Build documentation using Sphinx
280295
cd $TRAVIS_BUILD_DIR/doc

0 commit comments

Comments
 (0)