-
Notifications
You must be signed in to change notification settings - Fork 27
200 lines (186 loc) · 6.54 KB
/
django.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
name: Django CI
on: [push, pull_request]
jobs:
postgres:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
name: Postgres - Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }} (Allowed Failures - ${{ matrix.django-version == 'main' }} )
strategy:
max-parallel: 4
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
django-version: ['3.2.0', '4.0.0', '4.1.0', '4.2.0', 'main']
exclude:
- django-version: '4.0.0'
python-version: '3.7'
- django-version: '4.1.0'
python-version: '3.7'
- django-version: '4.2.0'
python-version: '3.8'
- django-version: '4.2.0'
python-version: '3.7'
- django-version: 'main'
python-version: '3.7'
- django-version: 'main'
python-version: '3.8'
- django-version: 'main'
python-version: '3.9'
- django-version: '3.2.0'
python-version: '3.11'
- django-version: '4.0.0'
python-version: '3.11'
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
continue-on-error: ${{ matrix.django-version == 'main' }}
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt
- name: 'Install psycopg2 for Django < 3.1'
# Django < 3.1 is incompatible with psycopg2 2.9
# See https://github.com/psycopg/psycopg2/issues/1293
if: "matrix.django-version == '2.2.0' || matrix.django-version == '3.0.0'"
run: |
pip install 'psycopg2<2.9'
- name: 'Install psycopg2'
if: "matrix.django-version != '2.2.0' && matrix.django-version != '3.0.0'"
run: |
pip install psycopg2
- name: Install Django Release
run: |
pip install django~=${{ matrix.django-version }}
if: matrix.django-version != 'main'
- name: Install Django Main
continue-on-error: ${{ matrix.django-version == 'main' }}
run: |
pip install 'https://github.com/django/django/archive/main.tar.gz'
if: matrix.django-version == 'main'
- name: Run Tests
continue-on-error: ${{ matrix.django-version == 'main' }}
env:
TESTDB: postgres
run: |
export PYTHONWARNINGS=always
coverage run --source='wafer' manage.py test --exclude-tag selenium && coverage report --skip-covered
sqlite:
runs-on: ubuntu-latest
name: SQLite - Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }} (Allowed Failures - ${{ matrix.django-version == 'main'}} )
strategy:
max-parallel: 4
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10','3.11']
django-version: ['3.2.0', '4.0.0', '4.1.0', '4.2.0', 'main']
exclude:
- django-version: '4.0.0'
python-version: '3.7'
- django-version: '4.1.0'
python-version: '3.7'
- django-version: '4.2.0'
python-version: '3.7'
- django-version: '4.2.0'
python-version: '3.8'
- django-version: 'main'
python-version: '3.7'
- django-version: 'main'
python-version: '3.8'
- django-version: 'main'
python-version: '3.9'
- django-version: '3.2.0'
python-version: '3.11'
- django-version: '4.0.0'
python-version: '3.11'
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
continue-on-error: ${{ matrix.django-version == 'main' }}
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt
- name: Install Django Release
run: |
pip install django~=${{ matrix.django-version }}
if: matrix.django-version != 'main'
- name: Install Django Main
continue-on-error: ${{ matrix.django-version == 'main' }}
run: |
pip install 'https://github.com/django/django/archive/main.tar.gz'
if: matrix.django-version == 'main'
- name: Run Tests
continue-on-error: ${{ matrix.django-version == 'main' }}
run: |
export PYTHONWARNINGS=always
coverage run --source='wafer' manage.py test --exclude-tag selenium && coverage report --skip-covered
translations:
runs-on: ubuntu-latest
name: Compile Translations
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt
- name: Install gettext
run: |
sudo apt-get -y install gettext
- name: Compile Translations
run: |
cd wafer
python ../manage.py compilemessages
selenium:
runs-on: ubuntu-latest
name: Selenium - Browser ${{ matrix.browser }}
strategy:
max-parallel: 2
matrix:
browser: ['chrome', 'firefox']
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt
pip install selenium
- name: Install node
uses: actions/setup-node@v4
- name: Install javascript dependencies
run: |
npm install
- name: Setup Chrome
uses: browser-actions/setup-chrome@v1
if: matrix.browser == 'chrome'
- name: Setup firefox
run: |
wget -O firefox.tar.bz2 'https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=en-US'
tar xaf firefox.tar.bz2
export PATH=$PATH:${PWD}/firefox
if: matrix.browser == 'firefox'
- name: Run Tests
run: |
python manage.py test --tag ${{ matrix.browser }}