forked from ellmetha/django-machina
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (80 loc) · 2.23 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
74
75
76
77
78
79
80
81
82
83
84
85
86
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_ROOT_PASSWORD: ""
MYSQL_DATABASE: machina_test
ports:
- 3307:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
postgres:
image: postgres:12
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: machina_test
ports:
- 5432:5432
# Needed because the postgres container does not provide a healthcheck
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
fail-fast: false
matrix:
python-version: [
3.7,
3.8,
3.9,
'3.10',
'3.11',
]
django-version: [
"django>=3.2,<4.0",
"django>=4.0,<4.1",
"django>=4.1,<4.2",
"django>=4.2,<5.0",
]
db: [
'mysql',
'postgres',
'sqlite',
]
exclude:
- python-version: 3.7
django-version: "django>=4.0,<4.1"
- python-version: 3.7
django-version: "django>=4.1,<4.2"
- python-version: 3.7
django-version: "django>=4.2,<5.0"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Start MySQL if applicable
if: matrix.db == 'mysql'
run: |
sudo /etc/init.d/mysql start
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U pip poetry
poetry install
poetry run pip install psycopg2 mysqlclient
poetry run pip install --pre -U "${{ matrix.django-version }}" "git+https://github.com/django-haystack/django-haystack.git"
- name: Run QA checks
run: make qa
- name: Run tests suite
run: poetry run pytest
env:
DB: ${{ matrix.db }}