@@ -169,31 +169,8 @@ function build_sketches_with_platformio()
169
169
set -e
170
170
}
171
171
172
- function run_travis_ci_build ()
172
+ function install_arduino ()
173
173
{
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
-
197
174
# Install Arduino IDE and required libraries
198
175
echo -e " travis_fold:start:sketch_test_env_prepare"
199
176
cd $TRAVIS_BUILD_DIR
@@ -202,7 +179,10 @@ function run_travis_ci_build()
202
179
cd $TRAVIS_BUILD_DIR
203
180
install_libraries
204
181
echo -e " travis_fold:end:sketch_test_env_prepare"
182
+ }
205
183
184
+ function build_sketches_with_arduino()
185
+ {
206
186
# Compile sketches
207
187
echo -e " travis_fold:start:sketch_test"
208
188
build_sketches $HOME /arduino_ide $TRAVIS_BUILD_DIR /libraries " -l $HOME /Arduino/libraries"
@@ -212,20 +192,28 @@ function run_travis_ci_build()
212
192
echo -e " travis_fold:start:size_report"
213
193
cat size.log
214
194
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"
224
195
}
225
196
226
197
set -e
227
198
228
199
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
230
218
fi
231
219
0 commit comments