-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
155 lines (135 loc) · 6.16 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# Travis CI configuration file
language: cpp
compiler:
#- clang
- gcc
# blacklist
branches:
except:
- experimental
- /^appveyor.*$/
env:
global:
# Dependencies
- DEPS_DIR="`readlink -f $TRAVIS_BUILD_DIR/..`"
- OPENCV_BUILD_DIR=$DEPS_DIR/opencv/build
# TRAVIS_BUILD_DIR: The absolute path to the directory where the repository being built has been copied on the worker.
- ELM_BUILD_DIR=$TRAVIS_BUILD_DIR/build
# since we've set language to cpp we have to define python vars oursevles
- TRAVIS_PYTHON_VERSION="2.7"
# ELM build parameters
- BUILD_TYPE=Coverage
- BUILD_SHARED_LIBS=OFF
- secure: "fvYVNecz00QbdEz9sWc5bUjaCby7fsrfKzkFCTzsYmI2PzRB1CMKDpIxjxI77z/KixFeiZkQ2IAQck13EvWCnqEccBjt/MmrmJGWBLwpK1yAaJe4opFICQcUwvmG8GN0/ppi7g+QD9Svu+mrMEsVBoQm9nX+NdvMAMSMiX7ZXFg="
before_install:
- travis_retry sudo apt-get update -qq
- which python
- python --version
- cmake --version
# Build Google Test Framework from source
- cd $DEPS_DIR
- travis_retry wget --quiet https://googletest.googlecode.com/files/gtest-1.7.0.zip
- unzip -qq gtest-1.7.0.zip
- cd gtest-1.7.0
- cmake . > /dev/null
- make > /dev/null
- cd $DEPS_DIR
# get HDF5, build after apt-get installation
- travis_retry wget --quiet https://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.14/src/hdf5-1.8.14.tar.gz
# get MATIO, build after apt-get installation
- travis_retry wget --quiet http://downloads.sourceforge.net/project/matio/matio/1.5.2/matio-1.5.2.tar.gz
# for PCL
- sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl -y
- travis_retry sudo apt-get update -qq
# Setup anaconda for python bindings
- echo "Python $TRAVIS_PYTHON_VERSION"
# CREDIT: https://github.com/SmokinCaterpillar/pypet/blob/master/.travis.yml
- if [[ $TRAVIS_PYTHON_VERSION == 2.* ]]; then
travis_retry wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
else
travis_retry wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
# miniconda is not always updated with conda
- conda update -q conda
# Useful for debugging any issues with conda
- conda info -a
# Replace dep1 dep2 ... with your dependencies
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION pip numpy
- source activate test-environment
# list installed python packages
- pip freeze
# Build OpenCV 2.4 from source
- travis_retry git clone https://github.com/Itseez/opencv.git $DEPS_DIR/opencv
- cd $DEPS_DIR/opencv
- git fetch && git branch -a && git checkout 2.4
- mkdir $OPENCV_BUILD_DIR && cd $OPENCV_BUILD_DIR
- cmake -DBUILD_SHARED_LIBS=OFF -DBUILD_DOCS=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_opencv_ts=OFF -DBUILD_opencv_gpu=OFF -DBUILD_opencv_java=OFF -DBUILD_opencv_calib3d=OFF -DBUILD_opencv_stitching=OFF $DEPS_DIR/opencv
- make -j2 > /dev/null
# back to ELM source directory
- cd $TRAVIS_BUILD_DIR
install:
# lcov: for test coverage reporting, building with coverage info
# gfortran fort77 are for HDF5, MATIO support
- travis_retry sudo apt-get install -y -qq libboost-system-dev libboost-filesystem-dev libboost-graph-dev libboost-serialization-dev libboost-thread-dev libboost-python-dev libpcl-all lcov gfortran fort77 doxygen graphviz > /dev/null
# install lcov to coveralls conversion + upload tool
- gem install coveralls-lcov
#- if [ "$BUILD_TYPE" == "Coverage" ]; then travis_retry pip install nose coveralls; fi
- travis_retry pip install nose
# HDF5
- cd $DEPS_DIR
- tar -xzf hdf5-1.8.14.tar.gz
- cd hdf5-1.8.14
- mkdir $DEPS_DIR/hdf5
- ./configure --prefix=$DEPS_DIR/hdf5 -q --enable-fortran --enable-fortran2003 --with-default-api-version=v18 --enable-silent-rules CXXFLAGS="--param ggc-min-expand=3 --param ggc-min-heapsize=5120 -w" CFLAGS="--param ggc-min-expand=3 --param ggc-min-heapsize=5120 -w" > /dev/null
- make -j2 #> /dev/null 2>&1
- make install > /dev/null 2>&1
# MATIO
- cd $DEPS_DIR
- tar -xzf matio-1.5.2.tar.gz
- cd matio-1.5.2
- mkdir $DEPS_DIR/matio
- ./configure --prefix=$DEPS_DIR/matio --enable-mat73=yes --with-default-file-ver=7.3 --with-hdf5=$DEPS_DIR/hdf5 > /dev/null
- make -j2 > /dev/null 2>&1
- make install > /dev/null 2>&1
# back to ELM source directory
- cd $TRAVIS_BUILD_DIR
before_script:
- echo $ELM_BUILD_DIR
- mkdir -p $ELM_BUILD_DIR && cd $ELM_BUILD_DIR
# PCL has little support for C++11, same for boost < 1.48
- cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_SHARED_LIBS=$BUILD_SHARED_LIBS -DCMAKE_CXX_FLAGS="-fPIC --param ggc-min-expand=3 --param ggc-min-heapsize=5120" -DOpenCV_DIR=$OPENCV_BUILD_DIR -DGTEST_ROOT=$DEPS_DIR/gtest-1.7.0 -DCMAKE_INSTALL_PREFIX=install -DWITH_MATIO=ON -DMATIO_DIR=$DEPS_DIR/matio -DHDF5_DIR=$DEPS_DIR/hdf5 -DBUILD_python=ON $TRAVIS_BUILD_DIR
script:
- cd $ELM_BUILD_DIR
- travis_retry make -j2
# run unit tests
- if [ "$BUILD_TYPE" == "Coverage" ]; then
make elm_unittests_coverage;
else
cd $ELM_BUILD_DIR/bin && ./run_elm_unittests;
fi
# run nose tests
- export PYTHONPATH=$ELM_BUILD_DIR/lib:$PYTHONPATH
# Back to root build directory
- cd $TRAVIS_BUILD_DIR/bindings/elm/python/test
- ls -a
#- nosetests --with-cov --cover-package=elm --logging-level=INFO
- nosetests --logging-level=INFO
- ls -a
after_success:
# c++ test coverage
- cd $ELM_BUILD_DIR
- if [ "$BUILD_TYPE" == "Coverage" ]; then coveralls-lcov coverage.info; fi
# Convert to json for merging with python coverage
#- coveralls-lcov -v -n coverage.info > coverage.json
# python test coverage TODO
#- cd $TRAVIS_BUILD_DIR/bindings/elm/python/test
# Merge python coverage with coveralls-style json file and send it to api endpoint
# Note: This file must contain "source_files" data or it will not be merged
#- coveralls --config_file .coveragerc --merge=$ELM_BUILD_DIR/coverage.json
# Generate and publish docs
- chmod -R 744 $TRAVIS_BUILD_DIR/.ci/travis
- $TRAVIS_BUILD_DIR/.ci/travis/docs_to_gh-pages.sh