forked from vispy/vispy
-
Notifications
You must be signed in to change notification settings - Fork 0
289 lines (282 loc) · 9.69 KB
/
main.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
name: CI
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency
# https://docs.github.com/en/developers/webhooks-and-events/events/github-event-types#pullrequestevent
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.type }}
cancel-in-progress: true
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Open GL Check
opengl:
name: OpenGL checks
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Install OpenGL
run: |
sudo apt-get update
sudo apt-get -y install libglu1-mesa-dev libgl1-mesa-dev libxi-dev libglfw3-dev libgles2-mesa-dev libsdl2-2.0-0 mesa-utils x11-utils
- name: Start xvfb daemon
run: |
export DISPLAY=:99.0
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render
sleep 5
- name: Check OpenGL
run: |
export DISPLAY=:99.0
glxinfo
- name: Check Display Information
run: |
export DISPLAY=:99.0
xdpyinfo
# linter, style checks, etc
lint:
name: lint and style checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 numpy cython pytest numpydoc
- name: Install vispy
run: |
pip install -e .
- name: Check line endings
run: |
python make test lineendings
- name: Lint with flake8
run: |
python make test flake
# FIXME: Re-enable this when all docstrings are fixed
# - name: Test docstring parameters
# run: |
# python make test docs
# build website
website:
name: build website
runs-on: ubuntu-latest
defaults:
# use login shell to make use of .bash_profile /.bashrc
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache VisPy Demo and Test Data
uses: actions/cache@v3
env:
cache-name: cache-vispy-data-website
test-version: 1
with:
path: |
~/.vispy/data
~/.vispy/test_data
key: ${{ runner.os }}-data-${{ env.cache-name }}-${{ env.test-version }}
restore-keys: |
${{ runner.os }}-data-${{ env.cache-name }}-
- name: Prepare System Environment
id: vars
run: |
# opengl system libraries
sudo apt-get update;
cat ci/requirements/linux_full_deps_apt.txt | xargs sudo apt-get -y install
# Additional latex dependencies
sudo apt-get -y install texlive-latex-base texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra
sudo apt-get -y install dvipng
# Start xvfb daemon
export DISPLAY=:99.0
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render
sleep 5
# export python_version
echo "python_version=310" >> $GITHUB_OUTPUT
- uses: mamba-org/provision-with-micromamba@v14
with:
environment-file: ./ci/requirements/py${{ steps.vars.outputs.python_version }}.yml
- name: Install conda-dependencies
run: |
micromamba install -y python=3.9 -f ci/requirements/linux_full_deps_conda.txt -c conda-forge
- name: Install pip dependencies
run: |
python -m pip install --upgrade pip
pip install -r ci/requirements/linux_full_deps_pip.txt
pip install -r ci/requirements/linux_website_deps_pip.txt
- name: Install vispy
run: |
pip install -e .[doc]
- name: Version Info
run: |
export DISPLAY=:99.0
micromamba list
python -c "import vispy; print(vispy.version.version)"
python -c "import vispy; print(vispy.sys_info())"
- name: build website
run: |
export DISPLAY=:99.0
export XDG_RUNTIME_DIR=/tmp/runtime-runner
source ./ci/build_website.sh
- name: Upload website HTML artifact
uses: actions/upload-artifact@v3
with:
name: Sphinx Website
path: |
doc/_build/html
retention-days: 1
- name: deploy website
if: github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.VISPY_WEBSITE_TOKEN }}
publish_dir: doc/_build/html
publish_branch: main
cname: vispy.org
allow_empty_commit: true
external_repository: vispy/vispy.github.com
full_commit_message: "Deploy vispy.org website for SHA:${{ github.sha }} (Ref: ${{ github.ref }})"
# linux runs
build_0:
name: vispy tests - linux
runs-on: ubuntu-latest
needs: [lint]
defaults:
# use login shell to make use of .bash_profile /.bashrc
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
include:
- test_number: 1
python_version: "3.8"
deps: "min"
test: "standard"
new_qt: false
- test_number: 2
python_version: "3.8"
deps: "full"
test: "standard"
new_qt: false
- test_number: 3
python_version: "3.8"
deps: "osmesa"
test: "osmesa"
new_qt: false
- test_number: 4
python_version: "3.10"
deps: "full"
test: "standard"
new_qt: true
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache VisPy Demo and Test Data
uses: actions/cache@v3
env:
cache-name: cache-vispy-data-${{ matrix.test }}
test-version: 2
with:
path: |
~/.vispy/data
~/.vispy/test_data
key: ${{ runner.os }}-data-${{ env.cache-name }}-${{ env.test-version }}
restore-keys: |
${{ runner.os }}-data-${{ env.cache-name }}-
- name: Prepare System Environment
id: vars
run: |
# opengl system libraries
if [ "${{ matrix.deps }}" == 'full' ]; then
sudo apt-get update;
if [ "${{ matrix.new_qt }}" == 'true' ]; then
cat ci/requirements/linux_full_newqtdeps_apt.txt | xargs sudo apt-get -y install
else
cat ci/requirements/linux_full_deps_apt.txt | xargs sudo apt-get -y install
fi
else
sudo apt-get -y install x11-utils
fi
# Start xvfb daemon
export DISPLAY=:99.0
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render
sleep 5
# export python_version
PY_VER=${{ matrix.python_version }}
echo "python_version=${PY_VER//.}" >> $GITHUB_OUTPUT
- uses: mamba-org/provision-with-micromamba@v14
with:
environment-file: ./ci/requirements/py${{ steps.vars.outputs.python_version }}.yml
- name: Install conda-dependencies
run: |
if [ "${{ matrix.new_qt }}" == 'true' ]; then
micromamba install -y python=${{ matrix.python_version }} -f ci/requirements/linux_${{ matrix.deps }}_newqtdeps_conda.txt -c conda-forge
else
micromamba install -y python=${{ matrix.python_version }} -f ci/requirements/linux_${{ matrix.deps }}_deps_conda.txt -c conda-forge
fi
- name: Install pip-dependencies
run: |
if [ "${{ matrix.deps }}" == 'full' ]; then
if [ "${{ matrix.new_qt }}" == 'true' ]; then
pip install -r ci/requirements/linux_full_newqtdeps_pip.txt
else
pip install -r ci/requirements/linux_full_deps_pip.txt
fi
rm -rf vispy/ext/_bundled
fi
- name: Install vispy
run: |
pip install -e .
- name: Version Info
run: |
if [ "${{ matrix.test }}" != 'osmesa' ]; then
export DISPLAY=:99.0
fi
if [ "${{ matrix.test }}" == 'osmesa' ]; then
export OSMESA_LIBRARY=~/micromamba-root/envs/vispy-tests/lib/libOSMesa32.so;
export VISPY_GL_LIB=$OSMESA_LIBRARY
fi
micromamba list
python -c "import vispy; print(vispy.version.version)"
python -c "import vispy; print(vispy.sys_info())"
- name: Run tests
run: |
if [ "${{ matrix.test }}" == 'standard' ]; then
export DISPLAY=:99.0
python make test unit --tb=short
fi
if [ "${{ matrix.test }}" == 'osmesa' ]; then
export OSMESA_LIBRARY=~/micromamba-root/envs/vispy-tests/lib/libOSMesa32.so
export VISPY_GL_LIB=$OSMESA_LIBRARY
make osmesa
fi
COVERAGE_FILE=.vispy-coverage coverage combine
mv .vispy-coverage .coverage
- name: Coveralls Parallel
uses: AndreMiras/coveralls-python-action@develop
with:
flag-name: run-${{ matrix.test_number }}
parallel: true
coveralls:
needs: [build_0]
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true