Skip to content

Issue #222: Put back in changes to bit planes, multi-sampling and dep… #770

Issue #222: Put back in changes to bit planes, multi-sampling and dep…

Issue #222: Put back in changes to bit planes, multi-sampling and dep… #770

Workflow file for this run

# CI for this library is a bit tricky, as an working display/GFX card is
# expected to do the rendering. We use a fake display for Windows/Linux, and
# don't run CI on Mac. Running tests locally is simpler!
on: push
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-ver: [3.8, 3.9]
experimental: [false]
include:
- 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 }}
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 python dependencies in requirements-dev
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 ./sksurgeryvtk -m pytest -v -s
coverage report -m
- name: Run tests windows-latest/macos-latest
if: contains(matrix.os, 'o')
run: |
coverage erase
coverage run -a --source ./sksurgeryvtk -m pytest -v -s
coverage report -m
- name: archive projected images
if: startsWith(matrix.os, 'ubuntu')
uses: actions/upload-artifact@v2
with:
name: image
path: tests/output/fig06_case1b_overlay.png
- name: Linting
run: |
pylint --rcfile=tests/pylintrc --extension-pkg-whitelist=vtk,cv2,PySide6 sksurgeryvtk
- name: Run coveralls
run: |
coveralls
deploy:
runs-on: ubuntu-22.04
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
- name: Build wheel
run: |
python setup.py sdist bdist_wheel
- name: Publish package if tagged release
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}