fix: mock monotonic() in notification tests instead of relying on sys… #81
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: posture checks | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| permissions: | |
| contents: read | |
| jobs: | |
| checks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| # cv2 needs libGL; PyQt6 needs xcb/EGL even in offscreen mode | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y --no-install-recommends \ | |
| libgl1 libglib2.0-0 \ | |
| libxcb-xinerama0 libxcb-cursor0 libxcb-icccm4 libxcb-image0 \ | |
| libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 \ | |
| libxcb-xfixes0 libxkbcommon-x11-0 libegl1 | |
| - name: Install dependencies | |
| run: uv sync --all-groups | |
| - name: Verify key imports | |
| env: | |
| QT_QPA_PLATFORM: offscreen | |
| run: | | |
| uv run python -c "import batesposture; print('batesposture OK')" | |
| uv run python -c "import cv2; print('cv2 OK')" | |
| uv run python -c "import mediapipe; print('mediapipe OK')" | |
| uv run python -c "from PyQt6.QtCore import QSettings; print('PyQt6 OK')" | |
| uv run python -c "from batesposture.services.settings_service import SettingsService; print('SettingsService OK')" | |
| uv run python -c "from batesposture.ml.pose_detector import PoseDetector; print('PoseDetector OK')" | |
| - name: Run pre-commit | |
| run: uv run pre-commit run --all-files | |
| - name: Check PR title for conventional commit format | |
| if: github.event_name == 'pull_request' | |
| env: | |
| PR_TITLE: ${{ github.event.pull_request.title }} | |
| run: | | |
| uv run python .github/workflows/title_check.py $(pwd) "$PR_TITLE" | |
| - name: pytest | |
| env: | |
| QT_QPA_PLATFORM: offscreen | |
| run: uv run python -m pytest -v --tb=long |