Skip to content

fix: harden the multi-step editor, the last unguarded steps consumer … #200

fix: harden the multi-step editor, the last unguarded steps consumer …

fix: harden the multi-step editor, the last unguarded steps consumer … #200

# Lint, offscreen smoke-test across Python versions, then build the .deb.
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python package
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# PyQt6 wheels aren't published for 3.14 yet; test 3.10–3.13.
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install system libraries (Qt runtime + libudev for the transport .so)
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libegl1 libgl1 libxkbcommon0 libdbus-1-3 libudev1 \
libglib2.0-0 libfontconfig1 libfreetype6 \
libxcb-cursor0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 \
libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-xinerama0 \
libxkbcommon-x11-0 fonts-dejavu-core
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
# mypy pinned so a future release can't silently break the hard gate.
pip install PyQt6 Pillow psutil pyudev ruff pytest pytest-timeout mypy==2.3.0
- name: Lint with ruff
run: |
# Fail on real errors (syntax, undefined names); skip the vendored SDK.
ruff check fifine_deck --exclude fifine_deck/backend --select E9,F63,F7,F82
# Full style pass is advisory only.
ruff check fifine_deck --exclude fifine_deck/backend --exit-zero
- name: Type-check with mypy (hard gate)
if: matrix.python-version == '3.13'
run: mypy fifine_deck
- name: Regenerate icons
run: python tools/make_icons.py
- name: Run unit tests
env:
QT_QPA_PLATFORM: offscreen
# --timeout: the GUI tests build real modal dialogs. If one is ever left
# unstubbed, exec() blocks forever and would hold the runner until the
# job limit. Fail that test instead. Kept here rather than in pytest.ini
# so plain `pytest` still works without pytest-timeout installed.
run: HOME="$(mktemp -d)" python -m pytest --timeout=60
- name: Smoke test (offscreen)
env:
QT_QPA_PLATFORM: offscreen
QT_LOGGING_RULES: "*=false"
run: python .github/smoke_test.py
package:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v5
- name: Install packaging tools
run: |
sudo apt-get update
sudo apt-get install -y rsync dpkg-dev appstream desktop-file-utils
- name: Validate metadata (AppStream + desktop)
run: |
appstreamcli validate packaging/*.metainfo.xml
desktop-file-validate packaging/*.desktop
- name: Build .deb
run: ./packaging/build-deb.sh 0.0.0-ci
- name: Upload .deb artifact
uses: actions/upload-artifact@v7
with:
name: fifine-control-deck-deb
path: dist/*.deb