Skip to content

Commit

Permalink
Test with PostgreSQL.
Browse files Browse the repository at this point in the history
  • Loading branch information
amateja committed Nov 29, 2023
1 parent ccfce91 commit 9f4197c
Showing 1 changed file with 55 additions and 4 deletions.
59 changes: 55 additions & 4 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ jobs:
django: '>=4.1,<4.2'
- python-version: '3.7'
django: '>=3.2,<4.0'
- python-version: '3.6'
django: '>=3.2,<4.0'
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -58,12 +56,65 @@ jobs:
with:
parallel: true

test_postgres_4x:
runs-on: ubuntu-20.04
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10']
django: ['>=4.0,<4.1', '>=4.1,<4.2', '>=4.2,<5.0']
include:
- python-version: '3.12'
django: '>=4.2,<4.3'
- python-version: '3.11'
django: '>=4.2,<4.3'
- python-version: '3.11'
django: '>=4.1,<4.2'
- python-version: '3.7'
django: '>=3.2,<4.0'
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install coverage 'django${{ matrix.django }}' psycopg2cffi
- name: Execute tests with coverage
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
PGPASSWORD: postgres
run: |
psql -c 'create database bitoptions;' -U postgres -h $POSTGRES_HOST
coverage run --source=bitoptions testproject/manage.py test testapp
coverage lcov
coverage report
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
parallel: true

test_sqlite_3x:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']
python-version: ['3.7', '3.8', '3.9']
django: ['>=3.0,<3.1', '>=3.1,<3.2', '>=3.2,<4.0']
include:
- python-version: '3.10'
Expand All @@ -90,7 +141,7 @@ jobs:

generate-coverage-report:
runs-on: ubuntu-latest
needs: [test_sqlite_4x, test_sqlite_3x]
needs: [test_sqlite_4x, test_sqlite_3x, test_postgres_4x]
steps:
- name: Coveralls
uses: coverallsapp/github-action@v2
Expand Down

0 comments on commit 9f4197c

Please sign in to comment.