From 952f53718fc310cefc23bbaab5e0a959308813d6 Mon Sep 17 00:00:00 2001 From: Pasi Vuorio Date: Tue, 27 Oct 2026 17:37:44 +0200 Subject: [PATCH] Add CI: root and agent tests on PostgreSQL, and signal-intelligence tests Co-Authored-By: Claude Haiku 5.5 --- .github/workflows/ci.yml | 86 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..80f0fc1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,86 @@ +name: CI + +# Runs on every pull request and on pushes to main. Pull requests from forks get no secrets. +on: + pull_request: + push: + branches: [main] + +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + tests: + name: tests (root and agents) + runs-on: ubuntu-latest + timeout-minutes: 20 + services: + postgres: + image: pgvector/pgvector:pg17 + env: + POSTGRES_USER: test + POSTGRES_PASSWORD: test + POSTGRES_DB: signalscout_ui_test + ports: ["5432:5432"] + options: >- + --health-cmd "pg_isready -U test -d signalscout_ui_test" + --health-interval 5s --health-timeout 3s --health-retries 10 + env: + TEST_DATABASE_URL: postgresql+psycopg://test:test@localhost:5432/signalscout_ui_test + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: pip + - name: Install + run: | + python -m pip install --upgrade pip + python -m pip install -e ".[test]" + - name: Root tests (PostgreSQL) + run: python -m pytest -q + - name: Agent tests + run: | + AGENT_TESTS=$(find agents -type d -name tests -not -path "*/signal-intelligence/*" -not -path "*/__pycache__/*" | sort) + PYTHONPATH=src:agents python -m pytest -q $AGENT_TESTS + + signal-intelligence: + name: tests (signal-intelligence) + runs-on: ubuntu-latest + timeout-minutes: 20 + services: + postgres: + image: pgvector/pgvector:pg17 + env: + POSTGRES_USER: test + POSTGRES_PASSWORD: test + POSTGRES_DB: signalscout_intelligence_test + ports: ["5432:5432"] + options: >- + --health-cmd "pg_isready -U test -d signalscout_intelligence_test" + --health-interval 5s --health-timeout 3s --health-retries 10 + env: + DATABASE_URL: postgresql+psycopg://test:test@localhost:5432/signalscout_intelligence_test + SIGNAL_INTELLIGENCE_TEST_DATABASE_URL: postgresql+psycopg://test:test@localhost:5432/signalscout_intelligence_test + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: pip + - name: Install + run: | + python -m pip install --upgrade pip + python -m pip install -e ".[test]" + python -m pip install -r agents/signal-intelligence/requirements.txt + - name: Apply the application migrations + run: alembic upgrade head + - name: Signal-intelligence tests + working-directory: agents/signal-intelligence + env: + PYTHONPATH: ../../src:.. + run: python -m pytest -q tests