-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
202 lines (180 loc) · 8.35 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
194
195
196
197
198
199
200
201
202
#
# THIS FILE IS AUTOGENERATED. DO NOT EDIT DIRECTLY.
# INSTEAD, MAKE CHANGES IN THE FOLLOWING FILES:
# - tools/.travis-template.yml
# - tools/.travis-template.yml.vars.yml
#
env:
matrix:
- MYCONDAPY=2.7
#- MYCONDAPY=3.5
#- MYCONDAPY=3.6
global:
- secure: "k4XK37vv/8HySKJXZmGIXRX+DRt1ZBRSc8M7pYCH3nrYuuO65o6Hziphe1JB/mxp8499aNe008dDPsRSvSHGA/IaNjHfNetok13navlSdfKABzQfENJbRtuFlKq/zC6/pAIAUqqm3LCcMs7kM+2cqIUVv4QIhPhq/HK6TneUWqi0wA9Rg3DavUbAinh1BnxA/f+8he2vZNgsRUfuB4nHpZ3mAPzuwGepQwGpi7eM5CApYfTG7ovlwFXAtaZiyQUxyIuq8E5l2X7RSWlzZ2w+xVJYPFF5B5g/p73U8C2xBxaid3VfXULKxLhXeDRHgpeOVxDZjscekH1Cac+53PDNcIamXPXzgNg4cIWr7OvL/KiWvnIIXO5nsrEUjCWrLiqXyzgbLZZBcBRySQ9CUe5jLNhxI6se1J3Qo7BWnFkPcNELxkUcZyTvZ96DBo7QiDYodE3SDVAtLRxTfpCqea/L3kTvNGlF9bNc5dA8427gAB5sb8FuhEliXArrtet3EK9fYfiaXoiIMJKwxVb7ydu43W/9f986TglGN0pk3tLX0Qg2jsHsyArshSZQJCiNH99KHJnkTwDmYiL2KnBHePHEkILNWpXE4pbwkW9JymQnwVhhmAseXDT+MKC3yyohfkP4wfbzmiNpQ5AKjEpDqx6cI51dh+PL4jfOW3Yct1MSrC4="
- secure: "XlRLGJwV1vIaoLRxkd+ISQIKT4+PAPA4Pt8qVlvZ6pNM5v4PpS1t/xoPS0SH+LfPuB+EwjH/yLksM48DA/ZZwsFIUKd6bEjCroaIYwq0xf1d4TirT6n+wjq8HAD8zmO/GA8R6CAjbqBD35ORKxgviVe9j70DtE+aNdnPPYgBz8uJ5EY4MxOW7swTamIV7YAtu+pXKmVT375eB5Kg33Wd16kF9nRSnOS3UuDnK3dovMTPXtQ1dVSiUM37CcJXqXEFYsKXtvxVXJe96XBkj9lkCEVrGV7MWnUtnJKFdXRwuQf2BsdvGrtZWBiJq3XwK6B0nQv8hFYaXeg0PQcnJs/51MrXrVacXWkqs8fFkil0gf9XSAovkEVXn/s/WHKj/JDRnNU6kM7MeIRSY38Rt9VM9K/UzYj8BlkkdCMqWxdDu60a9H6AKmbrz+loWQqB6OAmP/wdsAlG2GH57e3BRY4wno1l4zED3/MmswNOaregy0SEWvtspUzi6foiqw4jh5TM7+wCfe32i2YpLwjIIzJMhNDph2VWch2I9Gcz/i8aQG3Ee7O9miU8Uvcrf8IgBoTtsBf4LiN8JM/ng8jLnGQHWcouwDClziivJs3IOwIVqotqoScbVTaU1NjZuY5cawAS9t/pZ6/h/KLtjMVOnFtYbZA+dz3KnFZtj9BZXLLw7vs="
# Do not use Travis Python to save some time.
language: generic
os:
- linux
- osx
osx_image: xcode6.4
dist: trusty
sudo: false
matrix:
# We only test on Linux with one specific Python version, unless we make a release. All
# other cases are allowed to fail and will exit early. With the fast_finish option,
# travis will send a status update to github as soon as the non-allowed-to-fail has
# finished. This speeds up testing in PRs.
#
# This is not ideal. It would be better to run just one item from the build matrix when
# not preparing a release. This is not possible on Travis. There are several tickets on
# travis-ci related to this limitation.
#
# https://github.com/travis-ci/travis-ci/issues/7451
# https://github.com/travis-ci/travis-ci/issues/7149
# https://github.com/travis-ci/travis-ci/issues/2778
# ...
fast_finish: true
allow_failures:
- os: osx
cache:
directories:
- $HOME/.cache/pip
- $HOME/download
- $HOME/miniconda
before_cache:
- rm -rf $HOME/miniconda/conda-bld $HOME/miniconda/locks $HOME/miniconda/pkgs $HOME/miniconda/var $HOME/miniconda/conda-meta/history
- pip uninstall -y cardboardlint # Cardboardlint always installs even if no changes are made.
branches:
only:
- master
- /^[0-9]+\.[0-9]+(\.[0-9]+)?([ab][0-9]+)?$/
before_install:
- if ! [[ $TRAVIS_TAG ]] && ! [[ $TRAVIS_OS_NAME == "linux" && $MYCONDAPY == "2.7" ]]; then exit 0; fi
# Get miniconda. Take the right version, so re-installing python is hopefully not needed.
- if test -e $HOME/miniconda/bin; then
echo "miniconda already installed.";
else
echo "Installing miniconda.";
rm -rf $HOME/miniconda;
mkdir -p $HOME/download;
if [[ -d $HOME/download/miniconda.sh ]]; then rm -rf $HOME/download/miniconda.sh; fi;
if [ "${MYCONDAPY}" = "2.7" ]; then
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O $HOME/download/miniconda.sh;
else
wget https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh -O $HOME/download/miniconda.sh;
fi;
else
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O $HOME/download/miniconda.sh;
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O $HOME/download/miniconda.sh;
fi;
fi;
bash $HOME/download/miniconda.sh -b -p $HOME/miniconda;
fi
install:
- source $HOME/miniconda/bin/activate
- hash -r
# Configure conda and get a few essentials
- conda config --set always_yes yes
- conda config --add channels theochem
- conda update -q conda
# Get the right python version for building. This only does something for 3.5.
# Install extra package needed to make things work. Most things can be listed as
# dependencies on metal.yaml and setup.py, unless setup.py already imports them.
# Install conda tools for packaging and uploading
- conda install python=${MYCONDAPY} numpy cython cppcheck doxygen nose conda-build anaconda-client gtest cmake
# Install more recent stuff with pip
- pip install pylint codecov coverage pycodestyle pydocstyle flake8
# Get the latest cpplint
- wget https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py &&
chmod +x cpplint.py
# Show conda info for debugging
- conda info -a
# Install the latest cardboardlinter
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
pip install --upgrade git+https://github.com/theochem/cardboardlint.git@master#egg=cardboardlint;
fi
# Set the version info from the git tag
- git fetch origin --tags &&
export PROJECT_VERSION=$(python tools/gitversion.py) &&
python tools/gitversion.py python > python-qcgrids/qcgrids/version.py &&
python tools/gitversion.py cmake > CMakeListsVersion.txt.in
script:
# Static linting
# ~~~~~~~~~~~~~~
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
cardboardlinter --refspec $TRAVIS_BRANCH -f static &&
(cd python-qcgrids; cardboardlinter --refspec $TRAVIS_BRANCH -f static);
fi
- if [[ $TRAVIS_TAG ]]; then
conda build -q tools/conda.recipe;
(cd python-qcgrids; conda build -q tools/conda.recipe);
conda install --use-local qcgrids python-qcgrids;
${CONDA_PREFIX}/libexec/qcgrids/test_qcgrids;
(cd; nosetests qcgrids -v --detailed-errors);
conda uninstall python-qcgrids;
conda uninstall qcgrids;
else
conda install -c theochem cellcutoff python-cellcutoff;
(mkdir debug; cd debug; cmake cmake -DCMAKE_BUILD_TYPE=debug ..; make);
(cd debug; DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:${CONDA_PREFIX}/lib/ ./qcgrids/tests/test_qcgrids);
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
cardboardlinter --refspec $TRAVIS_BRANCH -f 'dynamic';
fi
(cd python-qcgrids; python setup.py build_ext -i --define CYTHON_TRACE_NOGIL);
(cd python-qcgrids; LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../debug/qcgrids nosetests qcgrids -v --detailed-errors --with-coverage --cover-package=qcgrids --cover-tests --cover-erase --cover-inclusive --cover-branches; coverage xml -i);
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
(cd python-qcgrids; LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../debug/qcgrids cardboardlinter --refspec $TRAVIS_BRANCH -f 'dynamic');
fi
fi
# Make CPP and PY source package for github deployment
- if [[ $TRAVIS_TAG ]]; then
(cd debug; make sdist);
(cd python-qcgrids; python setup.py sdist);
fi
after_success:
# Upload the coverage analysis
- if ! [[ $TRAVIS_TAG ]]; then
codecov --file python-qcgrids/coverage.xml;
codecov;
fi
before_deploy:
# Try to set some env vars to configure deployment.
- export ANACONDA_LABEL_ARG=$(sed -e 's/.*a.*/-l alpha/' -e 's/.*b.*/-l beta/' <<< ${TRAVIS_TAG})
# In deployment, the env var TRAVIS_TAG contains the name of the current tag, if any.
deploy:
- provider: releases
skip_cleanup: true
api_key: ${GITHUB_TOKEN}
file:
- debug/qcgrids-${TRAVIS_TAG}.tar.gz
- python-qcgrids/dist/python-qcgrids-${TRAVIS_TAG}.tar.gz
on:
repo: theochem/qcgrids
tags: true
condition: "$TRAVIS_TAG != *[ab]* && $MYCONDAPY == 2.7 && $TRAVIS_OS_NAME == linux"
prerelease: false
- provider: releases
skip_cleanup: true
api_key: ${GITHUB_TOKEN}
file:
- debug/qcgrids-${TRAVIS_TAG}.tar.gz
- python-qcgrids/dist/python-qcgrids-${TRAVIS_TAG}.tar.gz
on:
repo: theochem/qcgrids
tags: true
condition: "$TRAVIS_TAG == *[ab]* && $MYCONDAPY == 2.7 && $TRAVIS_OS_NAME == linux"
prerelease: true
- provider: script
skip_cleanup: true
script:
anaconda -t $ANACONDA_TOKEN upload --force ${ANACONDA_LABEL_ARG}
${HOME}/miniconda/conda-bld/*/qcgrids-*.tar.bz2
${HOME}/miniconda/conda-bld/*/python-qcgrids-*.tar.bz2
on:
repo: theochem/qcgrids
tags: true
condition: "$TRAVIS_TAG == *a*"