Skip to content

Commit

Permalink
clean up build matrix with tox-gh-actions (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
chris48s authored Oct 13, 2023
1 parent ac5d598 commit 31a63d5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 34 deletions.
43 changes: 9 additions & 34 deletions {{ cookiecutter.__project_name_kebab }}/.github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,52 +34,28 @@ jobs:
strategy:
matrix:
python: ['3.8', '3.9', '3.10', '3.11']
django: ['3.2', '4.0', '4.1', '4.2']
wagtail: ['4.1', '4.2', '5.0', '5.1']
exclude:
- django: '4.0'
wagtail: '5.0'
- django: '4.0'
wagtail: '5.1'
- django: '4.2'
wagtail: '4.1'
- django: '4.2'
wagtail: '4.2'

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install Tox
- name: Install
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade tox
python -m pip install .[ci]
- name: Test
run: |
tox
run: tox
env:
TOXENV: python${{ matrix.python }}-django${{ matrix.django }}-wagtail${{ matrix.wagtail }}-sqlite
DB: sqlite

test-postgres:
runs-on: ubuntu-latest
needs: lint
strategy:
matrix:
python: ['3.8', '3.9', '3.10', '3.11']
django: ['3.2', '4.0', '4.1', '4.2']
wagtail: ['4.1', '4.2', '5.0', '5.1']
experimental: [false]
exclude:
- django: '4.0'
wagtail: '5.0'
- django: '4.0'
wagtail: '5.1'
- django: '4.2'
wagtail: '4.1'
- django: '4.2'
wagtail: '4.2'

services:
postgres:
Expand All @@ -96,13 +72,12 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install Tox
- name: Install
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade tox
python -m pip install .[ci]
- name: Test
run: |
tox
run: tox
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/{% endraw %}{{ cookiecutter.__project_name_snake }}{% raw %}
TOXENV: python${{ matrix.python }}-django${{ matrix.django }}-wagtail${{ matrix.wagtail }}-postgres{% endraw %}
DATABASE_URL: postgres://postgres:postgres@localhost:5432/{% endraw %}{{ cookiecutter.__project_name_snake }}
DB: postgres
4 changes: 4 additions & 0 deletions {{ cookiecutter.__project_name_kebab }}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ testing = [
"dj-database-url==2.1.0",
"pre-commit==3.4.0"
]
ci = [
"tox==4.11.3",
"tox-gh-actions==3.1.3"
]

[project.urls]
Home = "https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.__project_name_kebab }}"
Expand Down
12 changes: 12 additions & 0 deletions {{ cookiecutter.__project_name_kebab }}/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ envlist =
python{3.8,3.9,3.10,3.11}-django{3.2,4.0,4.1}-wagtail{4.1,4.2}-{sqlite,postgres}
python{3.8,3.9,3.10,3.11}-django{3.2,4.1,4.2}-wagtail{5.0,5.1,main}-{sqlite,postgres}

[gh-actions]
python =
3.8: python3.8
3.9: python3.9
3.10: python3.10
3.11: python3.11

[gh-actions:env]
DB =
sqlite: sqlite
postgres: postgres

[testenv]
install_command = pip install -e ".[testing]" -U {opts} {packages}
commands = coverage run testmanage.py test --deprecation all {posargs: -v 2}
Expand Down

0 comments on commit 31a63d5

Please sign in to comment.