Skip to content

Commit cc9e799

Browse files
committed
ci: split into multiple jobs
1 parent cb723a5 commit cc9e799

File tree

2 files changed

+35
-36
lines changed

2 files changed

+35
-36
lines changed

.travis.yml

+13-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,18 @@ language: bash
33
os: linux
44
dist: trusty
55

6-
env:
7-
- BUILD_TYPE=build
6+
matrix:
7+
include:
8+
- env:
9+
- BUILD_TYPE=build
10+
- env:
11+
- BUILD_TYPE=platformio
12+
- env:
13+
- BUILD_TYPE=docs
14+
- env:
15+
- BUILD_TYPE=package
16+
- env:
17+
- BUILD_TYPE=host_tests
818

919
install:
1020
- pip install --user -r doc/requirements.txt
@@ -25,6 +35,7 @@ deploy:
2535
on:
2636
repo: esp8266/Arduino
2737
tags: true
38+
condition: "$BUILD_TYPE = package"
2839

2940
notifications:
3041
email:

tests/common.sh

+22-34
Original file line numberDiff line numberDiff line change
@@ -169,31 +169,8 @@ function build_sketches_with_platformio()
169169
set -e
170170
}
171171

172-
function run_travis_ci_build()
172+
function install_arduino()
173173
{
174-
# Build documentation using Sphinx
175-
echo -e "travis_fold:start:docs"
176-
cd $TRAVIS_BUILD_DIR/doc
177-
build_docs
178-
echo -e "travis_fold:end:docs"
179-
180-
# Build release package
181-
echo -e "travis_fold:start:build_package"
182-
cd $TRAVIS_BUILD_DIR/package
183-
build_package
184-
echo -e "travis_fold:end:build_package"
185-
186-
if [ "$TRAVIS_TAG" != "" ]; then
187-
echo "Skipping tests for tagged build"
188-
return 0;
189-
fi
190-
191-
# Run host side tests
192-
echo -e "travis_fold:start:host_tests"
193-
cd $TRAVIS_BUILD_DIR/tests
194-
run_host_tests
195-
echo -e "travis_fold:end:host_tests"
196-
197174
# Install Arduino IDE and required libraries
198175
echo -e "travis_fold:start:sketch_test_env_prepare"
199176
cd $TRAVIS_BUILD_DIR
@@ -202,7 +179,10 @@ function run_travis_ci_build()
202179
cd $TRAVIS_BUILD_DIR
203180
install_libraries
204181
echo -e "travis_fold:end:sketch_test_env_prepare"
182+
}
205183

184+
function build_sketches_with_arduino()
185+
{
206186
# Compile sketches
207187
echo -e "travis_fold:start:sketch_test"
208188
build_sketches $HOME/arduino_ide $TRAVIS_BUILD_DIR/libraries "-l $HOME/Arduino/libraries"
@@ -212,20 +192,28 @@ function run_travis_ci_build()
212192
echo -e "travis_fold:start:size_report"
213193
cat size.log
214194
echo -e "travis_fold:end:size_report"
215-
216-
# PlatformIO
217-
echo -e "travis_fold:start:install_platformio"
218-
install_platformio
219-
echo -e "travis_fold:end:install_platformio"
220-
221-
echo -e "travis_fold:start:build_sketches_with_platformio"
222-
build_sketches_with_platformio $TRAVIS_BUILD_DIR/libraries "--board nodemcuv2 --verbose"
223-
echo -e "travis_fold:end:build_sketches_with_platformio"
224195
}
225196

226197
set -e
227198

228199
if [ "$BUILD_TYPE" = "build" ]; then
229-
run_travis_ci_build
200+
install_arduino
201+
build_sketches_with_arduino
202+
elif [ "$BUILD_TYPE" = "platformio" ]; then
203+
# PlatformIO
204+
install_platformio
205+
build_sketches_with_platformio $TRAVIS_BUILD_DIR/libraries "--board nodemcuv2 --verbose"
206+
elif [ "$BUILD_TYPE" = "docs" ]; then
207+
# Build documentation using Sphinx
208+
cd $TRAVIS_BUILD_DIR/doc
209+
build_docs
210+
elif [ "$BUILD_TYPE" = "package" ]; then
211+
# Build release package
212+
cd $TRAVIS_BUILD_DIR/package
213+
build_package
214+
elif [ "$BUILD_TYPE" = "host_tests" ]; then
215+
# Run host side tests
216+
cd $TRAVIS_BUILD_DIR/tests
217+
run_host_tests
230218
fi
231219

0 commit comments

Comments
 (0)