forked from vispy/vispy
-
Notifications
You must be signed in to change notification settings - Fork 0
214 lines (208 loc) · 6.61 KB
/
main.yml
File metadata and controls
214 lines (208 loc) · 6.61 KB
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
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# 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
- 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
# linter, style checks, etc
lint:
name: lint and style checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Set up Python
uses: actions/setup-python@v2
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
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: "recursive"
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r ci/requirements/linux_website_deps_pip.txt
- name: Install vispy
run: |
pip install -e .[doc]
- name: build website
run: |
source ./ci/build_website.sh
- 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: master
cname: vispy.org
allow_empty_commit: true
external_repository: vispy/vispy.github.com
full_commit_message: "Deploy vispy.org website for SHA:$GITHUB_SHA (Tag: $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.7"
deps: "min"
test: "standard"
- test_number: 2
python_version: "3.7"
deps: "full"
test: "standard"
- test_number: 3
python_version: "3.7"
deps: "full"
test: "examples"
- test_number: 4
python_version: "3.7"
deps: "osmesa"
test: "osmesa"
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.6.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: "recursive"
- name: Prepare System Environment
id: vars
run: |
# opengl system libraries
if [ "${{ matrix.deps }}" == 'full' ]; then
cat ci/requirements/linux_full_deps_apt.txt | xargs sudo apt-get -y install
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 ::set-output name=python_version::${PY_VER//.}
- uses: mamba-org/provision-with-micromamba@v7
with:
environment-file: ./ci/requirements/py${{ steps.vars.outputs.python_version }}.yml
- name: Install conda-dependencies
run: |
micromamba install -y python=${{ matrix.python_version }} -f ci/requirements/linux_${{ matrix.deps }}_deps_conda.txt -c conda-forge
- name: Install pip-dependencies
run: |
if [ "${{ matrix.deps }}" == 'full' ]; then
pip install -r ci/requirements/linux_full_deps_pip.txt
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/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 }}" == 'examples' ]; then
export DISPLAY=:99.0
export XDG_RUNTIME_DIR=/tmp/runtime-runner
make examples
fi
if [ "${{ matrix.test }}" == 'osmesa' ]; then
export OSMESA_LIBRARY=~/micromamba/envs/vispy-tests/lib/libOSMesa32.so
export VISPY_GL_LIB=$OSMESA_LIBRARY
make osmesa
fi
if [ "${{ matrix.test }}" != "examples" ]; then
COVERAGE_FILE=.vispy-coverage coverage combine
mv .vispy-coverage .coverage
fi
- 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