mirror of
https://github.com/kuhyx/screen-locker.git
synced 2026-11-10 23:07:13 +01:00
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
52 lines
1.5 KiB
YAML
52 lines
1.5 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.x"
|
|
|
|
- name: Install dependencies
|
|
run: pip install -r requirements.txt
|
|
|
|
- name: Run tests with coverage
|
|
run: python -m pytest -v
|
|
|
|
# The pytest suite replaces the whole `tk` module so it can never reach a
|
|
# display, which means the lock-screen widget behaviour it guards cannot be
|
|
# asserted there. This job runs the real-Tk half against a throwaway X
|
|
# server. See scripts/verify_lock_popup_safety.py.
|
|
lock-popup-safety:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.x"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y xvfb python3-tk
|
|
pip install -r requirements.txt
|
|
# The script imports screen_locker directly rather than through
|
|
# pytest, which would put the rootdir on sys.path for it.
|
|
pip install -e . --no-deps
|
|
|
|
- name: Sport selector survives gatelock's recovery tick
|
|
# Run as a module (like the screen-fits gate) so scripts/ resolves as a
|
|
# package and the check can import the helpers it was split into.
|
|
run: python3 -m scripts.verify_lock_popup_safety
|