-
Notifications
You must be signed in to change notification settings - Fork 16
/
.travis.yml
103 lines (94 loc) · 3.89 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
# Travis CI configuration file
dist: trusty
sudo: false
language: cpp
compiler:
#- clang
- gcc
addons:
apt:
packages:
- protobuf-compiler
# blacklist
branches:
except:
- experimental
- /^appveyor.*$/
env:
global:
# Dependencies
- DEPS_DIR="`readlink -f $TRAVIS_BUILD_DIR/..`"
- CONDA_ENV=test-environment
- CONDA_ENV_PREFIX=$HOME/miniconda/envs/$CONDA_ENV
# since we've set language to cpp we have to define python vars ourselves
- TRAVIS_PYTHON_VERSION="2.7"
- WITH_COVERAGE=OFF
- DO_EXCLUDE_TF_MODULES=ON
- CAFFE_ROOT=$DEPS_DIR/caffe # created during install
before_install:
- echo "Package root:"
- ls -1 $TRAVIS_BUILD_DIR
- echo "modules:"
- ls -1 $TRAVIS_BUILD_DIR/nideep
- which python
- python --version
# 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
- conda create -q -n $CONDA_ENV python=$TRAVIS_PYTHON_VERSION pip numpy scipy nose mock coverage h5py opencv PIL protobuf scikit-learn scikit-image pandas
- source activate $CONDA_ENV
# Download caffe protobuf message definitions
- mkdir -p $CAFFE_ROOT/src/caffe/proto
- travis_retry wget -P $CAFFE_ROOT/src/caffe/proto https://raw.githubusercontent.com/BVLC/caffe/master/src/caffe/proto/caffe.proto
# Download caffe python modules
- mkdir -p $CAFFE_ROOT/python/caffe
- travis_retry wget -P $CAFFE_ROOT/python/caffe https://raw.githubusercontent.com/BVLC/caffe/master/python/caffe/io.py
# Download caffe log parser from caffe repo
- mkdir -p $CAFFE_ROOT/tools/extra
- travis_retry wget -P $CAFFE_ROOT/tools/extra https://raw.githubusercontent.com/BVLC/caffe/master/tools/extra/extract_seconds.py
- travis_retry wget -P $CAFFE_ROOT/tools/extra https://raw.githubusercontent.com/BVLC/caffe/master/tools/extra/parse_log.py
install:
# Packages that need to be installed via pip
- travis_retry pip install lmdb tensorflow
- if [[ $WITH_COVERAGE == ON ]]; then
echo "Installing Coveralls"
travis_retry pip install coveralls;
fi
- export LD_LIBRARY_PATH="$CONDA_ENV_PREFIX/lib:$LD_LIBRARY_PATH"
- export C_INCLUDE_PATH="$CONDA_ENV_PREFIX/include:$C_INCLUDE_PATH"
- export CPLUS_INCLUDE_PATH="$CONDA_ENV_PREFIX/include:$CPLUS_INCLUDE_PATH"
#- pip freeze # list installed python packages
- chmod +x $TRAVIS_BUILD_DIR/.ci/travis/setup_caffe_mock.sh; $TRAVIS_BUILD_DIR/.ci/travis/setup_caffe_mock.sh $TRAVIS_BUILD_DIR $CAFFE_ROOT
#- ls $CAFFE_ROOT/python/caffe/
#- ls $CAFFE_ROOT/python/caffe/proto
script:
- export PYTHONPATH="$TRAVIS_BUILD_DIR:$CAFFE_ROOT/python:$CAFFE_ROOT/tools/extra:$PYTHONPATH"
- if [[ $WITH_COVERAGE == ON ]]; then
nosetests --with-coverage --logging-level=INFO --nocapture;
else
if [[ $DO_EXCLUDE_TF_MODULES == OFF ]]; then
nosetests --logging-level=INFO --nocapture;
else
IGNORE_FILES=`grep -rl 'import tensorflow' . /dev/null | xargs -L 1 basename | paste -sd "|" -`;
echo "Exclude tensorflow dependent modules from test (currently causes segmentation faults):"
echo $IGNORE_FILES;
nosetests . --ignore-files=`echo $IGNORE_FILES` --logging-level=INFO --nocapture;
fi
fi
after_success:
# report test coverage
- if [[ $WITH_COVERAGE == ON ]]; then coveralls --verbose; fi