-
Notifications
You must be signed in to change notification settings - Fork 15
/
.travis.yml
134 lines (121 loc) · 4.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
env:
jobs:
- MYCONDAPY=2.7
- MYCONDAPY=3.7
global:
# ANACONDA_TOKEN
- secure: "C9W6W6tPzXEhMWpkrRSf3lx6f3JJ5j5jZCsGymUQqrF9SU7RLgTvINc57M72s+I9enaL8wvldELzut0pamzMxuicFeFsSZzPlBuPdJcAy1QdxDYI3HWM8g/TmLTq9PV9sBgmbJ7rO7hGYdAXcTcrfFQk3SBARUWF5IGA95k+Kto="
# GITHUB_TOKEN
- secure: "Skwu+NVG5NuZdp6G8N4y4dPS4nGmifg2NSgp/Vz2vUO0R34IrdY/lBT0aWoDMVxxYnG6h8U0S4mr3NKgVvcbugXD/omDDLJlg07PmpByrZI42gSpRcnQ6CVq8teEwCFT923ZaM5T+jujTHHQ3fzP219J/Jy+WxyImUjDVTxIzBQ="
# PYPI_PASSWD
- secure: "K3A2uBMjw2akoLaVeKMkW7kpxsui5yz9GClUjWgP2L/hbt9S4S81fwE+8htw2gDmM1ehFDhWgbHYU1HomB3k6KHhaBxmtyZ842dewqZRgtdwKQUyVleK0FaB+I1MpJyVggABfAbwSuqCDaL2QxDVnDmwdJ45yed4DPemyuCMkEw="
- PYPKG=tamkin
- GITHUB_REPO_NAME=molmod/tamkin
# Do not use Travis Python to save some time.
language: generic
dist: xenial
branches:
only:
- master
- /^[0-9]+\.[0-9]+(\.[0-9]+)?([ab][0-9]+)?$/
install:
# Get the right version of miniconda.
- if [[ "$MYCONDAPY" == "2.7" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
fi
- bash miniconda.sh -b -p $HOME/miniconda
- source ~/miniconda/bin/activate
- hash -r
# Configure conda and get a few essentials
- conda config --set always_yes yes
# Get the right python version for building. Most things can be listed as
# dependencies on metal.yaml and setup.py, unless setup.py already imports them.
# This also installs conda tools for packaging and uploading
- conda install python=${MYCONDAPY} conda-build numpy cython conda-verify numpy cython sphinx anaconda-client codecov coverage pytest pytest-cov
# Add the molmod channel to get access to the molmod dependency
- conda config --add channels molmod
# Show conda info for debugging
- conda info -a
# No visual backend for matplotlib
- mkdir -p ~/.config/matplotlib/
- echo backend:agg > ~/.config/matplotlib/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 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; pytest --pyargs $PYPKG -v --cov=$PYPKG --cov-report=term-missing --cov-report=xml --cov-branch)
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
token: ${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
token: ${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 ${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
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