name: ci on: push: pull_request: jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: "3.11" - name: Install dependencies run: python -m pip install -r requirements.txt ruff mypy - name: Lint changed architecture modules run: ruff check interfaces runtime svc tests/test_oclaw_gateway_optimizations.py - name: Type check critical gateway modules run: mypy --ignore-missing-imports interfaces/gateway/context_builder.py interfaces/ws/server_methods_bridge.py interfaces/ws/turn_runner.py - name: Run tests run: python -m pytest -q tests - name: Offline eval sanity run: python runtime/operations/scripts/offline_eval.py test-postgresql: runs-on: ubuntu-latest services: postgres: image: postgres:16-alpine env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres ports: - 5432:5432 options: >- --health-cmd "pg_isready -U postgres" --health-interval 10s --health-timeout 5s --health-retries 10 env: AIA_ASSISTANT_DB_BACKEND: postgresql AIA_ASSISTANT_DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/oclaw AIA_TEST_PG_URL: postgresql://postgres:postgres@127.0.0.1:5432/oclaw OPS_WORKSPACE_ROOT: ${{ github.workspace }}/.ci_workspace steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: "3.11" - name: Install dependencies run: python -m pip install -r requirements.txt - name: Create database and apply migrations run: | mkdir -p "$OPS_WORKSPACE_ROOT" python - <<'PY' import os import psycopg dsn = os.environ["AIA_ASSISTANT_DATABASE_URL"] admin = dsn.rsplit("/", 1)[0] + "/postgres" with psycopg.connect(admin, autocommit=True) as conn: cur = conn.execute("SELECT 1 FROM pg_database WHERE datname = %s", ("oclaw",)) if cur.fetchone() is None: conn.execute("CREATE DATABASE oclaw") PY alembic upgrade head - name: Run PostgreSQL-scoped tests run: python -m pytest -q tests/test_database_backend.py tests/test_pg_compat.py tests/test_sa_app_settings.py tests/test_sa_auth_sessions.py tests/test_sa_chat_sessions.py tests/test_sa_chat_messages.py tests/test_sa_fork_trim_admin_sessions.py tests/test_sa_admin_user_stats_tool_health.py tests/test_sa_tool_log_trace.py tests/test_sa_prune_orphans.py tests/test_sa_ui_session_owner.py tests/test_sa_tenant_bind_code.py tests/test_sa_app_users.py tests/test_migrate_assistant_sqlite_to_pg.py