mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-15 05:26:37 +03:00
77 lines
2.3 KiB
YAML
77 lines
2.3 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
tests:
|
|
name: Unit tests run
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- {python: "3.6", postgres: "10"}
|
|
- {python: "3.7", postgres: "11"}
|
|
- {python: "3.8", postgres: "12"}
|
|
- {python: "3.9", postgres: "13"}
|
|
- {python: "3.10", postgres: "14"}
|
|
- {python: "3.11-dev", postgres: "15rc1"}
|
|
|
|
# Opposite extremes of the supported Py/PG range, other architecture
|
|
- {python: "3.6", postgres: "15rc1", architecture: "x86"}
|
|
- {python: "3.7", postgres: "14", architecture: "x86"}
|
|
- {python: "3.8", postgres: "13", architecture: "x86"}
|
|
- {python: "3.9", postgres: "12", architecture: "x86"}
|
|
- {python: "3.10", postgres: "11", architecture: "x86"}
|
|
- {python: "3.11-dev", postgres: "10", architecture: "x86"}
|
|
|
|
env:
|
|
PSYCOPG2_TESTDB: postgres
|
|
PSYCOPG2_TESTDB_HOST: 127.0.0.1
|
|
PSYCOPG2_TESTDB_USER: postgres
|
|
PSYCOPG2_TESTDB_PASSWORD: password
|
|
|
|
services:
|
|
postgresql:
|
|
image: postgres:${{ matrix.postgres }}
|
|
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
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: install libpq 15
|
|
# TODO: disable after PostgreSQL 15 has been released officially.
|
|
if: true
|
|
run: |
|
|
set -x
|
|
rel=$(lsb_release -c -s)
|
|
echo "deb http://apt.postgresql.org/pub/repos/apt ${rel}-pgdg main 15" \
|
|
| sudo tee -a /etc/apt/sources.list.d/pgdg.list
|
|
sudo apt-get -qq update
|
|
pqver=$(apt-cache show libpq5 | grep ^Version: | head -1 \
|
|
| awk '{print $2}')
|
|
sudo apt-get -qq -y install "libpq-dev=${pqver}" "libpq5=${pqver}"
|
|
|
|
- name: Install tox
|
|
run: pip install tox
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python }}
|
|
- name: Run tests
|
|
env:
|
|
MATRIX_PYTHON: ${{ matrix.python }}
|
|
run: tox -e ${MATRIX_PYTHON%-dev}
|
|
timeout-minutes: 5
|