forked from FortySevenEffects/arduino_midi_library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
104 lines (91 loc) · 3.36 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Kudos to these guys:
# https://github.com/Return-To-The-Roots/s25client/blob/master/.travis.yml
# http://docs.platformio.org/en/stable/ci/travis.html
sudo: false
language: python
os:
- linux
python:
- "2.7"
# Cache PlatformIO packages using Travis CI container-based infrastructure
cache:
directories:
- "~/.platformio"
env:
global:
- 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/ErrorCallback
- PLATFORMIO_CI_SRC=examples/Input
- PLATFORMIO_CI_SRC=examples/RPN_NRPN
- PLATFORMIO_CI_SRC=examples/SimpleSynth
- PLATFORMIO_CI_SRC=examples/AltPinSerial
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
- cmake
install:
- |
if [ "${BUILD_UNIT_TESTS}" ]; then
# GCov 4.6 cannot handle the file structure
export CXX="g++-4.8"
export GCOV="gcov-4.8"
# Install newer lcov (1.9 seems to fail: http://gronlier.fr/blog/2015/01/adding-code-coverage-to-your-c-project/)
export LCOV_ROOT="$HOME/lcov"
mkdir -p "$LCOV_ROOT"
wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.14.orig.tar.gz --output-document="$LCOV_ROOT/lcov.tar.gz"
tar xf "$LCOV_ROOT/lcov.tar.gz" --strip-components=1 -C $LCOV_ROOT
export PATH="$LCOV_ROOT/bin:$PATH"
which lcov
# Install coveralls tool
gem install coveralls-lcov
export GENERATE_COVERAGE=1
else
# Install PlatformIO
pip install -U platformio
fi
script:
# Build unit tests & generate code coverage
- |
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 current example
- |
if [ ! "${BUILD_UNIT_TESTS}" ]; then
platformio ci --lib="." \
--board="uno" \
--board="due" \
--board="zero" \
--board="leonardo" \
--board="micro" \
--board="nanoatmega328" \
--board="megaatmega2560" \
--board="teensy2" \
--board="teensy30" \
--board="teensy31" \
--board="teensylc"
fi
after_success:
- |
if [ "${GENERATE_COVERAGE}" ]; then
# Generate code coverage information & send to Coveralls
rm -rf ./external/google-test/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.gcda
lcov --gcov-tool $GCOV --directory . --capture --output-file coverage.info
lcov --gcov-tool $GCOV --remove coverage.info 'test/*' '/usr/*' 'external/*' --output-file coverage.info
lcov --list coverage.info
coveralls-lcov --repo-token ${COVERALLS_TOKEN} coverage.info
fi
notifications:
email: false