ci: pin container for self-hosted runner + install Qt runtime libs for pytest-qt #22

Closed
Mark wants to merge 2 commits from ci/fix-self-hosted-python-setup into main
Owner

Fixes the failing CI on main.

Root cause

The forgejo-runner-user self-hosted runner container on blackhole is Alpine Linux with only git + bash installed; no python3, no pip, no lsb_release. The old .forgejo/workflows/ci.yml had:

runs-on: self-hosted
steps:
  - uses: actions/checkout@v4
  - uses: actions/setup-python@v5
    with:
      python-version: '3.11'
  - run: pip install -r requirements.txt
  - ...

actions/setup-python@v5 ran in the Alpine container, couldn't find Python 3.11 builds for Alpine (no lsb_release, no matching OS in the version manifest), errored out, and skipped every downstream step. Result: every run ended in failure without the test suite ever running.

Confirmed by inspection of podman logs forgejo-runner-user:

::error::The version '3.11' with architecture 'x64' was not found for this operating system.
Unable to locate executable file: lsb_release.

Fix (two commits on branch ci/fix-self-hosted-python-setup)

  1. Pin a Debian/Ubuntu container for the job (Mark convention — catthehacker/ubuntu:act-22.04). setup-python now installs Python 3.11 cleanly, pip install works, and py_compile passes.
  2. Install Qt runtime libs (libgl1, libegl1, libxcb-*, libnss3, …) and run pytest with QT_QPA_PLATFORM=offscreen. Without these the pytest-qt session fails at import time with ImportError: libGL.so.1: cannot open shared object file. With QT_QPA_PLATFORM=offscreen the GUI tests don't need a real display.

Also pinned shell: bash per step to avoid Dash surprises and switched all pip calls to python3 -m pip (catthehacker's image doesn't always expose a bare pip binary).

Verification

run trigger commit result duration
6500 workflow_dispatch (pre-fix) 7825969 failure ~30s
6501 workflow_dispatch (pre-fix) 7825969 failure ~30s
6502 push (container only) 5a1a935 failure (libGL.so.1 missing) ~5min
6503 push (container + Qt libs) ae26dcd success (241 tests passed) 306s
6504 workflow_dispatch (Qt libs) ae26dcd success (241 tests passed) ~5min

Both green runs: 241 passed in 0.58s.

No application code touched — workflow only.

Linked task: https://vikunja.tail018ac4.ts.net/tasks/147

Fixes the failing CI on main. ## Root cause The `forgejo-runner-user` self-hosted runner container on blackhole is Alpine Linux with only `git` + `bash` installed; no `python3`, no `pip`, no `lsb_release`. The old `.forgejo/workflows/ci.yml` had: ```yaml runs-on: self-hosted steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.11' - run: pip install -r requirements.txt - ... ``` `actions/setup-python@v5` ran in the Alpine container, couldn't find Python 3.11 builds for Alpine (no `lsb_release`, no matching OS in the version manifest), errored out, and skipped every downstream step. Result: every run ended in failure without the test suite ever running. Confirmed by inspection of `podman logs forgejo-runner-user`: ``` ::error::The version '3.11' with architecture 'x64' was not found for this operating system. Unable to locate executable file: lsb_release. ``` ## Fix (two commits on branch `ci/fix-self-hosted-python-setup`) 1. **Pin a Debian/Ubuntu container for the job** (Mark convention — `catthehacker/ubuntu:act-22.04`). setup-python now installs Python 3.11 cleanly, pip install works, and py_compile passes. 2. **Install Qt runtime libs (libgl1, libegl1, libxcb-*, libnss3, …) and run pytest with `QT_QPA_PLATFORM=offscreen`**. Without these the pytest-qt session fails at import time with `ImportError: libGL.so.1: cannot open shared object file`. With `QT_QPA_PLATFORM=offscreen` the GUI tests don't need a real display. Also pinned `shell: bash` per step to avoid Dash surprises and switched all pip calls to `python3 -m pip` (catthehacker's image doesn't always expose a bare `pip` binary). ## Verification | run | trigger | commit | result | duration | |------|-------------------------------|---------|---------------------------------|----------| | 6500 | workflow_dispatch (pre-fix) | 7825969 | failure | ~30s | | 6501 | workflow_dispatch (pre-fix) | 7825969 | failure | ~30s | | 6502 | push (container only) | 5a1a935 | failure (libGL.so.1 missing) | ~5min | | 6503 | push (container + Qt libs) | ae26dcd | **success** (241 tests passed) | 306s | | 6504 | workflow_dispatch (Qt libs) | ae26dcd | **success** (241 tests passed) | ~5min | Both green runs: `241 passed in 0.58s`. No application code touched — workflow only. Linked task: https://vikunja.tail018ac4.ts.net/tasks/147
The forgejo-runner-user container on blackhole is Alpine with only git
and bash installed (no python3, no pip, no lsb_release).  On Alpine the
actions/setup-python@v5 action fails to find Python 3.11 builds and every
downstream step is skipped, so the run ends in failure without ever
running the tests.

Pin the job to catthehacker/ubuntu:act-22.04 (Mark convention; ships
Python 3.10 + pip + the OS libs the action and onnxruntime need), add
explicit `shell: bash` per step (avoids Dash issues with set -e/pipefail
in mapfile-style flows), and switch pip calls to `python3 -m pip`
because catthehacker's image does not always expose a `pip` binary.
ci: install Qt runtime libs and set QT_QPA_PLATFORM=offscreen for pytest-qt
All checks were successful
CI / build (push) Successful in 5m5s
CI / build (pull_request) Successful in 5m6s
ae26dcd726
The catthehacker/ubuntu:act-22.04 container ships PyQt6 cleanly via pip,
but pytest-qt imports QtGui at session startup, which links to
libGL.so.1 / libEGL / a stack of libxcb-* helper libs that the base
image does not include. Without them the suite fails before any test
runs with:

  ImportError: libGL.so.1: cannot open shared object file

Add the apt packages pytest-qt + PyQt6 need at runtime, plus xvfb as a
safety net, and run the pytest step with QT_QPA_PLATFORM=offscreen so
the GUI tests don't try to open a real display.
Mark closed this pull request 2026-09-21 01:47:00 +00:00
All checks were successful
CI / build (push) Successful in 5m5s
CI / build (pull_request) Successful in 5m6s

Pull request closed

Sign in to join this conversation.
No description provided.