name: CI

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  tests:
    name: Unit + Non-live Tests
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: "3.10"
          cache: "pip"

      - name: Install system dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y ffmpeg libsndfile1

      # NOTE: We intentionally do NOT install heavyweight GPU/vLLM deps in CI.
      # Unit tests are designed to run without a GPU and without model weights.
      - name: Install Python dependencies (minimal for tests)
        run: |
          python -m pip install --upgrade pip setuptools wheel
          pip install \
            pytest pytest-cov pytest-asyncio \
            fastapi uvicorn \
            pydantic prometheus_client \
            requests httpx numpy supabase

      - name: Run unit tests
        run: |
          pytest -q veena3modal/tests/unit

      - name: Run non-live test suite (skip Modal live tests)
        run: |
          pytest -q veena3modal/tests --ignore=veena3modal/tests/modal_live

