name: Tests on: push: branches: [main] pull_request: branches: [main] jobs: test: runs-on: ubuntu-latest strategy: matrix: python-version: ["3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - 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.12" - 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