Files
wehub-resource-sync bcbd1bdb22
Integ / changes (push) Has been skipped
Pre-commit / pre-commit (push) Failing after 1s
CLI exit codes / changes (push) Has been skipped
Test (Install) / changes (push) Has been skipped
Test (Python) / changes (push) Has been skipped
Test (TypeScript) / changes (push) Has been skipped
CLI exit codes / cli-gate (push) Has been cancelled
Test (Install) / test-install-gate (push) Has been cancelled
Integ / integ-gate (push) Has been cancelled
Test (Python) / test-python-gate (push) Has been cancelled
Test (TypeScript) / test-typescript-gate (push) Has been cancelled
Test (Install) / python-minimal (3.12) (push) Has been cancelled
Test (Install) / python-minimal (3.11) (push) Has been cancelled
Test (Install) / python-extra (agno, mirage.agents.agno) (push) Has been cancelled
Test (Install) / python-extra (chroma, mirage.resource.chroma) (push) Has been cancelled
Test (Install) / python-extra (pdf, mirage.core.filetype.pdf) (push) Has been cancelled
Integ / integ (push) Has been cancelled
Integ / integ-database (push) Has been cancelled
Integ / integ-database-ts (push) Has been cancelled
Integ / integ-data (push) Has been cancelled
Integ / integ-ssh (push) Has been cancelled
Integ / integ-ssh-ts (push) Has been cancelled
Test (Python) / audit (push) Has been cancelled
Test (TypeScript) / test (push) Has been cancelled
Test (TypeScript) / python-fs-shim (push) Has been cancelled
CLI exit codes / Python CLI (push) Has been cancelled
CLI exit codes / TypeScript CLI (push) Has been cancelled
CLI exit codes / Cross-language snapshot interop (push) Has been cancelled
Test (Python) / test (push) Has been cancelled
Test (Python) / import-isolation (deepagents, openai, mirage.agents.openai_agents) (push) Has been cancelled
Test (Python) / import-isolation (deepagents, pydantic-ai, mirage.agents.pydantic_ai) (push) Has been cancelled
Integ / integ-ts (push) Has been cancelled
Integ / integ-fuse (push) Has been cancelled
Test (Install) / python-extra (databricks, mirage.resource.databricks_volume) (push) Has been cancelled
Test (Install) / python-extra (deepagents, mirage.agents.langchain) (push) Has been cancelled
Test (Install) / python-extra (email, mirage.resource.email) (push) Has been cancelled
Test (Install) / python-extra (fuse, mirage.fuse.mount) (push) Has been cancelled
Test (Install) / python-extra (hdf5, mirage.core.filetype.hdf5) (push) Has been cancelled
Test (Install) / python-extra (hf, mirage.resource.hf_buckets) (push) Has been cancelled
Test (Install) / python-extra (lancedb, mirage.resource.lancedb) (push) Has been cancelled
Test (Install) / python-extra (langfuse, mirage.resource.langfuse) (push) Has been cancelled
Test (Install) / python-extra (mongodb, mirage.resource.mongodb) (push) Has been cancelled
Test (Install) / python-extra (nextcloud, mirage.resource.nextcloud) (push) Has been cancelled
Test (Install) / python-extra (openai, mirage.agents.openai_agents) (push) Has been cancelled
Test (Install) / python-extra (openhands, mirage.agents.openhands, 3.12) (push) Has been cancelled
Test (Install) / python-extra (parquet, mirage.core.filetype.parquet) (push) Has been cancelled
Test (Install) / python-extra (postgres, mirage.resource.postgres) (push) Has been cancelled
Test (Install) / python-extra (pydantic-ai, mirage.agents.pydantic_ai) (push) Has been cancelled
Test (Install) / python-extra (qdrant, mirage.resource.qdrant) (push) Has been cancelled
Test (Install) / python-extra (redis, mirage.resource.redis) (push) Has been cancelled
Test (Install) / python-extra (s3, mirage.resource.s3) (push) Has been cancelled
Test (Install) / python-extra (ssh, mirage.resource.ssh) (push) Has been cancelled
Test (Install) / ts-minimal (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:30:44 +08:00

209 lines
6.5 KiB
YAML

name: Test (Python)
permissions:
contents: read
"on":
push:
branches: [main]
paths:
- python/**
- examples/python/**
- integ/**
- .github/workflows/test_python.yml
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
permissions:
pull-requests: read
outputs:
hit: ${{ steps.filter.outputs.hit }}
steps:
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
hit:
- 'python/**'
- 'examples/python/**'
- 'integ/**'
- '.github/workflows/test_python.yml'
test:
needs: changes
if: ${{ !cancelled() && (github.event_name != 'pull_request' || needs.changes.outputs.hit == 'true') }}
runs-on: ubuntu-latest
services:
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
mongodb:
image: mongo:8
ports:
- 27017:27017
options: >-
--health-cmd "mongosh --quiet --eval 'db.runCommand({ping:1}).ok'"
--health-interval 10s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install Python dependencies
working-directory: python
run: uv sync --all-extras --no-extra camel
- name: Install package
working-directory: python
run: uv pip install .
- name: Run pytest (main suite, camel excluded)
working-directory: python
env:
REDIS_URL: redis://localhost:6379/0
MONGODB_URI: mongodb://localhost:27017
run: uv run pytest --ignore=tests/agents/camel
- name: Examples (output checked against integ/ truth files)
env:
REDIS_URL: redis://localhost:6379/0
run: |
run() { echo "## $1"; ./python/.venv/bin/python "$1" 2>&1 | bash integ/check_lines.sh "$2"; }
run examples/python/ram/ram.py integ/truth/python/ram.txt
run examples/python/ram/ram_vfs.py integ/truth/python/ram_vfs.txt
run examples/python/ram/ram_python.py integ/truth/python/ram_python.txt
run examples/python/disk/disk.py integ/truth/python/disk.txt
run examples/python/disk/disk_vfs.py integ/truth/python/disk_vfs.txt
run examples/python/other/custom_command.py integ/truth/python/custom_command.txt
run examples/python/redis_resource/example_redis.py integ/truth/python/redis.txt
run examples/python/redis_resource/example_redis_index.py integ/truth/python/redis_index.txt
run examples/python/redis_resource/example_redis_cache.py integ/truth/python/redis_cache.txt
run examples/python/redis_resource/example_redis_vfs.py integ/truth/python/redis_vfs.txt
run examples/python/version/branching.py integ/truth/version_branching.txt
- name: Sync Python dependencies for camel
working-directory: python
run: uv sync --extra camel
- name: Run pytest (camel toolkit tests)
working-directory: python
run: uv run pytest tests/agents/camel
import-isolation:
needs: changes
if: ${{ !cancelled() && (github.event_name != 'pull_request' || needs.changes.outputs.hit == 'true') }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- extra: pydantic-ai
module: mirage.agents.pydantic_ai
blocked: deepagents
- extra: openai
module: mirage.agents.openai_agents
blocked: deepagents
steps:
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Create venv and install only the target extra
working-directory: python
run: |
uv venv .venv-iso
uv pip install --python .venv-iso/bin/python ".[${{ matrix.extra }}]"
- name: Verify blocked package is not installed
working-directory: python
run: |
if .venv-iso/bin/python -c "import ${{ matrix.blocked }}" 2>/dev/null; then
echo "FAIL: ${{ matrix.blocked }} should not be installed for extra=${{ matrix.extra }}"
exit 1
fi
echo "OK: ${{ matrix.blocked }} is absent"
- name: Import agent package and prompt without blocked dep
working-directory: python
run: |
.venv-iso/bin/python - <<'PY'
import importlib, sys
mod = importlib.import_module("${{ matrix.module }}")
prompt = importlib.import_module("${{ matrix.module }}.prompt")
assert isinstance(prompt.MIRAGE_SYSTEM_PROMPT, str)
assert callable(prompt.build_system_prompt)
assert "${{ matrix.blocked }}" not in sys.modules, \
f"${{ matrix.blocked }} got imported transitively"
print(f"OK: imported ${{ matrix.module }} cleanly without ${{ matrix.blocked }}")
PY
audit:
needs: changes
if: ${{ !cancelled() && (github.event_name != 'pull_request' || needs.changes.outputs.hit == 'true') }}
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Audit dependencies for known vulnerabilities (informational)
working-directory: python
run: uv audit --preview-features audit --no-extra camel
gate:
name: test-python-gate
runs-on: ubuntu-latest
needs: [changes, test, import-isolation]
if: always()
steps:
- name: Check required jobs
run: |
results="${{ join(needs.*.result, ' ') }}"
echo "$results"
case "$results" in
*failure*|*cancelled*) exit 1 ;;
esac