Files
dikte/.github/workflows/tests.yml
T
yusufipek 2f59029261 Put the modules in a package and the scripts in a folder
Twenty-two files at the top of the tree was the first thing anybody saw of
this repository. They are one package now, imported relatively, and the three
scripts that are not the front door moved under scripts/. install.sh stays
where the README has always said it is.

What starts the application is dikte/__main__.py: python3 -m dikte runs it,
and so does naming the file, which is what the launcher symlink, both .desktop
files, the macOS bundle and every registered shortcut do. Run by path there is
no package around it, so it puts the checkout on sys.path itself.

The installers now keep the keys you chose when they are given none, which is
what an update is: update.sh no longer has to read them out and pass them back.
An updater from before this commit cannot read them at all, so the one thing it
can say, the default key with an empty discard key, is read as "nothing was
asked for" rather than obeyed. That guard can go once nobody is updating across
this commit.
2026-08-16 14:01:01 +03:00

77 lines
2.4 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