ci: add tests workflow + gate releases on tests passing
- .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) <noreply@anthropic.com>
This commit is contained in:
@@ -11,7 +11,20 @@ on:
|
|||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
||||||
jobs:
|
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:
|
release:
|
||||||
|
needs: test # don't publish a release if the tests fail
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|||||||
@@ -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
|
||||||
Reference in New Issue
Block a user