Skip to content

Commit fa3557d

Browse files
committed
Add CI workflows for testing with PyQt5, PyQt6, and PySide6
1 parent 55d080b commit fa3557d

File tree

3 files changed

+99
-1
lines changed

3 files changed

+99
-1
lines changed

.github/workflows/test.yml .github/workflows/test_pyqt5.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Inspired from https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#github-actions
55

6-
name: Build, install and test
6+
name: Build, install and test with PyQt5
77

88
on:
99
push:

.github/workflows/test_pyqt6.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
# Inspired from https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#github-actions
5+
6+
name: Build, install and test with PyQt6
7+
8+
on:
9+
push:
10+
branches: [ "master", "develop" ]
11+
pull_request:
12+
branches: [ "master", "develop" ]
13+
14+
jobs:
15+
build:
16+
17+
env:
18+
DISPLAY: ':99.0'
19+
20+
runs-on: ubuntu-latest
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
python-version: ["3.9", "3.13"]
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
- name: Install dependencies
33+
run: |
34+
sudo apt install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils
35+
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX
36+
python -m pip install --upgrade pip
37+
python -m pip install flake8 pytest
38+
pip install PyQt6 setuptools numpy Cython
39+
python setup.py build_ext --inplace
40+
pip install .[test]
41+
- name: Lint with flake8
42+
run: |
43+
# stop the build if there are Python syntax errors or undefined names
44+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
45+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
46+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
47+
- name: Test with pytest
48+
run: |
49+
pytest

.github/workflows/test_pyside6.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
# Inspired from https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#github-actions
5+
6+
name: Build, install and test with PySide6
7+
8+
on:
9+
push:
10+
branches: [ "master", "develop" ]
11+
pull_request:
12+
branches: [ "master", "develop" ]
13+
14+
jobs:
15+
build:
16+
17+
env:
18+
DISPLAY: ':99.0'
19+
20+
runs-on: ubuntu-latest
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
python-version: ["3.9", "3.13"]
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
- name: Install dependencies
33+
run: |
34+
sudo apt install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils
35+
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX
36+
python -m pip install --upgrade pip
37+
python -m pip install flake8 pytest
38+
pip install PySide6 setuptools numpy Cython
39+
python setup.py build_ext --inplace
40+
pip install .[test]
41+
- name: Lint with flake8
42+
run: |
43+
# stop the build if there are Python syntax errors or undefined names
44+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
45+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
46+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
47+
- name: Test with pytest
48+
run: |
49+
pytest

0 commit comments

Comments
 (0)