name: Test notebooks

on: [push, pull_request]

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ['3.9', '3.12']

    steps:
      - uses: actions/checkout@v5
      - name: Install uv
        uses: astral-sh/setup-uv@v7

      - run: uv venv --python ${{ matrix.python-version }}

      - name: Install dependencies to run/test notebooks
        run: |
          uv pip install nbformat nbconvert jupyter pillow pytest numpy tensorflow
          uv pip install torch --index-url https://download.pytorch.org/whl/cpu
      - name: Testing notebooks
        run: |
          uv pip install -e . && uv run pytest scripts/test_notebooks.py
