-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (72 loc) · 2.89 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- 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'