1
1
# This workflow will install pydm dependencies and run the test suite for all combinations
2
2
# of operating systems and version numbers specified in the matrix
3
-
4
3
name : Build Status
5
4
6
5
on :
@@ -27,27 +26,39 @@ jobs:
27
26
QT_MAC_WANTS_LAYER : 1 # PyQT gui tests involving qtbot interaction on macOS will fail without this
28
27
29
28
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
+
30
41
- uses : actions/checkout@v4
31
- - name : Setup conda
42
+ - name : Setup Conda and install PyQt5
32
43
uses : conda-incubator/setup-miniconda@v3
33
44
with :
34
45
python-version : ${{ matrix.python-version }}
35
46
miniforge-variant : Miniforge3
36
47
miniforge-version : latest
37
- activate-environment : pydm -env
48
+ activate-environment : pyqt -env
38
49
conda-remove-defaults : true
39
50
architecture : x64 # Ensure macOS finds PyQt 5.12.3 which isn't available with osx-arm64
40
51
41
- - name : Install PyDM with Mamba
52
+ - name : Install PyQt5 and PyDM with Mamba (if windows use conda)
42
53
shell : bash -el {0}
43
54
run : |
44
55
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 }}
46
57
else
47
58
mamba install -c conda-forge pydm pyqt=${{ matrix.pyqt-version }}
48
59
fi
49
60
50
- - name : Install additional Python dependencies with pip
61
+ - name : Install additional Python dependencies with pip for PyQt5
51
62
shell : bash -el {0}
52
63
run : |
53
64
pip install -r requirements.txt
@@ -56,21 +67,62 @@ jobs:
56
67
else
57
68
pip install -r dev-requirements.txt
58
69
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
+ }
59
89
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)
61
102
shell : bash -el {0}
62
103
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
70
108
fi
71
109
72
- - name : Test with pytest
110
+ - name : Install additional Python dependencies with pip for PySide6
73
111
shell : bash -el {0}
74
- timeout-minutes : 30 # timeout applies to single run of run_tests.py, not all os/python combos
75
112
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')"
76
128
python run_tests.py
0 commit comments