Repo-root 'pytest --collect-only' failed with ImportPathMismatchError because agent-team/tests/ and the root tests/ are both the 'tests' package. Add a root conftest.py that excludes agent-team from the root collection, and a dedicated agent-team-tests CI job that runs the (API-key-free) agent-team suite in its own working dir.
74 lines
1.8 KiB
YAML
74 lines
1.8 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main]
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Install ruff
|
|
run: pip install ruff
|
|
|
|
- name: Ruff check
|
|
run: ruff check .
|
|
|
|
- name: Ruff format check
|
|
run: ruff format --check .
|
|
|
|
test-collect:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
cache: pip
|
|
cache-dependency-path: requirements.txt
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install -r requirements.txt
|
|
pip install pytest python-dotenv
|
|
|
|
- name: Pytest collect-only
|
|
# Verifies all test modules + their imports resolve cleanly.
|
|
# Live test execution requires ANTHROPIC_API_KEY + COMPOSIO_API_KEY
|
|
# and runs locally before push, not in CI.
|
|
run: pytest --collect-only -q
|
|
|
|
agent-team-tests:
|
|
# The agent-team/ subproject is self-contained (no API keys needed), so its
|
|
# suite RUNS in CI rather than only collecting. Its tests/ package collides
|
|
# with the repo-root tests/ under one rootdir, so it runs in its own dir.
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
cache: pip
|
|
cache-dependency-path: requirements.txt
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install -r requirements.txt
|
|
pip install pytest
|
|
|
|
- name: Run agent-team suite
|
|
working-directory: agent-team
|
|
run: python -m pytest -q
|