Files
dikte/.github/workflows/tests.yml
T
yusufipek b186f7fde2 Merge master: the modules moved into a package
Every file this branch touches moved into dikte/, so the merge is mostly the
rename following the edits. What needed a hand:

hotkey.py: master replaced the _macos()/_gnome() pair with one backend()
chooser, and this branch had added _windows() to the pair. Windows is a fifth
value of the chooser now, and everything that used to ask "macOS or Windows?"
asks backend() instead. The key is held by the running process there, so
installs_shortcuts() and shortcut_needs_restart() are both false for it, and
desktop_name() says Windows.

install.ps1 and the Windows README name dikte/__main__.py, the entry point the
Linux and macOS installers were pointed at in the same commit. The Start Menu
entry, the autostart entry and the dikte.cmd shim all come off one $entry
variable.

settings_ui.py: the shortcut tab now has a Windows sentence of its own, with
the Turkish for it. Falling through to the branch master wrote for a desktop
with no registry would have told a Windows user to check /dev/input. Nothing
covers that branch: there is no Windows Settings test class, the way there is
one for macOS.

CONTRIBUTING: the chooser it names is backend() now, and the test count is the
merged one, 1067 of 1110 running anywhere.
2026-08-16 14:10:28 +03:00

115 lines
3.9 KiB
YAML

name: tests
on:
push:
branches: [master]
pull_request:
jobs:
linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
# PyQt6 ships Qt itself, but Qt still loads these from the system, even
# for the offscreen platform the tests run on. QtNetwork wants the Kerberos
# library, and the widgets want fontconfig, whether or not anything is
# ever drawn.
- name: Install the Qt runtime libraries
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
libegl1 libgl1 libxkbcommon0 libdbus-1-3 libglib2.0-0 \
libfontconfig1 libfreetype6 libgssapi-krb5-2
- name: Install PyQt6
run: python -m pip install --quiet PyQt6
# Nothing else is needed: the code is standard library and PyQt6, and the
# tests reach neither the network nor a sound device.
- name: Run the tests
run: python -m unittest discover --verbose
# The macOS backends are written to be checked from either side, so most of
# what runs here also runs above. What only this job can catch is the half
# that reads the real platform: the Carbon and CoreGraphics libraries have to
# be there to be opened, the paths under ~/Library have to be the ones macOS
# actually uses, and the Linux tests are skipped rather than failed.
macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python: ["3.11", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
# No apt step: PyQt6's wheel carries the frameworks it needs on a Mac.
- name: Install PyQt6
run: python -m pip install --quiet PyQt6
- name: Run the tests
run: python -m unittest discover --verbose
# The installer is most of what is new on a Mac, and a syntax error in it
# would otherwise only turn up on somebody's machine. Running it is not on
# the table here: it wants a microphone, a login session and a keychain.
- name: Check the installer parses
run: |
bash -n install.sh
bash -n scripts/install-mac.sh
bash -n scripts/update.sh
bash -n scripts/uninstall.sh
# The same job again for the same reason. The Windows backends are faked at
# the one function that loads user32 and kernel32, so every line of them is
# already read on the Linux above; what only this job can catch is the half
# that reads the real system. %APPDATA% and %LOCALAPPDATA% have to be the
# directories Windows actually hands out, a path spelled with a backslash has
# to be one the tests can still read, and the config-permission test has to
# skip rather than fail on a file system that decides by ACL.
windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python: ["3.11", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
# No apt step: PyQt6's wheel carries the Qt DLLs it needs on Windows.
- name: Install PyQt6
run: python -m pip install --quiet PyQt6
- name: Run the tests
run: python -m unittest discover --verbose
# What the Mac does for its installer, in the language this one is in.
# Parsing only: install.ps1 writes into the Start Menu and the user PATH.
- name: Check the installer parses
shell: pwsh
run: |
$problems = $null
[System.Management.Automation.Language.Parser]::ParseFile(
"$PWD/install.ps1", [ref]$null, [ref]$problems) > $null
if ($problems) { $problems; exit 1 }