-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.travis.yml
204 lines (182 loc) · 9.16 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
203
204
env:
matrix:
- MYCONDAPY=3.6
- MYCONDAPY=3.7
global:
# ANACONDA_TOKEN
- secure: "ZEez6ZLVYwitgGRiq1Z4QZLve/gH7Lgj7SoLqB93gfmJ8pK9wD4lf0l6hYnviEKFAP5TCmc2Y5HoPT4C9YtP4oFE9xdTD9kTYLkDb9/6PsP/bCDwOeLmqoBqjmqvhpMPMF/idLOH81lyuecedoxaQjK8Gf8Ybesz3p1X1FlDrJgrcTtvPpz9uhHQXwb7otZbsc6He+YWdKrZy8PiBidmP3rK3SZvSPBmk5nrgfWsP1fnE27RfbVwABZ6txE8ns9ceHXdjIoxScnF5OlxLMOaobNgRuk4IB5yZMQNgEFPfzklKZAlmeTLVKHMbywTN7+KO64Tqu02pg6SJm3bSTFircticELbz9bgu5W8Dw7TghU9X+IPYrCsL7Fk67Rwk4dMFfZRaJ7BsnSLJCWYlDcu8GQWZvZI7jM8zDde3Z78zYY5Jhk981OI4AtLgW1STrdikXJWMEV+e4YaDI5vlT+FGt7FNcc9MxgNiHq/TpejTStiVFHKzDiGKu5hvzzpxZXd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RfuFnmcd7RrjtQ5tvs/z5H/ektsj11Zw24cdJKyfe9nD70m8SO2IgM50X5TQitICqnASjAkaMkBZ9hr7myozQwB1Q+f6fh4VO9kipDyt3ypNrd//lWR/mYocfOTimMKH+XiaIFxn4emFLzRICruQWQNm9hOmiopZY3Cc/VojbBAGtkkCr2wd42wM61Z52uZEMr1W8dc6ixKwKvtFWx4o0ZiTZTBFo/+oxRmOLzoYNIVYnpeSsOaBAx6lFvgm/7H0Zuzm4WF91ZGNT+fxu5TlACM4CCFvN0jHW/cwCZYoZvWTfvRQdM1C1dW4XYwQx8x1gK1qbrkf4BysikYxf56b+8LtO9RC9S6NSVxQg0aFq/fgadkViy5VuHq3iel6r889xlGgg8v6uBivGdUg3o5Qgg8C+LNDm+0dpdPDpwlLBvyWHpgwyUqry/Ms0Tp1XkItkVWnJ7qfgKBjsXNRCWiZMNTFoI9YC0KkAJMgSTdmtlCm210="
- GITHUB_REPO_NAME=theochem/gbasis
- PROJECT_NAME=gbasis
- CONDA_PKG_NAME_PY=python-gbasis
- CONDA_PKG_NAME_CPP=cxx-gbasis
- PYDIR=python
- CPPDIR=cpp
####
# EVERYTHING BELOW THIS LINE IS AUTOGENERATED.
####
# V1.0
# Do not use Travis Python to save some time.
language: generic
os:
- linux
- osx
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/download
- $HOME/miniconda
before_cache:
- if ! [[ $TRAVIS_TAG ]]; then rm -rf $HOME/miniconda/conda-bld; fi
- rm -rf $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 == "3.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 [ "${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;
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 install -q conda conda-build
- conda config --add channels theochem
# Set the version info from the git tag
- git fetch origin --tags &&
export PROJECT_VERSION=$(python tools/gitversion.py) &&
python tools/gitversion.py python > ${PYDIR}/${PROJECT_NAME}/version.py &&
python tools/gitversion.py cmake > ${CPPDIR}/CMakeListsVersion.txt.in
# Get a list of all build and runtime dependencies.
# This should become easier, without the copy to conda.recipe.ugly.
#- conda render -f ${CPPDIR}/tools/conda.recipe/rendered.yaml ${CPPDIR}/tools/conda.recipe
#- conda render -f ${PYDIR}/tools/conda.recipe/rendered.yaml ${PYDIR}/tools/conda.recipe
#- CONDA_DEPENDENCIES=$(python -c "from yaml import load;
# req1 = load(open('${CPPDIR}/tools/conda.recipe/rendered.yaml'))['requirements'];
# req2 = load(open('${PYDIR}/tools/conda.recipe/rendered.yaml'))['requirements'];
# deps = req1['build'] + req1['run'] + req2['build'] + req2['run'];
# print(' '.join(set(dep.split()[0] for dep in deps if not dep.startswith('${CONDA_PKG_NAME_CPP}'))))")
# 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 -q python=${MYCONDAPY} anaconda-client ${CONDA_DEPENDENCIES}
- conda install -c conda-forge -q python=${MYCONDAPY} anaconda-client cppcheck doxygen
# Deactivate build env and reactivate it to refresh compilers.
- source deactivate && source $HOME/miniconda/bin/activate
# Install more recent stuff with pip
- pip install --upgrade pylint pycodestyle pydocstyle
# Get the latest cpplint
- (cd ${CPPDIR}; 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
script:
# Static linting
# ~~~~~~~~~~~~~~
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
(cd ${CPPDIR}; cardboardlinter --refspec $TRAVIS_BRANCH -f static);
(cd ${PYDIR}; cardboardlinter --refspec $TRAVIS_BRANCH -f static);
fi
# Unit tests and dynamic linting
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- if [[ $TRAVIS_TAG ]]; then
(cd ${CPPDIR}; conda-build -q conda.recipe) &&
(cd ${PYDIR}; conda-build -c local -q conda.recipe);
else
(cd ${CPPDIR}; BUILD_DEBUG=True conda-build -q conda.recipe) &&
(cd ${PYDIR}; BUILD_DEBUG=True conda-build -c local -q conda.recipe) &&
conda install -c local ${CONDA_PKG_NAME_PY} &&
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
(cd ${PYDIR}; cardboardlinter --refspec $TRAVIS_BRANCH -f 'dynamic');
fi &&
conda uninstall ${CONDA_PKG_NAME_PY} ${CONDA_PKG_NAME_CPP};
fi
# Make CPP and PY source package for github deployment
- if [[ $TRAVIS_TAG ]]; then
(cd ${CPPDIR}; mkdir dist; cd dist; CMAKE_PREFIX_PATH=$HOME/miniconda cmake ..; make sdist) &&
(cd ${PYDIR}; python setup.py sdist);
fi
after_success:
# Upload the coverage analysis
- if ! [[ $TRAVIS_TAG ]]; then
codecov --file ${PYDIR}/coverage.xml &&
codecov;
fi
before_deploy:
# Try to set some env vars to configure deployment.
- export ANACONDA_LABEL_ARG=$(sed -e 's/.*a.*/dev/' -e 's/.*b.*/test/' -e 's/.*.*/main/' <<< ${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:
- dist/${CONDA_PKG_NAME_CPP}-${TRAVIS_TAG}.tar.gz
- ${PYDIR}/dist/${CONDA_PKG_NAME_PY}-${TRAVIS_TAG}.tar.gz
on:
repo: ${GITHUB_REPO_NAME}
tags: true
condition: "$TRAVIS_TAG != *[ab]* && $MYCONDAPY == 3.7 && $TRAVIS_OS_NAME == linux"
prerelease: false
- provider: releases
skip_cleanup: true
api_key: ${GITHUB_TOKEN}
file:
- dist/${CONDA_PKG_NAME_CPP}-${TRAVIS_TAG}.tar.gz
- ${PYDIR}/dist/${CONDA_PKG_NAME_PY}-${TRAVIS_TAG}.tar.gz
on:
repo: ${GITHUB_REPO_NAME}
tags: true
condition: "$TRAVIS_TAG == *[ab]* && $MYCONDAPY == 3.7 && $TRAVIS_OS_NAME == linux"
prerelease: true
- provider: script
skip_cleanup: true
script:
anaconda -t $ANACONDA_TOKEN upload --force -l ${ANACONDA_LABEL_ARG}
${HOME}/miniconda/conda-bld/*/${CONDA_PKG_NAME_CPP}-*.tar.bz2
${HOME}/miniconda/conda-bld/*/${CONDA_PKG_NAME_PY}-*.tar.bz2
on:
repo: ${GITHUB_REPO_NAME}
tags: true