Skip to content

Commit

Permalink
Add Python 3.12, Django 4.2 to CI (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
kytta committed Jun 27, 2023
2 parents ecdaa2e + 499311a commit 921e42a
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 34 deletions.
69 changes: 40 additions & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Test

on: [push, pull_request]
on:
push:
branches: [master]
tags: ["*"]
pull_request:
branches: [master]

jobs:
build:
Expand All @@ -9,32 +14,50 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
django-version: ['3.2', '4.0', '4.1', 'main']
exclude:
# https://docs.djangoproject.com/faq/install/#what-python-version-can-i-use-with-django
include:
- django-version: '3.2'
python-version: '3.11'
python-version: '3.6'
- django-version: '3.2'
python-version: '3.7'
- django-version: '3.2'
python-version: '3.8'
- django-version: '3.2'
python-version: '3.9'
- django-version: '3.2'
python-version: '3.10'

- django-version: '4.0'
python-version: '3.6'
python-version: '3.8'
- django-version: '4.0'
python-version: '3.7'
python-version: '3.9'
- django-version: '4.0'
python-version: '3.11'
python-version: '3.10'

- django-version: '4.1'
python-version: '3.6'
python-version: '3.8'
- django-version: '4.1'
python-version: '3.7'
python-version: '3.9'
- django-version: '4.1'
python-version: '3.10'
- django-version: '4.1'
python-version: '3.11'

- django-version: '4.2'
python-version: '3.8'
- django-version: '4.2'
python-version: '3.9'
- django-version: '4.2'
python-version: '3.10'
- django-version: '4.2'
python-version: '3.11'

- django-version: 'main'
python-version: '3.6'
python-version: '3.10'
- django-version: 'main'
python-version: '3.7'
- django-version: 'main'
python-version: '3.8'
python-version: '3.11'
- django-version: 'main'
python-version: '3.9'
python-version: '3.12'

steps:
- uses: actions/checkout@v3
Expand All @@ -43,20 +66,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Get pip cache dir
id: pip-cache
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Cache
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
restore-keys: |
${{ matrix.python-version }}-v1-
allow-prereleases: true
cache: pip

- name: Install dependencies
run: |
Expand Down
15 changes: 10 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[tox]
usedevelop = true
; https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django
envlist =
py{36,37,38,39,310}-dj32
py{38,39,310}-dj40
py{38,39,310,311}-dj41
py{310,311}-djmain
py3{6,7,8,9,10}-dj32
py3{8,9,10}-dj40
py3{8,9,10,11}-dj41
py3{8,9,10,11}-dj42
py3{10,11,12}-djmain

[gh-actions]
python =
Expand All @@ -14,12 +16,14 @@ python =
3.9: py39
3.10: py310
3.11: py311
3.12: py312

[gh-actions:env]
DJANGO =
3.2: dj32
4.0: dj40
4.1: dj41
4.2: dj42
main: djmain

[testenv]
Expand All @@ -28,7 +32,8 @@ deps =
coverage
dj32: Django~=3.2.16
dj40: Django~=4.0.8
dj41: Django~=4.1.2
dj41: Django~=4.1.3
dj42: Django~=4.2.1
djmain: https://github.com/django/django/tarball/main
setenv =
DJANGO_SETTINGS_MODULE=simple_menu.test_settings
Expand Down

0 comments on commit 921e42a

Please sign in to comment.