-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
78 lines (74 loc) · 2.68 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
language: python
sudo: required
dist: trusty
stages:
- Test
- Docs
- Deploy
before_install: &before_install
# Some of the code below is taken from https://conda.io/docs/user-guide/tasks/use-conda-with-travis-ci.html
- sudo apt-get update
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- travis_retry conda install -y python=3.6 numpy tqdm pytest pytest-runner
- travis_retry conda install -y ffmpeg ffmpeg-python -c mrinaljain17
install:
- pip install -e .
script: # Performed in jobs
after_success: # Nothing to do
jobs:
include:
- stage: Test
script: pytest
- stage: Docs
# Use previously defined before_install
before_install: *before_install
install:
- travis_retry conda install -y sphinx pillow matplotlib
- pip install sphinx-gallery
- pip install .
script:
- cd docs && make html
- touch files/html/.nojekyll
after_success: # Nothing to do
deploy:
provider: pages
skip-cleanup: true
github-token: $GITHUB_TOKEN
keep-history: false
local-dir: docs/files/html
on:
branch: master
- stage: Deploy
if: tag IS present
# Use previously defined before_install
before_install: *before_install
install:
- travis_retry conda install -y twine setuptools conda-build anaconda-client conda-verify
- pip install .
script: true
after_success: # Nothing to do
before_deploy:
# Conda deploy if on tag
# ANACONDA_TOKEN should be provided by Travis
# How to generate ANACONDA_TOKEN: https://docs.anaconda.com/anaconda-cloud/user-guide/tasks/work-with-accounts#creating-access-tokens
# https://conda.io/docs/user-guide/tasks/build-packages/install-conda-build.html
- conda-build ./conda_build/mydia --numpy 1.14 -c mrinaljain17 --output-folder ./dump
- conda convert --platform win-64 ./dump/linux-64/*.tar.bz2 -o ./dump
- conda convert --platform osx-64 ./dump/linux-64/*.tar.bz2 -o ./dump
# Upload to Anaconda
- anaconda -v -t $ANACONDA_TOKEN upload ./dump/linux-64/*.tar.bz2
- anaconda -v -t $ANACONDA_TOKEN upload ./dump/win-64/*.tar.bz2
- anaconda -v -t $ANACONDA_TOKEN upload ./dump/osx-64/*.tar.bz2
deploy:
provider: pypi
user: $PYPI_USER
password: $PYPI_TOKEN
skip_cleanup: true
distributions: "sdist bdist_wheel"
on:
tags: true