2021-02-28 19:32:54 +03:00
|
|
|
name: Tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
tests:
|
2021-05-22 16:40:53 +03:00
|
|
|
name: Unit tests run
|
|
|
|
runs-on: ubuntu-20.04
|
2021-02-28 19:32:54 +03:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2021-05-22 16:40:53 +03:00
|
|
|
include:
|
2021-10-05 01:44:09 +03:00
|
|
|
- {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"}
|
2021-10-18 00:19:43 +03:00
|
|
|
- {python: "3.11-dev", postgres: "14"}
|
2021-05-22 16:40:53 +03:00
|
|
|
|
|
|
|
# Opposite extremes of the supported Py/PG range, other architecture
|
2021-10-05 01:44:09 +03:00
|
|
|
- {python: "3.6", postgres: "14", architecture: "x86"}
|
|
|
|
- {python: "3.7", postgres: "13", architecture: "x86"}
|
|
|
|
- {python: "3.8", postgres: "12", architecture: "x86"}
|
|
|
|
- {python: "3.9", postgres: "11", architecture: "x86"}
|
|
|
|
- {python: "3.10", postgres: "10", architecture: "x86"}
|
2021-10-18 00:19:43 +03:00
|
|
|
- {python: "3.11-dev", postgres: "10", architecture: "x86"}
|
2021-05-22 16:40:53 +03:00
|
|
|
|
|
|
|
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
|
2021-02-28 19:32:54 +03:00
|
|
|
|
|
|
|
steps:
|
2021-05-22 16:40:53 +03:00
|
|
|
- uses: actions/checkout@v2
|
2021-10-18 00:19:43 +03:00
|
|
|
- name: Install tox
|
|
|
|
run: pip install tox
|
2021-05-22 16:40:53 +03:00
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python }}
|
|
|
|
- name: Run tests
|
2021-10-18 00:19:43 +03:00
|
|
|
env:
|
|
|
|
MATRIX_PYTHON: ${{ matrix.python }}
|
|
|
|
run: tox -e ${MATRIX_PYTHON%-dev}
|
2021-05-22 16:40:53 +03:00
|
|
|
timeout-minutes: 5
|