This repository has been archived by the owner on May 13, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
174 lines (169 loc) · 4.45 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
language: cpp
notifications:
email: false
branches:
only:
- master
dist: trusty
matrix:
fast_finish: true
include:
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9
env: COMPILER=gcc GCC=4.9
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
env: COMPILER=gcc GCC=5
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
env: COMPILER=gcc GCC=6
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-3.9
packages:
- clang-3.9
- libstdc++-6-dev # need newer libstdc++ for C++14 support
env: COMPILER=clang CLANG=3.9
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
packages:
- clang-4.0
- libstdc++-6-dev
env: COMPILER=clang CLANG=4.0
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
packages:
- clang-5.0
- libstdc++-6-dev
env: COMPILER=clang CLANG=5.0
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-6.0
packages:
- clang-6.0
- libstdc++-6-dev
env: COMPILER=clang CLANG=6.0
- os: osx
osx_image: xcode8
compiler: clang
- os: osx
osx_image: xcode9
compiler: clang
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
language: python
env: PYTEST=2.7 COMPILER=gcc GCC=7
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-8
language: python
env: PYTEST=3.6 COMPILER=gcc GCC=8
- python: 3.5
language: python
env: DOCS=yes
env:
global:
- MINICONDA_VERSION="latest"
- MINICONDA_LINUX="Linux-x86_64"
- MINICONDA_OSX="MacOSX-x86_64"
before_install:
# Configure build variables
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
if [[ "$COMPILER" == "gcc" ]]; then
export CXX=g++-$GCC CC=gcc-$GCC;
fi
if [[ "$COMPILER" == "clang" ]]; then
export CXX=clang++-$CLANG CC=clang-$CLANG;
fi
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
export CXX=clang++ CC=clang;
fi
# Install miniconda / update conda
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
MINICONDA_OS=$MINICONDA_LINUX;
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
MINICONDA_OS=$MINICONDA_OSX;
fi
- wget "http://repo.continuum.io/miniconda/Miniconda3-$MINICONDA_VERSION-$MINICONDA_OS.sh" -O miniconda.sh;
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
install:
# Create conda environment
- if [[ "$DOCS" == "yes" ]]; then
conda env create -n test_env --file doc/environment.yml;
conda install -n test_env doxygen sphinx_rtd_theme -c conda-forge;
elif [[ "$PYTEST" == "2.7" ]]; then
conda create -n test_env python=2.7 pip numpy cmake xtensor-python pytest -c conda-forge;
elif [[ "$PYTEST" == "3.6" ]]; then
conda create -n test_env python=3.6 pip numpy cmake xtensor-python pytest -c conda-forge;
else
conda create -n test_env gtest cmake xtensor -c conda-forge;
fi
- source activate test_env
- conda list
# Maybe build tests or build/install Python bindings
- if [[ "$DOCS" == "yes" ]]; then
cd doc;
elif [[ "$PYTEST" == "2.7" || "$PYTEST" == "3.6" ]]; then
cd python;
pip install -e . -v;
else
mkdir build;
cd build;
cmake -DBUILD_TESTS=ON ..;
make -j2 test_fastscapelib;
cd test;
fi
script:
# Build docs or run tests
- if [[ "$DOCS" == "yes" ]]; then
doxygen;
sphinx-build -n -j auto -b html -d _build/doctrees source _build/html;
elif [[ "$PYTEST" == "2.7" || "$PYTEST" == "3.6" ]]; then
pytest -vv fastscapelib;
else
./test_fastscapelib;
fi