Skip to content

Instantly share code, notes, and snippets.

@dvarrazzo
Created March 1, 2021 00:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dvarrazzo/b60928447011dfde993df37ac46bbc38 to your computer and use it in GitHub Desktop.
Save dvarrazzo/b60928447011dfde993df37ac46bbc38 to your computer and use it in GitHub Desktop.
Sketch of psycopg3 test action
name: Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
tests-python:
name: Python package tests
runs-on: ubuntu-20.04
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
env:
PSYCOPG3_TEST_DSN: host=postgresql dbname=psycopg3_test
PSYCOPG3_IMPL: python
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: install postgresql client
run: sudo apt install postgresql-client-${{ matrix.postgres }}
- name: install the Python packages and tests
run: pip install ./psycopg3[tests]
tests-c:
name: C package tests
runs-on: ubuntu-20.04
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
env:
PSYCOPG3_TEST_DSN: host=postgresql dbname=psycopg3_test
PSYCOPG3_IMPL: c
# skip tests failing on importing psycopg3_c.pq on subprocess
# they only fail on Travis, work ok locally under tox too.
# TODO: so maybe they work on github?
PYTEST_ADDOPTS: "-m 'not subprocess'"
services:
postgresql:
image: postgres:${{ matrix.postgres }}
env:
POSTGRES_DB: psycopg3_test
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: install postgresql client
run: sudo apt install postgresql-client-${{ matrix.postgres }}
- name: install the Python packages and tests
run: pip install ./psycopg3[tests]
- name: build the C package
run: pip install ./psycopg3_c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment