name: Classic - Agent smoke tests

on:
  workflow_dispatch:
  schedule:
    - cron: '0 8 * * *'
  push:
    branches: [ master, dev, ci-test* ]
    paths:
      - '.github/workflows/classic-autogpts-ci.yml'
      - 'classic/original_autogpt/**'
      - 'classic/forge/**'
      - 'classic/direct_benchmark/**'
      - 'classic/pyproject.toml'
      - 'classic/poetry.lock'
      - '!**/*.md'
  pull_request:
    branches: [ master, dev, release-* ]
    paths:
      - '.github/workflows/classic-autogpts-ci.yml'
      - 'classic/original_autogpt/**'
      - 'classic/forge/**'
      - 'classic/direct_benchmark/**'
      - 'classic/pyproject.toml'
      - 'classic/poetry.lock'
      - '!**/*.md'

defaults:
  run:
    shell: bash
    working-directory: classic

jobs:
  serve-agent-protocol:
    runs-on: ubuntu-latest
    timeout-minutes: 20
    env:
      min-python-version: '3.12'
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
          submodules: true

      - name: Set up Python ${{ env.min-python-version }}
        uses: actions/setup-python@v5
        with:
          python-version: ${{ env.min-python-version }}

      - name: Install Poetry
        run: |
          curl -sSL https://install.python-poetry.org | python -

      - name: Install dependencies
        run: poetry install

      - name: Run smoke tests with direct-benchmark
        run: |
          poetry run direct-benchmark run \
            --strategies one_shot \
            --models claude \
            --tests ReadFile,WriteFile \
            --json
        env:
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
          REQUESTS_CA_BUNDLE: /etc/ssl/certs/ca-certificates.crt
          NONINTERACTIVE_MODE: "true"
          CI: true
