feat: Add Django 4.2 support, but not later, to avoid non-LTS #261
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10"] | |
django-version: | |
- "Django>=2.2,<2.3" | |
- "Django>=3.0,<3.1" | |
- "Django>=3.1,<3.2" | |
- "Django>=3.2,<3.3" | |
- "Django>=4.2,<4.3" | |
exclude: | |
# Django 4.2 drops Python 3.7 support | |
- python-version: "3.7" | |
django-version: "Django>=4.2,<4.3" | |
# Django 3.1+ supports Python 3.9. | |
# https://docs.djangoproject.com/en/3.1/releases/3.1.3/ | |
- python-version: "3.9" | |
django-version: "Django>=2.2,<2.3" | |
- python-version: "3.9" | |
django-version: "Django>=3.0,<3.1" | |
# Django 3.2+ supports Python 3.10. | |
# https://docs.djangoproject.com/en/3.2/releases/3.2/ | |
- python-version: "3.10" | |
django-version: "Django>=2.2,<2.3" | |
- python-version: "3.10" | |
django-version: "Django>=3.0,<3.1" | |
- python-version: "3.10" | |
django-version: "Django>=3.1,<3.2" | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
- uses: actions/cache@v1 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements_dev.txt') }}-${{ matrix.python-version }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- run: "pip install --upgrade pip" | |
- run: "pip install --upgrade -e .[test]" | |
- run: "pip install '${{ matrix.django-version }}'" | |
- run: "py.test -n 2 cove --cov" | |
env: | |
PYTHONWARNINGS: error | |
DJANGO_SETTINGS_MODULE: cove.settings | |
SECRET_KEY: 7ur)dt+e%1^e6$8_sd-@1h67_5zixe2&39%r2$$8_7v6fr_7ee | |
if: ${{ matrix.django-version != 'Django>=4.2,<4.3' }} | |
- run: "py.test -n 2 cove --cov" | |
env: | |
DJANGO_SETTINGS_MODULE: cove.settings | |
SECRET_KEY: 7ur)dt+e%1^e6$8_sd-@1h67_5zixe2&39%r2$$8_7v6fr_7ee | |
if: ${{ matrix.django-version == 'Django>=4.2,<4.3' }} | |
- run: "sudo apt-get update" | |
- run: "sudo apt-get install gettext" | |
# Check that changes to .po files have been compiled | |
- run: "python manage.py compilemessages" | |
- run: "git diff --exit-code" | |
# Install translate toolkit to get pocount binary | |
- run: "sudo apt-get install translate-toolkit" | |
# Check that strings have Spanish translation (for cove-ocds) | |
- run: "python manage.py makemessages -l es" | |
- run: "[ \"`pocount --incomplete cove/locale/es/LC_MESSAGES/django.po`\" = \"\" ]" | |
if: github.event_name == 'pull_request' |