forked from PrincetonUniversity/athena
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
193 lines (189 loc) · 7.83 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# .travis.yml
# Defines build matrix and regression tests for Travis CI
language: cpp
branches:
only:
- master
- dust
- mhd4_3D
# Default build matrix is 4x Ubuntu builds (inherit the default stage name "test"):
os:
- linux
dist: trusty
sudo: false # use faster container-based build
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
packages:
- "python3"
- "python3-pip"
- "g++-7" # Ubuntu 14.04.05 ships with GCC 4.8.4 (not 4.8.2) as of 2018-12-11
- "clang-5.0" # Ubuntu 14.04.05 ships with Clang 3.5.0 as of 2018-10-29
# OpenMPI and MPICH implementations:
env:
matrix:
- MPI_CHOICE=mpich
- MPI_CHOICE=openmpi
compiler:
- g++
- clang++
# Define Ubuntu build caches (cache ignored inside "include:" matrix)
cache:
pip: true # Caching NumPy for regression test script
directories: # TODO(felker): sync "version_str=" lines in install scripts with cache dir names
# For caching Linux source directories:
- openmpi-3.0.2
- mpich-3.2.1
# Caching Linux install directories:
- openmpi
- mpich
- fftw
- fftw-3.3.8
- hdf5
- hdf5-1.10.4
# Explicitly includilng the 2x macOS jobs in build matrix (inherit the default stage name "test")
# Must specify complete build details, or the jobs will inherit
# the first value in the above arrays. Could encapsulate in script
# --------------
# TODO(felker): improve syncing of osx "softwareupdate" cmd xcode version argument in
# tst/ci/travis/ install_mpich.sh, install_openmpi.sh (workaround for Homebrew GCC)
matrix:
include:
- os: osx
osx_image: xcode11.2
compiler: clang++
addons:
homebrew:
packages:
- python3
env:
- MPI_CHOICE=mpich
# Override Linux cache mapping
cache:
pip: true
directories:
- "/usr/local/Cellar/mpich/"
- "/usr/local/Cellar/open-mpi/"
- "/usr/local/Cellar/libevent/"
- "/usr/local/Cellar/szip/"
- "/usr/local/Cellar/hwloc/"
# Cached Homebrew install of OpenMPI needs libevent 2.* symlink:
#- "/usr/local/opt/libevent" # Travis CI won't cache symlink
# For caching macOS Homebrew installation symlinks:
- openmpi
- mpich
- fftw
- "/usr/local/Cellar/fftw/"
- hdf5
- "/usr/local/Cellar/hdf5/"
- os: osx
osx_image: xcode11.2
compiler: clang++
addons:
homebrew:
packages:
- python3
env:
- MPI_CHOICE=openmpi
- TMPDIR=/tmp
# Cache is shared with other osx build with MPICH
cache:
pip: true
directories:
- "/usr/local/Cellar/mpich/"
- "/usr/local/Cellar/open-mpi/"
- "/usr/local/Cellar/libevent/"
- "/usr/local/Cellar/szip/"
- "/usr/local/Cellar/hwloc/"
- openmpi
- mpich
- fftw
- "/usr/local/Cellar/fftw/"
- hdf5
- "/usr/local/Cellar/hdf5/"
# Run style checks only once: inherits first value of each Build Matrix dimension
# (Ubuntu, GCC, MPICH). 'job: include:' is an alias for 'matrix: include:'
# Test PEP 8 style compliance for .py files:
- stage: python linter
before_install: skip
install: skip
addons:
apt:
packages:
- "python3"
- "python3-pip"
env:
compiler:
script: python3 -m flake8 --exclude=cpplint.py,openmpi-* && echo "Finished linting Python files with flake8"
# Test Google C++ Style Guide adherence for .cpp, .hpp files:
- stage: c++ linter
before_install: skip
install: skip
before_script: skip
addons:
env:
compiler:
# "python" must point to Py2 distro, otherwise cpplint.py will silently quit while checking 1st file
script: cd tst/style/ && ./check_athena_cpp_style.sh
# Recommended by Travis CI documentation to unset CC, CXX env. vars for MPI builds to prevent conflicts
before_install:
# Specify upgraded compilers on Ubuntu image builds:
# /usr/local/clang-5.0.0/bin (tags/RELEASE_500/final) as of 2018-12-12
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX_FOR_BUILD" == "clang++" ]]; then eval "CC=clang && CXX=clang++"; fi
# /usr/bin/, clang 5.0.2-svn... : won't take /usr/local/clang/lib/libomp.so workaround in run_tests_travis.sh
# Could try /usr/local/clang-5.0/lib/libomp.so
#- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX_FOR_BUILD" == "clang++" ]]; then eval "CC=clang-5.0 && CXX=clang++-5.0"; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX_FOR_BUILD" == "g++" ]]; then eval "CC=gcc-7 && CXX=g++-7"; fi
- test -n $CC && unset CC
# Cache general 'compiler' choice (g++ vs. clang++) from Travis CI Build Matrix before unsetting
- export TEMP_CXX=$CXX_FOR_BUILD
- export TEMP_CCMD=$CXX
- test -n $CXX && unset CXX
# Dump default system and (possibly upgraded) selected C++ compiler versions
- g++ --version
- clang++ --version
- ${TEMP_CCMD} --version
# Install OpenMPI, MPICH, and FFTW
install:
- travis_wait 45 bash ./tst/ci/travis/install_mpich.sh
- travis_wait 45 bash ./tst/ci/travis/install_openmpi.sh
- bash ./tst/ci/travis/install_fftw.sh
- bash ./tst/ci/travis/install_hdf5.sh
- export PATH=$TRAVIS_BUILD_DIR/fftw/bin/:$TRAVIS_BUILD_DIR/hdf5/bin/:$PATH
- export CPATH=$TRAVIS_BUILD_DIR/fftw/include/:$TRAVIS_BUILD_DIR/hdf5/include/$CPATH
- export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/fftw/share/:$TRAVIS_BUILD_DIR/hdf5/lib/:$LD_LIBRARY_PATH
- export LIBRARY_PATH=$TRAVIS_BUILD_DIR/fftw/lib/:$TRAVIS_BUILD_DIR/hdf5/lib/:$LIBRARY_PATH
# Check fix for OpenMPI version > 2.0 and macOS version > Sierra tmpdir length issue
- echo $TMPDIR || true
# Install Python module dependencies for run_tests.py, utils/athena.py
before_script:
# - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew upgrade python3 || true; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then pyenv global 3.6; fi
- python3 -m pip install --upgrade --user pip # --user is necessary on C++ builds, since no virtualenv, sudo
- python3 --version; pip3 --version
- "pip3 install --user --only-binary=:all: --no-binary=termcolor numpy flake8 h5py scipy colorama termcolor matplotlib || true"
# h5py needed for outputs/all_outputs.py, pgen/hdf5*, eos/eos_hdf5_table.py tests
# scipy needed in scripts/utils/ for eos/ tests
# Above Build Matrix expansion is assigned to default stage name "test";
# Run subset of regression test suite on all build environments
script: ./tst/ci/travis/run_tests_travis.sh
# Specify order of stages; build matrix of regression tests will only run if linters pass
stages:
- python linter
- c++ linter
- test
# Codecov coverage analysis: (Currently, Travis CI builds do not perform any code coverage analysis)
# Could completely disable this step, since Codecov detects CI status via GitHub Commit Status API, not Bash uploader. Disabled searching for coverage reports.
after_success:
- bash <(curl -s https://codecov.io/bash) -X gcov -X search || echo "Codecov did not collect coverage reports"
notifications:
email:
on_success: change
on_failure: always
slack:
rooms:
secure: lQpuacMeYX8RWntTWyNbcaKfLw6gFIwkWfvnqfdpC/PDqB96R3BmfH2Yi6ZQyUOq+dD/QFGpmqJ0YEGD91hwPCaR9P5LMqhhbAbUC3ON23E3vhm33eynGjq7Y492UrQ1vFMUMAzl6mEi+OoSaKpMNi6OSXBEYs2KfxDlwTMWKbw+9pvGS8ydt8RFcsjofeQOeKWH/x09vTwHqsbwaNB0+GzotcbZQ8PQuT9Lot9OER1qiO1JXWzSce9PrJI1mPBWN094cDK3Na8fzUHq6qsY+G+dgTW45/gJjgO3nRawZd/XrY5iZsDKJ1t8XbC8GbHVxZzMcd+g0VEfaV5c4O8U20xBiWwdw8NmbgZB2sSxVi7wLhqDc6a/8brXx92gIP64AA+UTYXVYykU4/IlQqJs74EgAemTQOEHLO3j8ylK832+XS7JHmio9rjRb3y0meF+uWP5xZ71xBSLQcmvEVAJo5fsrK5SxXHkfvNb2ydjp2i+cUiUPlBXtY1HV7JCTnziqFwQvToA7/Z8/Bw/jaV1p2yQHMXTq0LzqiqNOq8aRiMPkMTwI4Hc6wIHkapfInqHGaqoYRbm9qqbbp6VcHmUjwRdVh0xv87PbHiLtgucV8Lq58isqXaZ42Xr5jJc3dKBx9XbDWWYBTMZgJti5Ye0BI4JR7AMjA67Td2FesG60W0=
on_success: always
on_failure: always