-
Notifications
You must be signed in to change notification settings - Fork 3
151 lines (136 loc) · 5.24 KB
/
ci.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
on: push
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-ver: [3.8]
experimental: [false]
include:
- python-ver: 3.9
os: ubuntu-latest
experimental: true
- python-ver: 3.9
os: windows-latest
experimental: true
- python-ver: 3.9
os: macos-latest
experimental: true
- python-ver: '3.10'
os: ubuntu-latest
experimental: true
- python-ver: '3.10'
os: macos-latest
experimental: true
- python-ver: '3.10'
os: windows-latest
experimental: true
- python-ver: 3.11
os: ubuntu-latest
experimental: true
- python-ver: 3.11
os: macos-latest
experimental: true
- python-ver: 3.11
os: windows-latest
experimental: true
- python-ver: 3.12-dev
os: ubuntu-latest
experimental: true
- python-ver: 3.12-dev
os: macos-latest
experimental: true
- python-ver: 3.12-dev
os: windows-latest
experimental: true
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-ver }}
# VTK uses OpenGL 2.0, but the windows Server version used on
# GitHub actions only has 1.1, so need to setup software rendering
# with Mesa.
# https://github.com/pal1000/mesa-dist-win
- name: Setup Mesa (Windows)
if: matrix.os == 'windows-latest'
run: |
curl --output mesa.7z -L https://github.com/pal1000/mesa-dist-win/releases/download/20.1.1-2/mesa3d-20.1.1-release-mingw.7z
7z x mesa.7z -omesa -y
# The script requires user input (choice of options) so need to
# fiddle to get it to run automatically. Not a clean way to do it,
# but works.
sed -i 's/@echo Please make a deployment choice:/@GOTO desktopgl/g' mesa\systemwidedeploy.cmd
sed -i 's/@echo Desktop OpenGL drivers deploy complete./@exit/g' mesa\systemwidedeploy.cmd
mesa\systemwidedeploy.cmd
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Install dependencies and run tests using xvfb (ubuntu-latest)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install xvfb
sudo apt-get install libegl-dev
sudo apt-get install libxcb-cursor-dev
## Qt for X11 Requirements> https://doc.qt.io/qt-6/linux-requirements.html
sudo apt-get install libfontconfig1-dev libfreetype6-dev
sudo apt-get install libx11-dev libx11-xcb-dev
sudo apt-get install libxext-dev libxfixes-dev
sudo apt-get install libxi-dev libxrender-dev
sudo apt-get install libxcb1-dev libxcb-glx0-dev libxcb-keysyms1-dev
sudo apt-get install libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev
sudo apt-get install libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev
sudo apt-get install libxcb-render-util0-dev libxcb-util-dev libxcb-xinerama0-dev libxcb-xkb-dev
sudo apt-get install libxkbcommon-dev libxkbcommon-x11-dev
export DISPLAY=:1
sudo Xvfb $DISPLAY -screen 0 1024x768x24 </dev/null &
export QT_DEBUG_PLUGINS=0
export QT_QPA_PLATFORM=xcb
export LD_LIBRARY_PATH=$pythonLocation"/lib/python${{ matrix.python-version }}/site-packages/PySide6/Qt/plugins/platforms"
coverage erase
coverage run -a --source ./sksurgerybard -m pytest -v -s
coverage report -m
- name: Run tests Windows/Mac
# Matches the 'o' in 'windows' or 'macos'
if: contains(matrix.os, 'o')
run: |
coverage erase
coverage run -a --source ./sksurgerybard -m pytest -v -s
coverage report -m
- name: Linting
run: |
pylint --rcfile=tests/pylintrc sksurgerybard
- name: Run coveralls
run: |
coveralls
deploy:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: python -m pip install wheel twine setuptools versioneer
- name: Build wheel
run: |
versioneer install
git restore --staged sksurgerybard/_version.py
git update-index --assume-unchanged sksurgerybard/_version.py
python setup.py sdist
- name: Publish package if tagged release
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}