forked from openworm/open-worm-analysis-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
114 lines (101 loc) · 4.91 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
# The movement_validation Travis CI build configuration file.
#
# The original template for this .travis.yml came from
# https://gist.github.com/dan-blanchard/7045057
#
language: python
python:
#- 2.7
#Open CV isn't working with 3.3 for some reason ...
- 3.3
#- 3.4
notifications:
email: false
env:
global:
# Dependencies
- DEPS_DIR="`readlink -f $TRAVIS_BUILD_DIR/..`"
- OPENCV_BUILD_DIR=$DEPS_DIR/opencv/build
#This will obviously need to be made generic ...
#- MINICONDA_DIR=/home/travis/virtualenv/python3.3.5
#THis is the python 2.7 version ...
#- MINICONDA_DIR=/home/travis/miniconda
#Is this the path for miniconda3?
- MINICONDA_DIR=/home/travis/miniconda3
before_install:
- #http://ryanvarley.uk/solutions/2014/05/14/how-to-solve-travis-ci-matplotlib-tclerror-no-display/
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- which python
- python --version
- cmake --version
# Anaconda installation
- wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
#- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b
- export PATH=$MINICONDA_DIR/bin:$PATH
#- conda update --yes conda
# Need to install the actual Python version, does this work?
# To get the correct version you have to do a conda install
# Old versions are at: http://repo.continuum.io/miniconda/ but don't
# match Python versions and it seems like continuum doesn't want you
# to try and match
- conda install --yes python=$TRAVIS_PYTHON_VERSION atlas numpy scipy matplotlib nose dateutil pandas statsmodels h5py seaborn
- which python
- python --version
# OpenCV
#-------------
# Anaconda doesn't support conda install opencv & binstart wasn't working
# so instead we download and build from source. The only other trick is making
# sure we move the correct files to the correct Python installation, which is
# done via specifying PYTHON_PACKAGES_PATH
# - @JimHokanson
#
# References:
# https://github.com/kevin-brown/blog.kevin-brown.com/blob/
# 2d5296a8c1ac76dc5cbd2b98d765749c043fc521/_posts/
# 2014-09-27-building-and-installing-opencv-3.markdown
# https://github.com/kashefy/elm/blob/
# 76dbd0214dbab91a7de3bdd94767ef08aa67d0f4/.travis.yml
# 1) Get from source, currently master is v3.0.0 (supporting Python 3)
- travis_retry git clone --depth 1 https://github.com/Itseez/opencv.git $DEPS_DIR/opencv
- mkdir $OPENCV_BUILD_DIR && cd $OPENCV_BUILD_DIR
# https://scivision.co/anaconda-python-opencv3/
# ------------------------------------------
- cmake -DBUILD_TIFF=ON -DBUILD_opencv_java=OFF -DWITH_CUDA=OFF -DENABLE_AVX=ON -DWITH_OPENGL=ON -DWITH_OPENCL=ON -DWITH_IPP=ON -DWITH_TBB=ON -DWITH_EIGEN=ON -DWITH_V4L=ON -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=$(python3 -c "import sys; print(sys.prefix)") -DPYTHON_EXECUTABLE=$(which python3) -DPYTHON_INCLUDE_DIR=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") -DPYTHON_PACKAGES_PATH=$(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") ..
- make -j4
- sudo make install
# https://gist.github.com/itguy51/4239282
# ------------------------------------------
- echo "/usr/local/lib" | sudo tee -a /etc/ld.so.conf.d/opencv.conf
- sudo ldconfig
- echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig" | sudo tee -a /etc/bash.bashrc
- echo "export PKG_CONFIG_PATH" | sudo tee -a /etc/bash.bashrc
- export PYTHONPATH=$OPENCV_BUILD_DIR/lib/python3.3/site-packages:$PYTHONPATH
# Is this still an issue? Can we remove it? - @JimHokanson, 2015/06/15
# The next couple lines fix a crash with multiprocessing on Travis and
# are not specific to using Miniconda
- sudo rm -rf /dev/shm
- sudo ln -s /run/shm /dev/shm
- sudo /bin/cp $TRAVIS_BUILD_DIR/movement_validation/travis_config.txt $TRAVIS_BUILD_DIR/movement_validation/user_config.py
before_script:
- mkdir $TRAVIS_BUILD_DIR/example_data
- cd $TRAVIS_BUILD_DIR/example_data
# TODO: Presumably the initial address could be a variable
- wget "https://googledrive.com/host/0B7to9gBdZEyGNWtWUElWVzVxc0E/example_contour_and_skeleton_info.mat" -O example_contour_and_skeleton_info.mat
- wget "https://drive.google.com/uc?export=download&id=0B7to9gBdZEyGX2tFQ1JyRzdUYUE" -O example_video_feature_file.mat
- wget "https://drive.google.com/uc?export=download&id=0B7to9gBdZEyGakg5U3loVUktRm8" -O example_video_norm_worm.mat
# TODO: Presumably we could run some command on the directory
# This may no longer be necessary, found other bugs ...
- ls -l
- chmod 777 example_contour_and_skeleton_info.mat
- chmod 777 example_video_feature_file.mat
- chmod 777 example_video_norm_worm.mat
- pwd
- ls -l
# Run test
script:
- cd $TRAVIS_BUILD_DIR/tests
- pwd
- nosetests --nocapture