Skip to content

Split into standalone repo + production-grade CI #1

Split into standalone repo + production-grade CI

Split into standalone repo + production-grade CI #1

Workflow file for this run

name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
inputs:
run_live_smoke:
description: "Run the live smoke suite against api.agentchat.me"
type: boolean
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
# 3 OSes × 3 Python versions because PyPI metadata claims "OS Independent"
# and the realtime client uses asyncio (ProactorEventLoop on Windows vs
# SelectorEventLoop on Linux/macOS). Cross-OS coverage catches event-loop
# quirks before users do. Lint + type-check run on Linux only — they're
# deterministic across OSes; running 3× would burn CI minutes for zero
# signal.
check:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.11", "3.13"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- name: Install
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
- name: Ruff
if: ${{ matrix.os == 'ubuntu-latest' }}
run: python -m ruff check src tests
- name: Mypy
if: ${{ matrix.os == 'ubuntu-latest' }}
run: python -m mypy
- name: Pytest
run: python -m pytest -q
# Live smoke runs only on manual dispatch with run_live_smoke=true.
# `AGENTCHAT_LIVE_API_KEY` must be set on the repo (Settings → Secrets).
# Forks cannot read it. 3.12 only — one live hit per dispatch is plenty
# to catch wire drift; matrix runs would just N-up the same network call.
live-smoke:
if: ${{ github.event_name == 'workflow_dispatch' && inputs.run_live_smoke }}
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: pyproject.toml
- name: Install
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
- name: Live smoke against api.agentchat.me
env:
AGENTCHAT_LIVE_API_KEY: ${{ secrets.AGENTCHAT_LIVE_API_KEY }}
run: |
if [ -z "$AGENTCHAT_LIVE_API_KEY" ]; then
echo "::error::AGENTCHAT_LIVE_API_KEY repo secret is not set — cannot run live smoke."
exit 1
fi
python -m pytest -q tests/test_smoke_live.py