-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
Copy path.travis.yml
74 lines (64 loc) · 2.74 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
sudo: required # https://docs.travis-ci.com/user/trusty-ci-environment/
dist: trusty # both needed to install tensorflow correctly
language: python
# tested python language / keras backends matrix
matrix:
include:
- python: 2.7
env: KERAS_BACKEND=theano
- python: 2.7
env: KERAS_BACKEND=tensorflow
# Get gcc 4.8 for compiling C++ (thanks to https://github.com/travis-ci/travis-ci/issues/5627)
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
# Install packages
install:
- wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
# http://conda.pydata.org/docs/commands.html
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
# Useful for debugging any issues with conda
- conda info -a
# create and activiate environment with python=$TRAVIS_PYTHON_VERSION
- conda create -q -n RocAlphaGo-test python=$TRAVIS_PYTHON_VERSION
- source activate RocAlphaGo-test
# 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
# install requirements
- conda install --yes Cython=0.27.3 h5py=2.7.0 numpy=1.13.3 scipy=1.1.0 PyYAML=3.12 matplotlib pandas pytest future
- pip install --user --no-deps sgf==0.5 keras==2.0.4 pygtp==0.3
- pip install --user flake8
# compile cython code
- CC=gcc-4.8 CXX=g++-4.8 python setup.py build_ext --inplace
# install TensorFlow if needed
# tensorflow does not have a python3.3 wheel
- if [[ "$KERAS_BACKEND" == "tensorflow" ]]; then
if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.2.1-cp27-none-linux_x86_64.whl;
elif [[ "$TRAVIS_PYTHON_VERSION" == "3.4" ]]; then
pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.2.1-cp34-cp34m-linux_x86_64.whl;
elif [[ "$TRAVIS_PYTHON_VERSION" == "3.5" ]]; then
pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.2.1-cp35-cp35m-linux_x86_64.whl;
elif [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then
pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.2.1-cp36-cp36m-linux_x86_64.whl;
fi
fi
# Install Theano with dependencies
- if [[ "$KERAS_BACKEND" == "theano" ]]; then
conda install mkl-service && export MKL_THREADING_LAYER=GNU;
pip install --user Theano==1.0.2;
fi
# run flake8 and unit tests
script:
- flake8
- flake8 --config=.flake8.cython
# run unit test
- python -m unittest discover