# }}}
+
+ crdb: # {{{
+ runs-on: ubuntu-latest
+
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - {crdb: "latest-v22.1", python: "3.10", impl: "c", libpq: "newest"}
+ - {crdb: "latest-v21.2", python: "3.9", impl: "python", libpq: ""}
+
+ env:
+ PSYCOPG_IMPL: ${{ matrix.impl }}
+ PSYCOPG_TEST_DSN: "host=127.0.0.1 port=26257 user=root dbname=defaultdb"
+ PYTEST_ADDOPTS: --color yes
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python }}
+
+ - name: Run CockroachDB
+ # Note: this would love to be a service, but I don't see a way to pass
+ # the args to the docker run command line.
+ run: |
+ docker pull cockroachdb/cockroach:${{ matrix.crdb }}
+ docker run --rm -d --name crdb -p 26257:26257 \
+ cockroachdb/cockroach:${{ matrix.crdb }} start-single-node --insecure
+
+ - name: Install the newest libpq version available
+ if: ${{ matrix.libpq == 'newest' }}
+ run: |
+ set -x
+ rel=$(lsb_release -c -s)
+ echo "deb http://apt.postgresql.org/pub/repos/apt ${rel}-pgdg main" \
+ | 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
+
+ - name: Run tests (Python implementation)
+ if: ${{ matrix.impl == 'python' }}
+ run: tox -c psycopg -e ${{ matrix.python }}
+
+ - name: Run tests (C implementation)
+ if: ${{ matrix.impl == 'c' }}
+ # skip tests failing on importing psycopg_c.pq on subprocess
+ # they only fail on Travis, work ok locally under tox too.
+ run: tox -c psycopg_c -e ${{ matrix.python }} -- -m 'not subprocess'
+
+ - name: Stop CockroachDB
+ run: docker kill crdb
+
+
+ # }}}