Skip to content

Commit

Permalink
Add GitHub worflow for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Jan 29, 2022
1 parent ac66e2e commit bd8e3c5
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 1 deletion.
File renamed without changes.
59 changes: 59 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Run PyGreSQL test matrix

on:
push:
pull_request:

jobs:
tests:
name: Unit tests run
runs-on: ubuntu-18.04

strategy:
fail-fast: false
matrix:
include:
- {python: "2.7", postgres: "9.3"}
- {python: "3.5", postgres: "9.6"}
- {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"}

# Opposite extremes of the supported Py/PG range, other architecture
- {python: "2.7", postgres: "14", architecture: "x86"}
- {python: "3.5", postgres: "13", architecture: "x86"}
- {python: "3.6", postgres: "12", architecture: "x86"}
- {python: "3.7", postgres: "11", architecture: "x86"}
- {python: "3.8", postgres: "10", architecture: "x86"}
- {python: "3.9", postgres: "9.6", architecture: "x86"}
- {python: "3.10", postgres: "9.3", architecture: "x86"}

services:
postgresql:
image: postgres:${{ matrix.postgres }}
env:
POSTGRES_USER: unittest
POSTGRES_PASSWORD: test
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 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 py${MATRIX_PYTHON/./}
timeout-minutes: 5
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# config file for tox

[tox]
envlist = py{27,35,36,37,38,39,310},flake8,docs
envlist = 27,3{5,6,7,8,9,10},flake8,docs

[testenv:flake8]
basepython = python3.9
Expand Down

0 comments on commit bd8e3c5

Please sign in to comment.