57 lines
1.5 KiB
YAML
57 lines
1.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
postgres:
|
|
image: pgvector/pgvector:pg16
|
|
env:
|
|
POSTGRES_USER: knowledgegraph_app
|
|
POSTGRES_PASSWORD: test-password
|
|
POSTGRES_DB: knowledgegraph
|
|
ports:
|
|
- 5432:5432
|
|
options: >-
|
|
--health-cmd "pg_isready -U knowledgegraph_app -d knowledgegraph"
|
|
--health-interval 5s
|
|
--health-timeout 5s
|
|
--health-retries 20
|
|
|
|
env:
|
|
DATABASE_URL: postgresql+psycopg://knowledgegraph_app:test-password@localhost:5432/knowledgegraph
|
|
TEST_POSTGRES_URL: postgresql+psycopg://knowledgegraph_app:test-password@localhost:5432/knowledgegraph
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
cache: pip
|
|
|
|
- name: Install
|
|
run: python -m pip install -e ".[test]"
|
|
|
|
- name: Compile
|
|
run: python -m compileall -q src tests migrations
|
|
|
|
- name: Check dependencies
|
|
run: python -m pip check
|
|
|
|
- name: Run portable tests
|
|
run: python -m pytest -q --ignore=tests/integration/test_pgvector_postgres.py
|
|
|
|
- name: Run migration and PgVector integration
|
|
run: python -m pytest tests/integration/test_pgvector_postgres.py -q
|
|
|
|
- name: Validate Compose
|
|
run: docker compose config --quiet
|
|
|
|
- name: Build application image
|
|
run: docker build -f Containerfile -t knowledgegraph:test .
|