forked from molmod/yaff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
169 lines (150 loc) · 5.5 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
env:
matrix:
- MYCONDAPY=2.7
- MYCONDAPY=3.6
global:
# ANACONDA_TOKEN encrypted
- secure: "Pgu8yuDay2kG1a+dnsgl3lBlGBDb6ifhMRzE1DqcRbCqplpCCgfxNL3Njt+sLtTWZ4jPPC4w0Z\
ZrrqnOg62G4CeZCfp7cznJvN82mwYtW4ThlszIdXRfR+QfS35xKkvfWCvMYX3qBJ8xx3ih+g2GXx5roTE/qq7GfzP\
uOa43jsw="
# GITHUB_TOKEN
- secure: "Pjb4QTTTd1L0ssl5YGrFP/bQwGYOMICZVJJAndlv1o9VmR4o81Mddv2IgxELmFA0K0lO0tFPOc\
w8O69Oa/qnXsRKGF+05fMUKzb+If8yGoupVaa/FAGfha6/WNw+jnDqHUfXCI+nXySIRSk9kRfl0gH9LW0clSUF8dM\
MKC95+wg="
# PYPI_PASSWD
- secure: "fcr/ruryZctvHipyllH8rnGDpd8WH//zUo2dAzI0heqEqucx3BLZ9HbutPt0QmYirPNM/ywNfv\
RX93IhnyX5vGDsDfrcU7a69nsqHXapTEU04BcYH8MOPFvakf/s8k7biMeZCqZ4C3ycw8mkp3B9/L4C0pf/fnprvny\
DNWwA2yE="
- PYPKG=yaff
- GITHUB_REPO_NAME=molmod/yaff
# Do not use Travis Python to save some time.
language: generic
os:
- linux
dist: trusty
sudo: false
branches:
only:
- master
- /^[0-9]+\.[0-9]+(\.[0-9]+)?([ab][0-9]+)?$/
install:
# Get miniconda. Take the right version, so re-installing python is only needed for 3.5.
- if [[ "$MYCONDAPY" == "2.7" ]]; then
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
URL="https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh";
else
URL="https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh";
fi;
else
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
URL="https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh";
else
URL="https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh";
fi;
fi;
wget ${URL} -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
# Configure conda and get a few essentials
- conda config --set always_yes yes
- conda config --add channels molmod
- 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 sphinx conda-build anaconda-client nose conda-verify codecov coverage
# Install LAMMPS
- conda install -c conda-forge lammps=2018.12.12
# Install PLUMED
- conda install -c conda-forge plumed
- conda install -c conda-forge py-plumed
# Show conda info for debugging
- conda info -a
# No visual backend for matplotlib.
- export MATPLOTLIBRC=$PWD; echo backend:agg > ${MATPLOTLIBRC}/matplotlibrc
script:
# Check if code is normalized properly, whitespace etc
- wget https://raw.githubusercontent.com/tovrstra/devscripts/master/scripts/ds-normalize-code -O ds-normalize-code;
chmod +x ds-normalize-code;
./ds-normalize-code;
# Build the conda package
- git fetch origin --tags
- conda build -q tools/conda.recipe
# Build source package, should work too and needed for deployment to Github and
# PyPI.
- python setup.py sdist
# Install Conda package
- conda install --use-local $PYPKG
# Compile documentation
- (cd doc; make html)
# Run tests out of source tree, to make sure that installed version is tested.
- (cd; nosetests $PYPKG -v --detailed-errors --with-coverage --cover-package=$PYPKG
--cover-tests --cover-erase --cover-inclusive --cover-branches --cover-xml)
## Run the optimizer test DISABLED UNTIL TAMKIN IS PORTED TO PYTHON 3
# - (cd; yaff-opttest)
after_success:
# Upload the coverage analysis
- codecov -f ~/coverage.xml
# 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/${PYPKG}-${TRAVIS_TAG}.tar.gz
on:
repo: ${GITHUB_REPO_NAME}
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: dist/${PYPKG}-${TRAVIS_TAG}.tar.gz
on:
repo: ${GITHUB_REPO_NAME}
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 -l alpha
${HOME}/miniconda/conda-bld/*/${PYPKG}-*.tar.bz2
on:
repo: ${GITHUB_REPO_NAME}
tags: true
condition: "$TRAVIS_TAG == *a*"
- provider: script
skip_cleanup: true
script: anaconda -t ${ANACONDA_TOKEN} upload --force -l beta
${HOME}/miniconda/conda-bld/*/${PYPKG}-*.tar.bz2
on:
repo: ${GITHUB_REPO_NAME}
tags: true
condition: "$TRAVIS_TAG == *b*"
- provider: script
skip_cleanup: true
script: anaconda -t ${ANACONDA_TOKEN} upload --force -l main
${HOME}/miniconda/conda-bld/*/${PYPKG}-*.tar.bz2
on:
repo: ${GITHUB_REPO_NAME}
tags: true
condition: "$TRAVIS_TAG != *[ab]*"
- provider: pypi
skip_cleanup: true
user: molmod
password: ${PYPI_PASSWD}
on:
repo: ${GITHUB_REPO_NAME}
tags: true
condition: "$TRAVIS_TAG != *[ab]* && $MYCONDAPY == 2.7 && $TRAVIS_OS_NAME == linux"
- provider: pages
skip_cleanup: true
github_token: ${GITHUB_TOKEN}
project_name: ${PYPKG}
local_dir: doc/_build/html
on:
repo: ${GITHUB_REPO_NAME}
condition: "$TRAVIS_TAG != *[ab]* && $MYCONDAPY == 2.7 && $TRAVIS_OS_NAME == linux"
tags: true