-
Notifications
You must be signed in to change notification settings - Fork 110
/
.travis.yml
executable file
·106 lines (96 loc) · 3.76 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
# 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
# REDPITAYA variables are defined in travis account (encrypted)
notifications:
email:
recipients:
language: generic
env:
- TRAVIS_PYTHON_VERSION=3.7
os:
- osx
- linux
before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo apt-get update;
fi
# We do this conditionally because it saves us some downloading.
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
elif [[ "$TRAVIS_OS_NAME" == "osx" && "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh -O miniconda.sh;
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
else
echo "Invalid combination of OS ($TRAVIS_OS_NAME) and Python version ($TRAVIS_PYTHON_VERSION)";
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
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo rm -rf /dev/shm; sudo ln -s /run/shm /dev/shm;
fi
# starts gui support, see https://docs.travis-ci.com/user/gui-and-headless-browsers/
# and https://github.com/travis-ci/travis-ci/issues/7313#issuecomment-279914149 (for MacOSX)
# formerly "sh -e sudo Xvfb :99 -ac -screen 0 1024x768x8";
- export DISPLAY=":99.0"
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sh -e /etc/init.d/xvfb start;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
Xvfb :98 -ac -screen 0 1024x768x8;
fi &
# 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 nbconvert
- source activate test-environment
# convert readme file to rst for PyPI
- conda install pandoc
- pandoc --from=markdown --to=rst --output=README.rst README.md
# install pyinstaller
- cd ..
- git clone https://www.github.com/lneuhaus/pyinstaller.git -b develop --depth=1
- cd pyinstaller
- git status
- python setup.py develop
- cd ..
- cd pyrpl
# install pyrpl
- python setup.py install
# create, test and upload binary for mac os
script:
- export QT_QPA_PLATFORM_PLUGIN_PATH=$HOME/miniconda/bin/envs/test-environment/Library/plugins/platforms
- pyinstaller pyrpl.spec
- mv dist/pyrpl ./pyrpl-mac-develop
- chmod 755 pyrpl-mac-develop
- (./pyrpl-mac-develop config=test_osx hostname=_FAKE_ &)
- PYRPL_PID=$!
- sleep 30
- killall pyrpl-mac-develop
- python .deploy_to_sourceforge.py pyrpl-mac-develop
# automatic release when a new tag is created: before_deploy, deploy, and after_deploy
before_deploy:
- echo Deploy
- source activate test-environment
deploy:
provider: pypi
user: lneuhaus
password: $PYPI_PSW
skip_cleanup: true
on:
tags: true
distributions: "sdist bdist_wheel --universal"