| 1 |
name: postgres |
| 2 |
|
| 3 |
on: |
| 4 |
pull_request: |
| 5 |
push: |
| 6 |
branches: |
| 7 |
- master |
| 8 |
paths: |
| 9 |
- pyproject.toml |
| 10 |
- uv.lock |
| 11 |
- "**.py" |
| 12 |
|
| 13 |
jobs: |
| 14 |
postgres-version: |
| 15 |
runs-on: ubuntu-latest |
| 16 |
strategy: |
| 17 |
max-parallel: 4 |
| 18 |
matrix: |
| 19 |
postgres-version: [14, 15, 16, 17, 18] |
| 20 |
psycopg-version: ["psycopg", "psycopg2"] |
| 21 |
services: |
| 22 |
postgres: |
| 23 |
image: postgres:${{ matrix.postgres-version }} |
| 24 |
env: |
| 25 |
POSTGRES_USER: postgres |
| 26 |
POSTGRES_PASSWORD: postgres |
| 27 |
POSTGRES_DB: sandbox |
| 28 |
ports: |
| 29 |
- 5432:5432 |
| 30 |
options: --name postgres --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 |
| 31 |
steps: |
| 32 |
- uses: actions/checkout@v3 |
| 33 |
- name: Install uv |
| 34 |
uses: astral-sh/setup-uv@v4 |
| 35 |
with: |
| 36 |
version: "latest" |
| 37 |
- name: Set up Python |
| 38 |
uses: actions/setup-python@v4 |
| 39 |
with: |
| 40 |
python-version: "3.x" |
| 41 |
- name: Install Dependencies |
| 42 |
run: uv sync --group dev |
| 43 |
- name: Install psycopg specific version ${{ matrix.psycopg-version }} |
| 44 |
run: uv pip install ${{ matrix.psycopg-version }} |
| 45 |
- name: Run Tests |
| 46 |
run: uv run pytest sandbox/tests |