-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.travis.yml
100 lines (91 loc) · 4.13 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
# Recipe for build and integration testing on Travis-CI
dist: bionic
language: cpp
# If we set 'ccache: true', Travis installs replacement ccache wrappers of system compilers, which we don't want,
# so we'll do our own ccache management.
# Note the heuristics for whether cache is shared or distinct:
# https://docs.travis-ci.com/user/caching/#Caches-and-build-matrices
cache:
pip: true
directories:
# Note: if a cache store forks due to a stage with parallel jobs that Travis identifies as part of the same flow,
# we must make sure that the parallel jobs do not write to any of the same caches. Also note that all stages use the
# same cache, so early stage jobs may see caches from later stages from previous builds in the same branch.
- $HOME/.ccache
# - $HOME/.ccache_py
# Allows us to build and install GROMACS in one CI stage, then use the installation in a subsequent stage
# - $HOME/install
compiler: gcc
env:
- PY=3.6 GROMACS=2019 GMX_MPI=OFF GMX_THREAD_MPI=ON
- PY=3.7 GROMACS=2020 GMX_MPI=OFF GMX_THREAD_MPI=ON
- PY=3.8 GROMACS=2021 GMX_MPI=OFF GMX_THREAD_MPI=ON
- PY=3.8 GROMACS=2021 GMX_MPI=ON GMX_THREAD_MPI=OFF
addons:
apt:
packages:
- doxygen
- libblas-dev
- libcr-dev
- libfftw3-dev
- liblapack-dev
- libmpich-dev
- libxml2-dev
- mpich
# Set up for all jobs
before_install:
- pyenv versions
# get exactly one Python version: the last listed patch version for the selected minor version
- pyenv whence python${PY} && export PY_VER=`pyenv whence python${PY} | tail -1`
- pyenv shell $PY_VER && pyenv shell
# - python-config --includes
- pyenv prefix ${PY_VER} && export PYTHON_PREFIX=`pyenv prefix ${PY_VER}`
- pyenv which python && export PYTHON=`pyenv which python`
- source ./ci_scripts/set_compilers
- export CCACHE_DIR=$HOME/.ccache
# Ref https://riptutorial.com/cmake/example/4723/configure-travis-ci-with-newest-cmake
# first we create a directory for the CMake binaries
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir ${DEPS_DIR} && cd ${DEPS_DIR}
# we use wget to fetch the cmake binaries
- travis_retry wget --no-check-certificate https://github.com/Kitware/CMake/releases/download/v3.17.1/cmake-3.17.1-Linux-x86_64.tar.gz
# this is optional, but useful:
# do a quick checksum to ensure that the archive we downloaded did not get compromised
- echo "23dd30da0bacf0e644d82298907b8e03edbc59c4ed40839afdeeb3b86e66bc93 cmake-3.17.1-Linux-x86_64.tar.gz" > cmake_sha256.txt
- sha256sum -c cmake_sha256.txt
# extract the binaries; the output here is quite lengthy,
# so we swallow it to not clutter up the travis console
- tar -xvf cmake-3.17.1-Linux-x86_64.tar.gz > /dev/null
- mv cmake-3.17.1-Linux-x86_64 cmake-install
# add both the top-level directory and the bin directory from the archive
# to the system PATH. By adding it to the front of the path we hide the
# preinstalled CMake with our own.
- PATH=${DEPS_DIR}/cmake-install:${DEPS_DIR}/cmake-install/bin:$PATH
# don't forget to switch back to the main build directory once you are done
- cd ${TRAVIS_BUILD_DIR}
install:
- ccache -s
- ./ci_scripts/install_gromacs_${GROMACS}.sh
# - if [ "${TRAVIS_BRANCH}" != "master" ] ; then ./ci_scripts/install_gromacs_devel.sh ; fi
before_script:
- ccache -s
- $PYTHON -m pip install --upgrade pip setuptools
- $PYTHON -m pip install --upgrade packaging scikit-build
- $PYTHON -m pip install --no-cache-dir --upgrade --no-binary ":all:" --force-reinstall mpi4py
- $PYTHON -m pip install pytest numpy networkx sphinx
script:
- |
if [ "${GROMACS}" == 2019 ] ; then
source $HOME/install/gromacs_${GROMACS}/bin/GMXRC && ./ci_scripts/pygmx_0_0_7.sh
elif [ "${GROMACS}" == 2020 ] ; then
source $HOME/install/gromacs_${GROMACS}/bin/GMXRC && $PYTHON -m pip install 'gmxapi<0.2'
else
source $HOME/install/gromacs_${GROMACS}/bin/GMXRC && $PYTHON -m pip install gmxapi
fi
- ./ci_scripts/sample_restraint.sh
# - |
# if [ "${TRAVIS_BRANCH}" != master ] ; then
# source $HOME/install/gromacs_devel/bin/GMXRC
# $PYTHON -m pip install --upgrade --pre --force-reinstall gmxapi
# ./ci_scripts/sample_restraint.sh
# fi