forked from AMICI-dev/AMICI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
176 lines (167 loc) · 6.67 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
175
176
branches:
only:
- master
- develop
# Release branches, otherwise they cannot be merged into protected master
- /^release.*/
# Version tags
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
matrix:
fast_finish: true
include:
- os: linux
dist: bionic
language: python
python: 3.8
compiler: gcc
addons:
apt:
packages:
- libhdf5-serial-dev
- zlib1g-dev
- libatlas-base-dev
- lcov
- libboost-serialization-dev
- g++-5
- libc6-dbg
env:
- ENABLE_GCOV_COVERAGE=TRUE
- CI_BUILD=TRUE
- CI_CPPUTEST=TRUE
- CI_PYTHON=TRUE
- CI_ARCHIVE=TRUE
- CI_NOTEBOOK=TRUE
before_install:
- ./scripts/buildValgrind.sh
after_script:
# cpputest coverage cpp
- lcov --compat-libtool --no-external --directory ${BASE_DIR}/build/CMakeFiles/amici.dir/src --base-directory ${BASE_DIR} --capture --output-file coverage_cpp.info
# py coverage cpp
- lcov --compat-libtool --no-external --directory ${BASE_DIR}/python/sdist/build/temp.linux-x86_64-${TRAVIS_PYTHON_VERSION}/amici/src --base-directory ${BASE_DIR} --capture --output-file coverage_py.info
- lcov -a coverage_cpp.info -a coverage_py.info -o coverage.info
- bash <(curl -s https://codecov.io/bash) -f coverage.info -X fix -F cpp
# py coverage py
- bash <(curl -s https://codecov.io/bash) -f coverage_py.xml -F python
before_deploy:
- cd $BASE_DIR
deploy:
skip_cleanup: true
provider: script
script: scripts/deployPyPi.sh
on:
branch: master
tags: true
- os: linux
dist: bionic
language: python
python: 3.7
compiler: gcc
addons:
apt:
packages:
- libhdf5-serial-dev
- zlib1g-dev
- libatlas-base-dev
- g++-5
- libc6-dbg
env:
- CI_BUILD=TRUE
- CI_PYTHON=TRUE
- CI_NOTEBOOK=TRUE
- os: osx
osx_image: xcode11
language: minimal
compiler: clang
env:
- CI_BUILD=TRUE
- CI_CPPUTEST=TRUE
- CI_CMAKE=TRUE
- CI_ARCHIVE=TRUE
- CI_CPPCHECK=TRUE
- CI_PYTHON=TRUE
- CI_NOTEBOOK=TRUE
addons:
homebrew:
packages:
- hdf5
- swig
- gcc
- cppcheck
update: true
before_install:
- travis_wait brew link --overwrite gcc # fix linker warning regarding /usr/local/include/c++
- brew link --overwrite python # https://github.com/ICB-DCM/AMICI/issues/894
- export -f travis_fold travis_nanoseconds travis_time_start travis_time_finish
- pip3 install --user -U numpy
after_success:
- cd $BASE_DIR # cd to base dir for correct relative path in deploy
- os: osx
osx_image: xcode11
language: minimal
compiler: clang
env:
- CI_DOC=TRUE
addons:
homebrew:
casks:
- mactex
packages:
# - doxygen # disabled because current 1.8.16 does not work with recent ghostscript
- bison # doxygen build
- ragel
- graphviz
update: true
before_install:
- export PATH=/Users/travis/Library/Python/3.7/bin:/Library/TeX/texbin:$PATH
- export -f travis_fold travis_nanoseconds travis_time_start travis_time_finish
- brew link --overwrite python # https://github.com/ICB-DCM/AMICI/issues/894
after_success:
- cd $BASE_DIR # cd to base dir for correct relative path in deploy
deploy:
provider: pages
local-dir: doc
skip-cleanup: true
github-token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
keep-history: false
verbose: true
on:
branch: master
install:
- export BASE_DIR=`pwd`
# Build swig4.0 (not yet available with apt) to include pydoc in source distribution for pypi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then scripts/downloadAndBuildSwig.sh && export PATH=${BASE_DIR}/ThirdParty/swig-4.0.1/install/bin:${PATH}; fi
- if [[ "$CI_DOC" == "TRUE" ]]; then pip3 install --user --upgrade pip==9.0.3 doxypypy; fi # pinning pip because of https://github.com/pypa/pip/issues/5240
- if [[ "$CI_DOC" == "TRUE" ]]; then export PATH="/usr/local/opt/bison/bin:$PATH"; LDFLAGS="-L/usr/local/opt/bison/lib" scripts/downloadAndBuildDoxygen.sh; fi
- if [[ "$CI_BUILD" == "TRUE" ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pip3 install --upgrade pip==9.0.3 setuptools wheel pkgconfig scipy; fi
- if [[ "$CI_BUILD" == "TRUE" ]] && [[ "$TRAVIS_OS_NAME" != "linux" ]]; then pip3 install --user --upgrade pip==9.0.3 setuptools wheel pkgconfig scipy; fi
- if [[ "$CI_BUILD" == "TRUE" ]]; then ./scripts/buildSuiteSparse.sh; fi
- if [[ "$CI_BUILD" == "TRUE" ]]; then ./scripts/buildSundials.sh; fi
- if [[ "$CI_BUILD" == "TRUE" ]]; then ./scripts/buildCpputest.sh; fi
- if [[ "$CI_PYTHON" == "TRUE" ]]; then ./scripts/buildBNGL.sh; fi
- if [[ "$CI_BUILD" == "TRUE" ]]; then ./scripts/buildAmici.sh; fi
- if [[ "$CI_ARCHIVE" == "TRUE" ]]; then ./scripts/installAmiciArchive.sh; fi
- if [[ "$CI_PYTHON" == "TRUE" ]]; then ./scripts/installAmiciSource.sh; fi
script:
- export -f travis_fold travis_nanoseconds travis_time_start travis_time_finish
- export FOLD=$BASE_DIR/scripts/travis_wrap.sh
- cd $BASE_DIR
- if [[ "$CI_CPPCHECK" == "TRUE" ]]; then $FOLD cppcheck ./scripts/run-cppcheck.sh; fi
- if [[ "$CI_NOTEBOOK" == "TRUE" ]]; then $FOLD notebooks "cd $BASE_DIR && scripts/runNotebook.sh python/examples/example_*/"; fi
- if [[ "$CI_PYTHON" == "TRUE" ]] && [[ "$ENABLE_GCOV_COVERAGE" == "TRUE" ]]; then $FOLD codecov ./scripts/run-codecov.sh; fi
- if [[ "$CI_PYTHON" == "TRUE" ]] && [[ "$ENABLE_GCOV_COVERAGE" != "TRUE" ]]; then $FOLD python-tests ./scripts/run-python-tests.sh; fi
# needs to be run after python tests
- if [[ "$CI_CMAKE" == "TRUE" ]]; then $FOLD cmake ./tests/testCMakeCompilation.sh; fi
- if [[ "$CI_CPPUTEST" == "TRUE" ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then $FOLD valgrind ./scripts/run-valgrind.sh; fi
- if [[ "$CI_CPPUTEST" == "TRUE" ]] && [[ "$TRAVIS_OS_NAME" != "linux" ]]; then $FOLD cpputest ./scripts/run-cpputest.sh; fi
- if [[ "$CI_DOC" == "TRUE" ]]; then $FOLD doxygen ./scripts/run-doxygen.sh; fi
after_failure:
- $FOLD ls -alR
# cache dependencies
cache:
directories:
- $HOME/Library/Caches/Homebrew
- $HOME/Library/Caches/pip
- $HOME/.cache/pip
timeout: 1200
before_cache:
- brew cleanup