Switched to platformio for examples building.
This commit is contained in:
parent
aa35573ca6
commit
afbb2f296d
63
.travis.yml
63
.travis.yml
|
|
@ -1,39 +1,46 @@
|
||||||
# Kudos to these guys:
|
# Kudos to these guys:
|
||||||
# http://genbattle.bitbucket.org/blog/2016/01/17/c++-travis-ci/
|
|
||||||
# https://github.com/ticapix/arduino-toolbox/blob/master/.travis.yml
|
|
||||||
# https://github.com/Return-To-The-Roots/s25client/blob/master/.travis.yml
|
# https://github.com/Return-To-The-Roots/s25client/blob/master/.travis.yml
|
||||||
|
# http://docs.platformio.org/en/stable/ci/travis.html
|
||||||
|
|
||||||
sudo: false
|
sudo: false
|
||||||
language: cpp
|
language: python
|
||||||
|
|
||||||
os:
|
os:
|
||||||
- linux
|
- linux
|
||||||
|
|
||||||
compiler:
|
python:
|
||||||
- g++
|
- "2.7"
|
||||||
- clang
|
|
||||||
|
# Cache PlatformIO packages using Travis CI container-based infrastructure
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- "~/.platformio"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
global:
|
||||||
- BUILD_TYPE=Debug
|
- BUILD_TYPE=Debug
|
||||||
|
matrix:
|
||||||
|
- BUILD_UNIT_TESTS=1
|
||||||
|
- PLATFORMIO_CI_SRC=examples/Basic_IO
|
||||||
|
- PLATFORMIO_CI_SRC=examples/Bench
|
||||||
|
- PLATFORMIO_CI_SRC=examples/Callbacks
|
||||||
|
- PLATFORMIO_CI_SRC=examples/DualMerger
|
||||||
|
- PLATFORMIO_CI_SRC=examples/Input
|
||||||
|
- PLATFORMIO_CI_SRC=examples/MidiUSB
|
||||||
|
- PLATFORMIO_CI_SRC=examples/RPN_NRPN
|
||||||
|
- PLATFORMIO_CI_SRC=examples/SimpleSynth
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
- llvm-toolchain-precise-3.5
|
|
||||||
packages:
|
packages:
|
||||||
- g++-4.8
|
- g++-4.8
|
||||||
- clang-3.5
|
|
||||||
- llvm-3.5
|
|
||||||
- cmake
|
- cmake
|
||||||
|
|
||||||
#before_install:
|
|
||||||
# - source <(curl -SLs https://raw.githubusercontent.com/fortyseveneffects/travis-ci-arduino/master/install.sh)
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
# Enable coverage analysis only for GCC
|
|
||||||
- |
|
- |
|
||||||
if [ "$CXX" = "g++" ]; then
|
if [ "$BUILD_UNIT_TESTS" ]; then
|
||||||
# GCov 4.6 cannot handle the file structure
|
# GCov 4.6 cannot handle the file structure
|
||||||
export CXX="g++-4.8"
|
export CXX="g++-4.8"
|
||||||
export GCOV="gcov-4.8"
|
export GCOV="gcov-4.8"
|
||||||
|
|
@ -49,24 +56,26 @@ install:
|
||||||
# Install coveralls tool
|
# Install coveralls tool
|
||||||
gem install coveralls-lcov
|
gem install coveralls-lcov
|
||||||
export GENERATE_COVERAGE=1
|
export GENERATE_COVERAGE=1
|
||||||
|
|
||||||
else
|
else
|
||||||
export GCOV="gcov" # Just to have anything valid
|
# Install PlatformIO
|
||||||
export GENERATE_COVERAGE=0
|
pip install -U platformio
|
||||||
fi
|
fi
|
||||||
# Use clang 3.5
|
|
||||||
- if [ "$CXX" = "clang++" ]; then export CXX="clang++-3.5"; export CC="clang-3.5"; fi
|
|
||||||
# - arduino --install-library "MIDIUSB"
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
# Build examples with Arduino IDE on each available platform / board
|
# Build unit tests & generate code coverage
|
||||||
# - build_main_platforms
|
- |
|
||||||
|
if [ "${BUILD_UNIT_TESTS}" ]; then
|
||||||
|
mkdir build && cd build
|
||||||
|
cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILDER_ENABLE_PROFILING=${GENERATE_COVERAGE} --generator="Unix Makefiles" ..
|
||||||
|
make all
|
||||||
|
ctest --verbose
|
||||||
|
fi
|
||||||
|
|
||||||
# Build and run unit tests with regular C++ compiler
|
# Build current example
|
||||||
- mkdir build && cd build
|
- |
|
||||||
- cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILDER_ENABLE_PROFILING=${GENERATE_COVERAGE} --generator="Unix Makefiles" ..
|
if [ ! "${BUILD_UNIT_TESTS}" ]; then
|
||||||
- make all
|
platformio ci --lib="." --board=uno --board="due" --board="zero" --board="leonardo"
|
||||||
- ctest --verbose
|
fi
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- |
|
- |
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue