Skip to content

Commit

Permalink
Added databases to test matrix.
Browse files Browse the repository at this point in the history
  • Loading branch information
alanverresen committed Dec 7, 2023
1 parent 97917c6 commit af56fa5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,27 @@ on:

jobs:
tests:
name: run tests for python ${{ matrix.python }}, django ${{ matrix.django }}
name: run tests for python ${{ matrix.python }}, django ${{ matrix.django }}, ${{ matrix.database }}
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_DB: "test"
POSTGRES_USER: "test"
POSTGRES_PASSWORD: "test"
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
strategy:
matrix:
python: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
django: [ "3.2", "4.1", "4.2" ]
database: [ "sqlite", "postgres" ]
exclude:
- python: "3.11"
django: "3.2"
Expand All @@ -31,7 +46,7 @@ jobs:
- name: install tox
run: python3 -m pip install tox tox-gh
- name: run tests
run: tox -e py${{ matrix.python }}-django${{ matrix.django }}
run: tox -e py${{ matrix.python }}-django${{ matrix.django }}-${{ matrix.database }}

lint:
name: check for any style errors
Expand Down
6 changes: 4 additions & 2 deletions markupfield/tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
"default": {
"ENGINE": "django.db.backends.postgresql_psycopg2",
"NAME": "test",
"USER": "postgres",
"PASSWORD": "",
"USER": "test",
"PASSWORD": "test",
"HOST": "127.0.0.1",
"PORT": "5432",
}
}
else:
Expand Down
9 changes: 6 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ envlist =
; python releases: https://www.python.org/downloads/
; django releases: https://www.djangoproject.com/download/
; python+django support: https://docs.djangoproject.com/en/dev/faq/install/
py{38,39,310}-django3.2,
py{38,39,310,311}-django4.1,
py{38,39,310,311,312}-django4.2,
py{38,39,310}-django3.2-{sqlite,postgres},
py{38,39,310,311}-django4.1-{sqlite,postgres},
py{38,39,310,311,312}-django4.2-{sqlite,postgres},
flake8

[testenv:flake8]
Expand All @@ -25,6 +25,9 @@ deps =
docutils
psycopg2-binary
pip_pre = True
setenv =
postgres: DB = postgres
sqlite: DB = sqlite

[flake8]
max-line-length=99
Expand Down

0 comments on commit af56fa5

Please sign in to comment.