name: Test

on:
  push:
    branches:
    - main

  pull_request:
    branches:
    - main

jobs:
  test:
    strategy:
      matrix:
        python-version:
          - "3.14"

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v6

    - name: Set up Python
      uses: actions/setup-python@v6
      with:
        python-version: ${{ matrix.python-version }}
        cache: 'pip'
        cache-dependency-path: 'dev_requirements.txt'

    - name: Install dependencies
      run: pip install -r dev_requirements.txt

    - name: Check formatting
      run: |
        ruff check .
        ruff format --check .

    - name: Check types
      run: ty check *.py

    # I don't run tests in GitHub Actions because YouTube blocks yt-dlp
    # without authentication, and I don't want to sort out passing cookies
    # in CI for now -- I can run the tests locally, that's good enough.
    # - name: Run tests
    #   run: pytest tests
