forked from pyoceans/python-ctd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
99 lines (84 loc) · 2.85 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
dist: xenial
language: python
sudo: false
services:
- xvfb
env:
global:
- secure: "Tlgd7sOn9XoITQ69wWen9XLLzVqz8IXKtA4B+KXaRP6vTliP6XPrEDldOrOkNYwQFE7P5p57H3irp2fMLIsvxd2JEuN17i+6flB5JrBX+YmVV6tQ/DdDHUUc55CmO1bJefNpWK3kc/Z3TXdKA1k881sTGe/0BHTHV73CYj9ARrs="
matrix:
fast_finish: true
include:
- name: "python-3.6"
env: PY=3.6
- name: "python-3.7"
env: PY=3.7
- name: "python-3.8"
env: PY=3.8
- name: "tarball"
env: PY=3
- name: "docs"
env: PY=3
- name: "doctest"
env: PY=3
before_install:
# Install micromamba and create TEST env.
- |
wget -qO- https://micromamba.snakepit.net/api/micromamba/linux-64/latest | tar -xvj bin/micromamba --strip-components=1
./micromamba shell init -s bash -p ~/micromamba
export MAMBA_ROOT_PREFIX=~/micromamba
export MAMBA_EXE=$(pwd)/micromamba
. ${MAMBA_ROOT_PREFIX}/etc/profile.d/mamba.sh
echo "micromamba version $(micromamba --version)"
micromamba create --yes --name TEST python=$PY pip --file requirements.txt --file requirements-dev.txt --channel conda-forge
micromamba activate TEST
install:
- pip install -e . --no-deps --force-reinstall
script:
- |
if [[ $TRAVIS_JOB_NAME == python-* ]]; then
cp -r tests/ /tmp
pushd /tmp
pytest -n 2 -rxs --cov=ctd tests
popd
fi
- if [[ $TRAVIS_JOB_NAME == "doctest" ]]; then
pytest -s -rxs --doctest-modules -vv ctd ;
fi
- if [[ $TRAVIS_JOB_NAME == 'tarball' ]]; then
python setup.py --version ;
pip wheel . -w dist --no-deps ;
check-manifest --verbose ;
twine check dist/* ;
fi
- |
if [[ $TRAVIS_JOB_NAME == 'docs' ]]; then
set -e
travis_wait jupyter nbconvert --to notebook --execute notebooks/quick_intro.ipynb --output=quick_intro-output.ipynb
mv notebooks/quick_intro-output.ipynb docs/source/
pushd docs
make clean html linkcheck
popd
if [[ -z "$TRAVIS_TAG" ]]; then
python -m doctr deploy --build-tags --key-path github_deploy_key_pyoceans_python_ctd.enc --built-docs docs/build/html/ dev
else
python -m doctr deploy --build-tags --key-path github_deploy_key_pyoceans_python_ctd.enc --built-docs docs/build/html/ "version-$TRAVIS_TAG"
python -m doctr deploy --build-tags --key-path github_deploy_key_pyoceans_python_ctd.enc --built-docs docs/build/html/ .
fi
fi
doctr:
require-master: true
sync: false
deploy:
skip_cleanup: true
provider: pypi
user: "__token__"
password:
secure: "MdQV2uZYrHZ8NAC3jSsEU9BVaYd5OCEvu5+NhglkBDUSLcrmr+dJni0c0BoMCh1D026ynNt1joVxk2euo1Rpbqa1jiMr5ADAvh1VdLjiqdAnr9TVy9dFVk85/qscnP3LWZ1DCiWorujFbSyObsU+grNwjxjvV+7NW0rXrpHNI+8="
distributions: sdist bdist_wheel
upload_docs: false
on:
repo: pyoceans/python-ctd
tags: true
all_branches: master
condition: '$TRAVIS_JOB_NAME == "tarball"'