Skip to content

Commit

Permalink
Use xvfb-run on ubuntu instead of offscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
PrimozGodec committed Jun 26, 2023
1 parent 9d5bc52 commit de4b87f
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions .github/workflows/test-addons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,29 +73,35 @@ jobs:
if: runner.os == 'Linux' && startsWith(matrix.pyqt, '6')
run: |
sudo apt-get update
sudo apt-get install -y libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 libegl1-mesa libxcb-shape0
sudo apt-get install -y libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 libegl1-mesa libxcb-shape0 libxcb-cursor0
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox
- name: Set environment variable
# this step sets QT_QPA_PLATFORM env which is mandatory on Linux and
# it is skipped on Windows since it produces SEGFAULT when WebView used
if: runner.os != 'Windows'
run: |
echo "QT_QPA_PLATFORM=offscreen" >> $GITHUB_ENV
- name: Set Ubuntu eviroment variables
# on Ubuntu QTWEBENGINE_CHROMIUM_FLAGS needs to be set for webview to work
if: runner.os == 'Linux'
- name: Test with Tox at Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
echo "QTWEBENGINE_CHROMIUM_FLAGS=--disable-gpu --no-sandbox" >> $GITHUB_ENV
catchsegv xvfb-run -a -s "$XVFBARGS" tox -e ${{ matrix.tox_env }}
env:
# Set pyqt and webengine versions.
PYQT_PYPI_NAME: "${{ startsWith(matrix.pyqt, '5') && 'PyQt5' || 'PyQt6' }}"
PYQT_PYPI_VERSION: ${{ matrix.pyqt }}
WEBENGINE_PYPI_NAME: "${{ startsWith(matrix.pyqt, '5') && 'PyQtWebEngine' || 'PyQt6-WebEngine' }}"
WEBENGINE_PYPI_VERSION: ${{ matrix.pyqt }}

- name: Test with Tox
run: |
tox -e ${{ matrix.tox_env }}
# Need this otherwise unittest installs a warning filter that overrides
# our desire to have OrangeDeprecationWarnings raised
PYTHONWARNINGS: module
# for xvfb at Ubuntu
XVFBARGS: "-screen 0 1280x1024x24"
# on Ubuntu QTWEBENGINE_CHROMIUM_FLAGS needs to be set for webview to work
QTWEBENGINE_CHROMIUM_FLAGS: "--disable-gpu --no-sandbox"

- name: Test with Tox at other systems
if: matrix.os != 'ubuntu-latest'
run: tox -e ${{ matrix.tox_env }}
env:
# Set pyqt and webengine versions.
PYQT_PYPI_NAME: "${{ startsWith(matrix.pyqt, '5') && 'PyQt5' || 'PyQt6' }}"
Expand Down

0 comments on commit de4b87f

Please sign in to comment.