Skip to content

Build source packages #92

Build source packages

Build source packages #92

Workflow file for this run

name: Build source packages
on:
workflow_dispatch:
schedule:
- cron: '37 6 * * sun'
jobs:
sdist:
runs-on: ubuntu-latest
if: true
strategy:
fail-fast: false
matrix:
include:
- {package: psycopg, format: sdist, impl: python}
- {package: psycopg, format: wheel, impl: python}
- {package: psycopg_c, format: sdist, impl: c}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install the build package
run: pip install build
- name: Create the package
run: python -m build -o dist --${{ matrix.format }} ${{ matrix.package }}
- name: Install the Python package and test requirements
run: pip install `ls dist/*`[test] ./psycopg_pool
if: ${{ matrix.package == 'psycopg' }}
- name: Install the C package and test requirements
run: pip install dist/* ./psycopg[test] ./psycopg_pool
if: ${{ matrix.package == 'psycopg_c' }}
- name: Test the sdist package
run: pytest -m 'not slow and not flakey' --color yes
env:
PSYCOPG_IMPL: ${{ matrix.impl }}
PSYCOPG_TEST_DSN: "host=127.0.0.1 user=postgres"
PGPASSWORD: password
- uses: actions/upload-artifact@v3
with:
path: ./dist/*
services:
postgresql:
image: postgres:14
env:
POSTGRES_PASSWORD: password
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5