Skip to content

feat: add PostgreSQL support for CI tests and update test database configuration #63

feat: add PostgreSQL support for CI tests and update test database configuration

feat: add PostgreSQL support for CI tests and update test database configuration #63

Workflow file for this run

name: CI
on:
push:
branches:
- "main"
paths:
- "src/**"
- "tests/**"
- ".github/workflows/**"
- "pyproject.toml"
- "uv.lock"
- "!.gitignore"
- "!README.md"
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
paths:
- "src/**"
- "tests/**"
- ".github/workflows/**"
- "pyproject.toml"
- "uv.lock"
- "!.gitignore"
- "!README.md"
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 20
services:
postgres:
image: public.ecr.aws/docker/library/postgres:17
env:
POSTGRES_USER: develop
POSTGRES_PASSWORD: develop_secret
POSTGRES_DB: develop
ports:
- 5432:5432
steps:
- name: Checkout
uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.10.6'
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.8.17"
enable-cache: true
- name: Install the project
run: uv sync --locked --all-extras --dev
- name: Run tests (SQLite)
env:
API_KEY: TEST
run: |
uv run pytest -s --durations=5 --log-cli-level=INFO --capture=tee-sys -v
- name: Run tests (Postgres)
env:
API_KEY: TEST
run: |
uv run pytest -s --db postgres --durations=5 --log-cli-level=INFO --capture=tee-sys -v