version: 0.2

phases:
  install:
    runtime-versions:
      python: 3.12
    commands:
      - echo "Installing uv..."
      - curl -LsSf https://astral.sh/uv/install.sh | sh
      - export PATH="$HOME/.cargo/bin:$PATH"

  pre_build:
    commands:
      - echo "Checking out commit $COMMIT_ID"
      - git checkout $COMMIT_ID
      - echo "Setting up lint environment in studio_api..."
      - cd studio_api
      - cp .env.test-ci .env

  build:
    commands:
      - echo "Running linter with ruff..."
      - uv run --only-dev ruff format . --check --config ./pyproject.toml
      - uv run --only-dev ruff check . --config ./pyproject.toml 