Skip to content

Commit a2c8f20

Browse files
committed
MNT: try running tests on pyside6 in github actions automated tests, expect these to fail terribly atm
mainly a curious test of how pyside6 runs in automation atm. (pyside6 still has many pending patches b4 is fully working...)
1 parent bd4fc86 commit a2c8f20

File tree

1 file changed

+68
-16
lines changed

1 file changed

+68
-16
lines changed

.github/workflows/run-tests.yml

Lines changed: 68 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# This workflow will install pydm dependencies and run the test suite for all combinations
22
# of operating systems and version numbers specified in the matrix
3-
43
name: Build Status
54

65
on:
@@ -27,27 +26,39 @@ jobs:
2726
QT_MAC_WANTS_LAYER: 1 # PyQT gui tests involving qtbot interaction on macOS will fail without this
2827

2928
steps:
29+
- name: Install packages for testing a Python Qt app on Linux
30+
shell: bash -el {0}
31+
run: |
32+
if [ "$RUNNER_OS" == "Linux" ]; then
33+
sudo apt update
34+
sudo apt install -y xvfb herbstluftwm libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils
35+
sudo /sbin/start-stop-daemon --start --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1024x768x24 -ac +extension GLX +render -noreset
36+
sleep 3
37+
sudo /sbin/start-stop-daemon --start --pidfile /tmp/custom_herbstluftwm_99.pid --make-pidfile --background --exec /usr/bin/herbstluftwm
38+
sleep 1
39+
fi
40+
3041
- uses: actions/checkout@v4
31-
- name: Setup conda
42+
- name: Setup Conda and install PyQt5
3243
uses: conda-incubator/setup-miniconda@v3
3344
with:
3445
python-version: ${{ matrix.python-version }}
3546
miniforge-variant: Miniforge3
3647
miniforge-version: latest
37-
activate-environment: pydm-env
48+
activate-environment: pyqt-env
3849
conda-remove-defaults: true
3950
architecture: x64 # Ensure macOS finds PyQt 5.12.3 which isn't available with osx-arm64
4051

41-
- name: Install PyDM with Mamba
52+
- name: Install PyQt5 and PyDM with Mamba (if windows use conda)
4253
shell: bash -el {0}
4354
run: |
4455
if [ "$RUNNER_OS" == "Windows" ]; then
45-
conda install -c conda-forge pydm pyqt=${{ matrix.pyqt-version }}
56+
conda install -c conda-forge pydm pyqt=${{ matrix.pyqt-version }}
4657
else
4758
mamba install -c conda-forge pydm pyqt=${{ matrix.pyqt-version }}
4859
fi
4960
50-
- name: Install additional Python dependencies with pip
61+
- name: Install additional Python dependencies with pip for PyQt5
5162
shell: bash -el {0}
5263
run: |
5364
pip install -r requirements.txt
@@ -56,21 +67,62 @@ jobs:
5667
else
5768
pip install -r dev-requirements.txt
5869
fi
70+
71+
- name: Run PyQt tests with pytest
72+
env:
73+
QT_API: pyqt5
74+
shell: bash -el {0}
75+
timeout-minutes: 30 # timeout applies to single run of run_tests.py, not all os/python combos
76+
run: |
77+
echo "Running PyQt tests with QT_API=$QT_API"
78+
python -c "import PyQt5.QtCore; print('PyQt5 is installed and working')"
79+
python run_tests.py
80+
81+
- name: Remove existing Miniconda installation on Windows (error workaround)
82+
if: runner.os == 'Windows'
83+
shell: powershell
84+
run: |
85+
$condaPath = "C:\Users\runneradmin\miniconda3"
86+
if (Test-Path $condaPath) {
87+
Remove-Item -Recurse -Force $condaPath
88+
}
5989
60-
- name: Install packages for testing a PyQt app on Linux
90+
- name: Setup Conda and install PySide6
91+
uses: conda-incubator/setup-miniconda@v3
92+
with:
93+
python-version: ${{ matrix.python-version }}
94+
miniforge-variant: Miniforge3
95+
miniforge-version: latest
96+
activate-environment: pyside-env
97+
conda-remove-defaults: true
98+
architecture: x64 # Ensure macOS finds PyQt 5.12.3 which isn't available with osx-arm64
99+
auto-update-conda: true
100+
101+
- name: Install PySide6 and PyDM with Mamba (if windows use conda)
61102
shell: bash -el {0}
62103
run: |
63-
if [ "$RUNNER_OS" == "Linux" ]; then
64-
sudo apt update
65-
sudo apt install -y xvfb herbstluftwm libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils
66-
sudo /sbin/start-stop-daemon --start --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1024x768x24 -ac +extension GLX +render -noreset
67-
sleep 3
68-
sudo /sbin/start-stop-daemon --start --pidfile /tmp/custom_herbstluftwm_99.pid --make-pidfile --background --exec /usr/bin/herbstluftwm
69-
sleep 1
104+
if [ "$RUNNER_OS" == "Windows" ]; then
105+
conda install -c conda-forge pyside6 pydm
106+
else
107+
mamba install -c conda-forge pyside6 pydm
70108
fi
71109
72-
- name: Test with pytest
110+
- name: Install additional Python dependencies with pip for PySide6
73111
shell: bash -el {0}
74-
timeout-minutes: 30 # timeout applies to single run of run_tests.py, not all os/python combos
75112
run: |
113+
pip install -r requirements.txt
114+
if [ "$RUNNER_OS" == "Windows" ]; then
115+
pip install -r windows-dev-requirements.txt
116+
else
117+
pip install -r dev-requirements.txt
118+
fi
119+
120+
- name: Run PySide6 tests with pytest
121+
env:
122+
QT_API: pyside6
123+
shell: bash -el {0}
124+
timeout-minutes: 30
125+
run: |
126+
echo "Running PySide6 tests with QT_API=$QT_API"
127+
python -c "import PySide6.QtCore; print('PySide6 is installed and working')"
76128
python run_tests.py

0 commit comments

Comments
 (0)