Skip to content

Commit

Permalink
Simplify CI setup with tox-gh
Browse files Browse the repository at this point in the history
  • Loading branch information
laymonage committed Jul 14, 2023
1 parent 10208d0 commit 13ec8c6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 39 deletions.
46 changes: 12 additions & 34 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,7 @@ jobs:
needs: lint
strategy:
matrix:
python: ['3.8', '3.9', '3.10']
django: ['3.2']
wagtail: ['5.0', 'main']
include:
- python: '3.7'
django: '3.2'
wagtail: '5.0'
- python: '3.10'
django: '4.1'
wagtail: '5.0'
- python: '3.11'
django: '4.2'
wagtail: 'main'
python: ['3.7', '3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v3
Expand All @@ -58,32 +46,22 @@ jobs:
- name: Install Tox
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade tox
- name: Test
run: |
tox
env:
TOXENV: python${{ matrix.python }}-django${{ matrix.django }}-wagtail${{ matrix.wagtail }}-sqlite
python -m pip install --upgrade tox-gh
- name: Setup test suite
run: tox -vv --notest
- name: Run test suite
run: tox --skip-pkg-install

test-postgres:
runs-on: ubuntu-latest
needs: lint
strategy:
matrix:
python: ['3.8', '3.9', '3.10']
django: ['3.2']
wagtail: ['5.0', 'main']
python: ['3.7', '3.8', '3.9']
include:
- python: '3.7'
django: '3.2'
wagtail: '5.0'
- python: '3.10'
django: '4.1'
wagtail: '5.0'
postgres: '12'
- python: '3.11'
django: '4.2'
wagtail: 'main'
postgres: '13'

services:
Expand All @@ -104,10 +82,10 @@ jobs:
- name: Install Tox
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade tox
- name: Test
run: |
tox
python -m pip install --upgrade tox-gh
- name: Setup test suite
run: tox -vv --notest
- name: Run test suite
run: tox --skip-pkg-install
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/wagtail_modeladmin
TOXENV: python${{ matrix.python }}-django${{ matrix.django }}-wagtail${{ matrix.wagtail }}-postgres
17 changes: 12 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@ skipsdist = True
usedevelop = True

envlist =
python3.7-django3.2-wagtail5.0-{sqlite,postgres}
python{3.8,3.9,3.10}-django{3.2}-wagtail{5.0,main}-{sqlite,postgres}
python3.10-django4.1-wagtail5.0-{sqlite,postgres}
python3.11-django4.2-wagtailmain-{sqlite,postgres}
python3.7-django3.2-wagtail5.0
python{3.8,3.9,3.10}-django{3.2,4.1,.4.2}-wagtail{5.0,main}
python3.11-django4.2-wagtail{5.0,main}

[gh]
python =
3.7 = python3.7-django3.2-wagtail5.0
3.8 = python3.8-django{3.2,4.1,.4.2}-wagtail{5.0,main}
3.9 = python3.9-django{3.2,4.1,.4.2}-wagtail{5.0,main}
3.10 = python3.10-django{3.2,4.1,.4.2}-wagtail{5.0,main}
3.11 = python3.11-django4.2-wagtail{5.0,main}

[testenv]
install_command = pip install -e ".[testing]" -U {opts} {packages}
Expand All @@ -27,7 +34,7 @@ deps =
django4.2: Django>=4.2,<4.3
djangomain: git+https://github.com/django/django.git@main#egg=Django

wagtail5.0: wagtail>=5.0,<5.2
wagtail5.0: wagtail>=5.0,<5.1
wagtailmain: git+https://github.com/wagtail/wagtail.git

postgres: psycopg2>=2.6
Expand Down

0 comments on commit 13ec8c6

Please sign in to comment.