forked from pyrpl-fpga/pyrpl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
93 lines (83 loc) · 3.2 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
# for setup: must go into travis setup and insert ip address and other data of
# the redpitaya device, and disable concurrent builds to avoid conflicts
# between tests of different python versions
# lots of stuff here comes from https://gist.github.com/dan-blanchard/7045057
env:
- AUTOCORRETPEP8=0 DISPLAY=:99.0
# REDPITAYA variables are defined in travis account (encrypted)
language: python
# nosetests is only executed for 2.7, 3.5 and 3.6, but we still test the
# installation for other python versions (3.4)
python:
- "2.7"
- "3.6"
- "3.5"
- "3.4"
notifications:
email: false
before_install:
- sudo apt-get update
# We do this conditionally because it saves us some downloading.
- if [[ "$TRAVIS_PYTHON_VERSION" == "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
- chmod +x 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
# Useful for debugging any issues with conda
- conda info -a
# The next lines fix a crash with multiprocessing on Travis and are not specific to using Miniconda
- sudo rm -rf /dev/shm
- sudo ln -s /run/shm /dev/shm
# starts gui support, see https://docs.travis-ci.com/user/gui-and-headless-browsers/
- sh -e /etc/init.d/xvfb start
# give it some time to start
- sleep 3
install:
# avoid to get cancelled because of very long tests
# we get issues with building numpy etc if we do not include those in the next line
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION numpy scipy paramiko pandas nose pip pyqt qtpy
- source activate test-environment
- if [[ "$TRAVIS_PYTHON_VERSION" != "3.3" ]]; then
conda install --yes -c conda-forge coveralls;
fi
# overwrite default global config file with a custom one for travis (allows slower communication time)
- \cp ./travis_global_config.yml ./pyrpl/config/global_config.yml
- python setup.py install
# packages for coverage reports
- pip install coverage codecov
# Run test
script:
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]] || [[ "$TRAVIS_PYTHON_VERSION" == "3.4" ]] || [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then
nosetests;
fi
after_script:
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]] || [[ "$TRAVIS_PYTHON_VERSION" == "3.4" ]] || [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then
codecov;
fi
# automatic release when a new tag is created needs a few preliminary steps...
# create a Readme.rst for PyPI
# make an executable for linux and upload to sourceforge
before_deploy:
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.4" ]]; then
source activate test-environment;
conda install pandoc;
pip install pyinstaller;
pandoc --from=markdown --to=rst --output=README.rst README.md;
pyinstaller pyrpl.spec;
mv dist/pyrpl ./pyrpl-linux;
python .deploy_to_sourceforge.py pyrpl-linux;
fi
deploy:
provider: pypi
user: lneuhaus
password: $PYPI_PASSWORD
skip_cleanup: true
on:
tags: true
distributions: "sdist bdist_wheel --universal"