From c443a8b9f8808f1a01c1e3b5d2528021f2acb71c Mon Sep 17 00:00:00 2001 From: Jessey van Offeren Date: Fri, 22 May 2026 14:26:47 +0200 Subject: [PATCH] ci: add tests workflow + gate releases on tests passing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - .gitea/workflows/tests.yml: run `unittest discover` on push + pull_request. `core` job (stdlib install, GUI tests skip) is bulletproof; `gui-smoke` job installs the GUI extra + offscreen Qt libs and runs the suite headless. - release.yml: add a `test` job and `release: needs: test` so a push to main can't publish if the tests fail. No version bump — CI config only; nothing in the shipped app changed. Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitea/workflows/release.yml | 13 +++++++++++ .gitea/workflows/tests.yml | 43 ++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 .gitea/workflows/tests.yml diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index f078e5c..9937413 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -11,7 +11,20 @@ on: branches: [main] jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Install (core only) + run: python -m pip install -e . + - name: Run tests + run: python -m unittest discover -s tests -v + release: + needs: test # don't publish a release if the tests fail runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml new file mode 100644 index 0000000..0960d07 --- /dev/null +++ b/.gitea/workflows/tests.yml @@ -0,0 +1,43 @@ +name: tests +run-name: Run test suite + +# Runs the unittest suite on every push and pull request. Two jobs: +# core — stdlib-only install; the GUI tests skip (@skipUnless HAVE_QT). Bulletproof. +# gui-smoke — installs the GUI extra + offscreen Qt libs and runs the same suite headless, +# exercising the MainWindow/SetupWizard/DiagnosticDialog construction tests. +# Make `core` a required status check on `main` so a PR can't merge with failing tests. + +on: + push: + pull_request: + +jobs: + core: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Install (core only — no PySide6) + run: python -m pip install -e . + - name: Run tests (GUI tests skip without PySide6) + run: python -m unittest discover -s tests -v + + gui-smoke: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: System libraries for offscreen Qt + run: | + sudo apt-get update + sudo apt-get install -y libegl1 libgl1 libxkbcommon0 libdbus-1-3 libglib2.0-0 + - name: Install (with GUI extra) + run: python -m pip install -e ".[gui]" + - name: Run tests (headless) + env: + QT_QPA_PLATFORM: offscreen + run: python -m unittest discover -s tests -v