Skip to content

Commit b4278f8

Browse files
committed
ci: add ubuntu-24.04 guarded GUI workflow (sanity import + ldd diagnostics)
1 parent c075c00 commit b4278f8

1 file changed

Lines changed: 63 additions & 8 deletions

File tree

.github/workflows/gui-tests.yml

Lines changed: 63 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
jobs:
1616
gui-tests:
1717
name: GUI tests (Linux headless)
18-
runs-on: ubuntu-latest
18+
runs-on: ubuntu-24.04
1919
env:
2020
PYTHONPATH: ${{ github.workspace }}
2121
steps:
@@ -29,32 +29,87 @@ jobs:
2929

3030
- name: Install system packages for headless Qt
3131
run: |
32+
set -e
3233
sudo apt-get update -y
33-
# Install common EGL/OpenGL and X11 packages. Use || true so the job
34-
# continues even if package names differ across Ubuntu images.
35-
sudo apt-get install -y --no-install-recommends xvfb libegl1 libegl1-mesa libegl-mesa0 libegl1-mesa-drivers libglvnd0 libglx-mesa0 libglx0 libgl1-mesa-glx \
36-
libgl1-mesa-dri libgles2-mesa libgbm1 libxrandr2 libx11-xcb1 libxcb1 libx11-6 libxkbcommon0 \
37-
libxcb-xinerama0 libxss1 fontconfig fonts-dejavu-core fonts-dejavu-extra || true
34+
# Conservative set of packages that on ubuntu-24.04 commonly provide
35+
# libEGL.so.1 and other Mesa/GL dependencies. Some package names may
36+
# differ across images; continue on failure to keep the job non-fatal
37+
# while we iterate.
38+
sudo apt-get install -y --no-install-recommends \
39+
xvfb \
40+
libegl-mesa0 libegl1 libgbm1 libglx-mesa0 libgl1-mesa-dri libgl1-mesa-glx \
41+
libgles2 libx11-6 libx11-xcb1 libxcb1 libxrandr2 libxkbcommon0 \
42+
fontconfig fonts-dejavu-core fonts-dejavu-extra || true
43+
# Refresh font cache
3844
sudo fc-cache -f -v || true
3945
4046
- name: Install Python dependencies (pytest-qt + PySide6)
4147
run: |
4248
python -m pip install --upgrade pip
4349
python -m pip install -r requirements-dev-minimal.txt
4450
python -m pip install pytest-qt
51+
# prefer binary wheels and retry once if the first attempt fails
4552
python -m pip install --prefer-binary --no-cache-dir "PySide6>=6.5,<7" || \
4653
(sleep 3 && python -m pip install --prefer-binary --no-cache-dir "PySide6>=6.5,<7") || \
4754
python -m pip install --no-deps --force-reinstall "PySide6>=6.5,<7"
4855
49-
- name: Check PySide6 import and set output
50-
id: check_pyside6
56+
- name: Sanity check PySide6 import (non-fatal) and collect diagnostics
57+
id: sanity
58+
run: |
59+
set -e
60+
echo 'Sanity: check PySide6 can be imported and report platform info (non-fatal)'
61+
python - <<'PY' || true
62+
import importlib, sys, traceback, subprocess
63+
try:
64+
m = importlib.import_module('PySide6')
65+
v = getattr(m, '__version__', 'unknown')
66+
print('PySide6 import OK, version:', v)
67+
from PySide6 import QtCore
68+
print('QtCore QT_VERSION_STR:', QtCore.QT_VERSION_STR)
69+
except Exception:
70+
print('PySide6 import failed (sanity check):', file=sys.stderr)
71+
traceback.print_exc()
72+
# Try to provide more diagnostics: locate shiboken6 and run ldd to show missing shared objects.
73+
try:
74+
shib = importlib.import_module('shiboken6')
75+
path = getattr(shib, '__file__', None)
76+
if path:
77+
print('\n== ldd for shiboken6 binary ==')
78+
subprocess.run(['ldd', path], check=False)
79+
except Exception:
80+
pass
81+
# Exit with non-zero so the subsequent output-based gate will detect failure
82+
sys.exit(1)
83+
PY
84+
85+
- name: Set import_ok output
86+
id: set_import_ok
5187
run: |
88+
# Write a single output line for the runner (true if PySide6 imports)
5289
if python -c "import importlib; importlib.import_module('PySide6')" >/dev/null 2>&1; then
5390
echo "import_ok=true" >> "$GITHUB_OUTPUT"
5491
else
5592
echo "import_ok=false" >> "$GITHUB_OUTPUT"
5693
fi
5794
95+
- name: Initialize test database for CI
96+
run: |
97+
# Ensure the repo root is on PYTHONPATH so tools/ci_init_db.py can import local packages
98+
export PYTHONPATH="${{ github.workspace }}"
99+
python tools/ci_init_db.py || true
100+
101+
- name: Run GUI-marked tests
102+
if: steps.set_import_ok.outputs.import_ok == 'true'
103+
run: |
104+
export QT_QPA_PLATFORM=offscreen
105+
xvfb-run -s '-screen 0 1280x1024x24' pytest -q -m gui
106+
107+
- name: Skip GUI tests notice
108+
if: steps.set_import_ok.outputs.import_ok != 'true'
109+
run: |
110+
echo 'PySide6 import failed — skipping GUI tests on this runner.'
111+
echo 'See earlier step "Sanity check PySide6 import" for ldd diagnostics.'
112+
58113
name: gui-tests
59114

60115
on:

0 commit comments

Comments
 (0)