Skip to content

pypi: Automatic Releases #400

pypi: Automatic Releases

pypi: Automatic Releases #400

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["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 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' }}
# Don't set PYTHONWARNING for Django 4.2, as that has some known
# deprecation warnings for 5.0
- 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' }}
- name: Check existing migrations can run and no migrations are missing
env:
DJANGO_SETTINGS_MODULE: cove.settings
DATABASE_URL: postgresql://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/postgres
shell: bash
run: |
./manage.py migrate
./manage.py makemigrations --check --dry-run
./manage.py check --fail-level WARNING
- 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'