-
Notifications
You must be signed in to change notification settings - Fork 15
/
.travis.yml
81 lines (66 loc) · 2.03 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
# Travis-CI build script for cobs
language: cpp
sudo: false
dist: bionic
addons:
apt:
packages:
- python3
- python3-pip
- python3-setuptools
- python3-sphinx
- lcov
matrix:
include:
# gcc 7.x, Debug with -O1
- env: CMAKE_CC="gcc" CMAKE_CXX="g++" BUILD_TYPE="Debug" COMPILER_FLAGS="-O1"
# gcc 7.x, Release
- env: CMAKE_CC="gcc" CMAKE_CXX="g++" BUILD_TYPE="Release" COMPILER_FLAGS=""
# gcc 7.x, Debug with -O1 and coverage
- env: CMAKE_CC="gcc" CMAKE_CXX="g++" BUILD_TYPE="Debug" COMPILER_FLAGS="-O1" BUILD_COVERAGE="1"
before_script:
# print out some version numbers
- $CMAKE_CXX --version
- cmake --version
# gcov coverage
- if [ -n "$BUILD_COVERAGE" -a -n "$COVERALLS_REPO_TOKEN" ]; then
pip install --user cpp-coveralls;
CMAKE_ARGS="$CMAKE_ARGS -DCOBS_USE_GCOV=ON";
fi
# configure
- mkdir build; cd build
- cmake
-DCMAKE_BUILD_TYPE="$BUILD_TYPE"
-DCMAKE_C_COMPILER="$CMAKE_CC" -DCMAKE_CXX_COMPILER="$CMAKE_CXX"
-DCMAKE_C_FLAGS="$COMPILER_FLAGS" -DCMAKE_CXX_FLAGS="$COMPILER_FLAGS"
-DPYTHON_EXECUTABLE="/usr/bin/python3"
$CMAKE_ARGS ..
script:
# build and run tests
- make -j2 && ctest -V
# install and test python module
- cd $TRAVIS_BUILD_DIR
- mkdir build-python; cd build-python
- pip3 install --user --verbose ..
- cd $TRAVIS_BUILD_DIR/python && python3 -m unittest
after_success:
# upload coverage
- if [ -n "$BUILD_COVERAGE" -a -n "$COVERALLS_REPO_TOKEN" ]; then
cd $TRAVIS_BUILD_DIR;
coveralls --exclude extlib --exclude python --exclude build/CMakeFiles --gcov-options '\-lp';
fi
# build docs
- pip3 install --user sphinx-rtd-theme
- cd $TRAVIS_BUILD_DIR/python/docs && make html
- touch _build/html/.nojekyll
deploy:
provider: pages
local_dir: $TRAVIS_BUILD_DIR/python/docs/_build/html/
repo: bingmann/cobs-python-docs
skip_cleanup: true
github_token: $GITHUB_TOKEN
keep_history: true
target_branch: master
on:
branch: master
condition: $BUILD_TYPE = Release