name: tox

on:
  push:
    branches:
      - "main"
  pull_request:

jobs:
  tox:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ["3.11", "3.12", "3.13", "3.14"]

    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 system libraries for Qt
        run: |
          sudo apt-get update
          sudo apt-get install -y \
            libegl1 libgl1 libxcb1 libx11-6 libxext6 libxrender1 \
            libxkbcommon-x11-0 libxcomposite1 libxcursor1 libxi6 \
            libxrandr2 libxfixes3 libxdamage1 libnss3 libdbus-1-3 \
            libfontconfig1 libfreetype6 libglib2.0-0 libsm6 libice6

      - name: Set up uv
        uses: astral-sh/setup-uv@v7

      - name: Install tox
        run: python -m pip install tox

      - name: Run tox
        run: tox -- --runslow
