forked from bluesky/bluesky-widgets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
149 lines (139 loc) · 3.98 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
language: python
sudo: false
cache:
directories:
- $HOME/.cache/pip
- $HOME/.ccache # https://github.com/travis-ci/travis-ci/issues/5853
global:
- BUILD_DOCS=false
- SUBMIT_CODECOV=false
- FLAKE_8=false
jobs:
fast_finish: true
include:
- python: 3.8 # This build will run only 'flake8'
env: FLAKE_8=true
- python: 3.7
env: QT="pyqt5cf"
- python: 3.7
env: QT="pyside2"
- python: 3.8
env: QT="pyqt5cf" BUILD_DOCS=true SUBMIT_CODECOV=true
- python: 3.8
env: QT="pyside2"
- os: osx
language: generic
env: TRAVIS_PYTHON_VERSION=3.7 QT="pyqt5cf"
- os: osx
language: generic
env: TRAVIS_PYTHON_VERSION=3.7 QT="pyside2"
- os: osx
language: generic
env: TRAVIS_PYTHON_VERSION=3.8 QT="pyqt5cf"
- os: osx
language: generic
env: TRAVIS_PYTHON_VERSION=3.8 QT="pyside2"
- python: 3.7
env: QT="pyqt5"
- python: 3.8
env: QT="pyqt5"
allow_failures:
- python: 3.7
env: QT="pyside2"
- python: 3.8
env: QT="pyside2"
before_install:
- if [ $FLAKE_8 == 'true' ]; then
pip install flake8;
flake8 .;
let res=$?;
echo "The project code was verified with 'flake8'. Exit code ($res).";
exit $res;
fi
- |
set -e
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
# Install 'herbstluftwm' (on Linux only)
sudo apt-get update
sudo apt-get install -y xvfb herbstluftwm
fi
- |
set -e
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
arch="Linux"
elif [ "$TRAVIS_OS_NAME" == "osx" ]; then
arch="MacOSX"
else
echo "Unknown arch $TRAVIS_OS_NAME"
exit 1
fi
wget https://repo.continuum.io/miniconda/Miniconda3-latest-${arch}-x86_64.sh -O miniconda.sh
chmod +x miniconda.sh
./miniconda.sh -b -p ~/mc
source ~/mc/etc/profile.d/conda.sh
conda update conda --yes
export CONDARC=ci/condarc
install:
- |
set -e
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
# Run 'xvfb' (on Linux only)
export DISPLAY=:99.0
sudo /sbin/start-stop-daemon --start --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX +render -noreset
sleep 3
fi
- conda create -y -n testenv -c conda-forge python=$TRAVIS_PYTHON_VERSION
- conda activate testenv
- |
set -e
if [ $QT == "pyside2" ]; then
conda install -y pyside2 -c conda-forge;
conda update -y pyside2 -c conda-forge
elif [ $QT == "pyqt5" ]; then
conda install -y pyqt;
conda update -y pyqt
elif [ $QT == "pyqt5cf" ]; then
conda install -y pyqt -c conda-forge;
conda update -y pyqt -c conda-forge
else
echo "Unknown Qt package $QT"
exit 1
fi
- conda install -y -c conda-forge numcodecs
- pip install --upgrade pip setuptools numpy
- pip install -r requirements.txt
- pip install -r requirements-dev.txt
- pip install .
- conda list
- pip list
before_script:
- |
set -e
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
# Run 'herbstluftwm' (on Linux only)
herbstluftwm &
sleep 1
fi
script:
- coverage run -m pytest # Run the tests and check for test coverage.
- coverage report -m -i # Generate test coverage report.
- |
set -e
if [ $BUILD_DOCS == 'true' ]; then
make -C docs html # Build the documentation.
# Disable Jekyll theme
touch docs/build/html/.nojekyll
fi
deploy:
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
keep_history: true
local_dir: "docs/build/html"
on:
branch: master
# The following conditions guarantees that the docs will be deployed only if the build
# is run in the main repository (this may easily changed)
condition: $BUILD_DOCS == true && $TRAVIS_REPO_SLUG == "bluesky/bluesky-widgets"
after_success:
- if [ $SUBMIT_CODECOV == 'true' ]; then codecov; fi;