-
Notifications
You must be signed in to change notification settings - Fork 10
/
.travis.yml
125 lines (123 loc) · 4.49 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
---
language: cpp
addons:
apt:
packages:
- gcc-9
- g++-9
- gcc-6
- g++-6
- clang-8
- libgsl-dev
- libfftw3-dev
- libcfitsio-dev
- libmuparser-dev
- python3-setuptools
- python3-dev
- cmake
- lcov
- doxygen
sources: &sources
- ubuntu-toolchain-r-test
cache:
directories:
- $HOME/hermes_cache
matrix:
include:
- os: linux
dist: bionic
compiler: gcc
env:
- COMPILER_NAME=gcc CXX=g++-9 CC=gcc-9
- PYTHON_EXECUTABLE=/usr/bin/python3
- COVERALLS=true
- os: linux
dist: xenial
compiler: gcc
env:
- COMPILER_NAME=gcc CXX=g++-6 CC=gcc-6
- PYTHON_EXECUTABLE=/usr/bin/python3
- os: linux
dist: xenial
compiler: clang
env:
- COMPILER_NAME=clang CXX=clang++ CC=clang
- PYTHON_EXECUTABLE=/usr/bin/python3
- os: osx
compiler: gcc
env:
- CXX_COMPILER='g++'
- C_COMPILER='gcc'
- HERMES_DATA_PATH=$TRAVIS_BUILD_DIR/build/data/
- os: osx
compiler: clang
env:
- CXX_COMPILER='clang++'
- C_COMPILER='clang'
- HERMES_DATA_PATH=$TRAVIS_BUILD_DIR/build/data/
before_install:
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo apt-get update
fi;
- |
if [ $COVERALLS ]; then
pip install --user cpp-coveralls
fi;
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
HOMEBREW_NO_AUTO_UPDATE=1 brew install python3;
HOMEBREW_NO_AUTO_UPDATE=1 brew install gsl;
HOMEBREW_NO_AUTO_UPDATE=1 brew install cfitsio;
HOMEBREW_NO_AUTO_UPDATE=1 brew install gcc;
HOMEBREW_NO_AUTO_UPDATE=1 brew install jq;
HOMEBREW_NO_AUTO_UPDATE=1 brew link --overwrite gcc;
HOMEBREW_NO_AUTO_UPDATE=1 brew link --overwrite python;
fi;
before_script:
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
GCC_BREW_PATH=$(brew --cellar gcc)/$(brew info --json gcc | jq -r '.[0].installed[0].version');
PYTHON_BREW_PATH=$(brew --cellar python)/$(brew info --json python | jq -r '.[0].installed[0].version');
fi;
- mkdir build
- cd build
- |
DATAFILE=$HOME/hermes_cache/hermes-data.tar.gz
if [ -f $DATAFILE ]; then
echo "Using data file from cache!"
cp $DATAFILE .
fi;
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$TRAVIS_COMPILER" == "gcc" ]]; then
CC=$GCC_BREW_PATH/bin/gcc-9 \
CXX=$GCC_BREW_PATH/bin/g++-9 \
CMAKE_C_COMPILER=$GCC_BREW_PATH/bin/gcc-9 \
CMAKE_CXX_COMPILER=$GCC_BREW_PATH/bin/g++-9 \
cmake .. -DENABLE_PYTHON=True \
-DPYTHON_EXECUTABLE=$PYTHON_BREW_PATH/bin/python3 \
-DPYTHON_LIBRARY=$PYTHON_BREW_PATH/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7.dylib \
-DPYTHON_INCLUDE_PATH=$PYTHON_BREW_PATH/Frameworks/Python.framework/Versions/3.7/include \
-DENABLE_TESTING=On
elif [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$TRAVIS_COMPILER" == "clang" ]]; then
cmake .. -DENABLE_PYTHON=True \
-DPYTHON_EXECUTABLE=$PYTHON_BREW_PATH/bin/python3 \
-DPYTHON_LIBRARY=$PYTHON_BREW_PATH/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7.dylib \
-DPYTHON_INCLUDE_PATH=$PYTHON_BREW_PATH/Frameworks/Python.framework/Versions/3.7/include \
-DENABLE_TESTING=On
elif [ $COVERALLS ]; then
cmake .. -DENABLE_PYTHON=True -DPYTHON_EXECUTABLE=$PYTHON_EXECUTABLE -DENABLE_TESTING=On -DCMAKE_BUILD_TYPE:STRING=Debug -DENABLE_COVERAGE=TRUE
else
cmake .. -DENABLE_PYTHON=True -DPYTHON_EXECUTABLE=$PYTHON_EXECUTABLE -DENABLE_TESTING=On
fi;
- cp hermes-data.tar.gz $HOME/hermes_cache
script:
- make
- make test
after_failure:
- cat Testing/Temporary/LastTest.log
after_success:
- |
if [ $COVERALLS ]; then
coveralls --gcov /usr/bin/gcov-9 --gcov-options '\-lp' --root $HOME/build/cosmicrays/hermes --build-root $HOME/build/cosmicrays/hermes/build --include src --include include --exclude ".*CMakeFiles.*" --exclude libs --exclude test
fi;