File: tests.yml

package info (click to toggle)
psycopg2 2.9.11-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,248 kB
  • sloc: ansic: 14,542; python: 11,992; sh: 475; makefile: 182
file content (80 lines) | stat: -rw-r--r-- 2,405 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Tests

env:
  PIP_BREAK_SYSTEM_PACKAGES: "1"

on:
  push:
  pull_request:

jobs:
  linux:
    runs-on: ubuntu-latest
    if: true

    strategy:
      fail-fast: false
      matrix:
        include:
          - {python: "3.9", postgres: "13"}
          - {python: "3.10", postgres: "14"}
          - {python: "3.11", postgres: "15"}
          - {python: "3.12", postgres: "16"}
          - {python: "3.13", postgres: "17"}
          - {python: "3.14", postgres: "18"}

          # Opposite extremes of the supported Py/PG range, other architecture
          - {python: "3.9", postgres: "18", architecture: "x86"}
          - {python: "3.10", postgres: "17", architecture: "x86"}
          - {python: "3.11", postgres: "16", architecture: "x86"}
          - {python: "3.12", postgres: "15", architecture: "x86"}
          - {python: "3.13", postgres: "14", architecture: "x86"}
          - {python: "3.14", postgres: "13", 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@v5

      # Can enable to test an unreleased libpq version.
      - name: install libpq 16
        if: false
        run: |
          set -x
          rel=$(lsb_release -c -s)
          echo "deb http://apt.postgresql.org/pub/repos/apt ${rel}-pgdg main 16" \
            | 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 < 4"
      - uses: actions/setup-python@v6
        with:
          python-version: ${{ matrix.python }}
          allow-prereleases: true
      - name: Run tests
        env:
          MATRIX_PYTHON: ${{ matrix.python }}
        run: tox -e ${MATRIX_PYTHON%-dev}
        timeout-minutes: 5