-
Notifications
You must be signed in to change notification settings - Fork 118
/
Copy path.travis.yml
executable file
·122 lines (111 loc) · 4.65 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
# 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:
- pyrpl.readthedocs.io@gmail.com
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"
# set library path until pyinstaller issue is fixed
- export LD_LIBRARY_PATH="$HOME/miniconda/lib"
# for debugging of qt applications
- export DYLD_PRINT_LIBRARIES=1
- 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 jupyter nose pip pyqt qtpy nbconvert coverage twine matplotlib nb_conda_kernels
- source activate test-environment
- export LD_LIBRARY_PATH="$HOME/miniconda/bin/envs/test-environment/lib:$LD_LIBRARY_PATH"
# 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 ..
# install pyrpl
- cd pyrpl
- python setup.py develop
# create, test and upload binary for mac os
script:
# - export QT_QPA_PLATFORM_PLUGIN_PATH=$HOME/miniconda/bin/envs/test-environment/Library/plugins/platforms
# - export QT_PLUGIN_PATH=$HOME/miniconda/bin/envs/test-environment/Library/plugins
- pyinstaller pyrpl.spec
- mv dist/pyrpl ./pyrpl-$TRAVIS_OS_NAME
- chmod 755 pyrpl-$TRAVIS_OS_NAME
- (./pyrpl-$TRAVIS_OS_NAME config=test_travis hostname=_FAKE_ &)
- PYRPL_PID=$!
- echo $PYRPL_PID
- sleep 30
# kill always fails since the program is already terminated (TODO: add a command-line option to properly test the binaries)
# - kill -9 $PYRPL_PID
- mkdir $TRAVIS_BRANCH
- cp pyrpl-$TRAVIS_OS_NAME $TRAVIS_BRANCH/
- python .deploy_to_sourceforge.py $TRAVIS_BRANCH /home/frs/project/pyrpl/branches
# 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: $PYPI_USR
password: $PYPI_PSW
skip_cleanup: true
on:
tags: true
distributions: "sdist bdist_wheel --universal"
after_deploy:
- mkdir $TRAVIS_TAG
- cp pyrpl-$TRAVIS_OS_NAME $TRAVIS_TAG/
- python .deploy_to_sourceforge.py $TRAVIS_TAG /home/frs/project/pyrpl
- python .deploy_to_sourceforge.py pyrpl-$TRAVIS_OS_NAME /home/frs/project/pyrpl/current-release/