Skip to content

Commit

Permalink
Tidy up tox and GHA config
Browse files Browse the repository at this point in the history
  • Loading branch information
zerolab committed Feb 15, 2024
1 parent 6df3dc6 commit 8f8a40b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 27 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ jobs:

- name: ⬇️ Install build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flit
python -m flit install --symlink
python -m pip install --upgrade pip flit
- name: 🏗️ Build
run: python -Im flit build
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches: [main]
pull_request:
branches: [main]

concurrency:
group: ${{ github.head_ref || github.run_id }}
Expand Down Expand Up @@ -52,11 +53,13 @@ jobs:
- name: ⬇️ Install dependencies
run: |
python -Im pip install --upgrade pip setuptools wheel
python -Im pip install --upgrade tox tox-gh-actions
python -Im pip install --upgrade pip setuptools wheel flit tox tox-gh-actions
- name: 🏗️ Build wheel
run: python -Im flit build --format wheel

- name: 🧪 Run tox targets for Python ${{ matrix.python-version }}
run: tox
run: tox --installpkg ./dist/*.whl

- name: ⬆️ Upload coverage data
uses: actions/upload-artifact@v3
Expand All @@ -72,8 +75,6 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
# Use latest Python, so it understands all syntax.
Expand Down
40 changes: 21 additions & 19 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
[tox]
min_version = 4.0
min_version = 4.11

env_list =
py{38,39,310}-django{3.2,4.1}-wagtail{4.1,5.0,5.1,5.2}
py{311}-django{4.1}-wagtail{4.1,5.0,5.1,5.2}
py{311}-django{4.2}-wagtail{5.0,5.1,5.2}
py{311,312}-django{5.0}-wagtail{5.2}
python{3.8,3.9,3.10}-dj{32}-wagtail{41,52}
python{3.11}-dj{41,42}-wagtail{52,60}
python{3.12}-dj{42,50}-wagtail{52,60}

[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312
3.8: python3.8
3.9: python3.9
3.10: python3.10
3.11: python3.11
3.12: python3.12

[testenv]
package = wheel
wheel_build_env = .pkg
use_frozen_constraints = true
constrain_package_deps = true

pass_env =
FORCE_COLOR
NO_COLOR
Expand All @@ -29,31 +33,29 @@ extras = testing

deps =
django3.2: Django>=3.2, <4.0
django4.1: Django>=4.1, <4.2
django4.2: Django>=4.2, <5.0
django5.0: Django>=5.0, <5.1

wagtail4.1: wagtail>=4.1, <4.2
wagtail5.0: wagtail>=5.0, <5.1
wagtail5.1: wagtail>=5.1, <5.2
wagtail5.2: wagtail>=5.2rc1, <5.3
wagtail41: wagtail>=4.1,<4.2
wagtail5.2: wagtail>=5.2, <6.0
wagtail6.0: wagtail>=6.0, <6.1

install_command = python -Im pip install -U {opts} {packages}
commands =
python -Im coverage run runtests.py test --deprecation all {posargs: -v 2}

[testenv:coverage-report]
base_python = python3.11
; a bit of a hack - we want to keep deps to a minimum here
package = skip
deps =
extras =
install_command = python -Im pip install -U "coverage[toml]>=7.0,<8.0"
coverage>=7.0,<8.0
commands =
python -Im coverage combine
python -Im coverage report -m

[testenv:wagtailmain]
description = Test with latest Wagtail main branch

base_python = python3.12
deps =
wagtailmain: git+https://github.com/wagtail/wagtail.git@main#egg=Wagtail

Expand Down

0 comments on commit 8f8a40b

Please sign in to comment.