-
Notifications
You must be signed in to change notification settings - Fork 2
140 lines (136 loc) · 4.7 KB
/
test.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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: test
on: [push, pull_request]
jobs:
test:
name: Test
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.8, 3.9, "3.10"]
django-version: [django-2.2, django-3.0, django-3.1, django-3.2, django-4.0, django-4.1, django-4.2, django-pre, django-main]
include:
- python-version: 3.6
django-version: django-2.2
- python-version: 3.7
django-version: django-2.2
- python-version: 3.6
django-version: django-3.2
- python-version: 3.7
django-version: django-3.2
exclude:
- python-version: "3.10"
django-version: django-2.2
- python-version: "3.8"
django-version: django-main
- python-version: "3.9"
django-version: django-main
- python-version: "3.8"
django-version: django-pre
- python-version: "3.9"
django-version: django-pre
services:
# oracle:
# image: quay.io/maksymbilenko/oracle-12c
# ports:
# - 1521:1521
# options: --health-cmd "echo exit|sqlplus system/oracle@//localhost:1521/xe" --health-interval 10s --health-timeout 5s --health-retries 5
postgres:
image: postgres
env:
POSTGRES_USER: django_cool
POSTGRES_PASSWORD: django_cool
POSTGRES_DB: django_cool_test
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
mysql:
image: mysql
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_USER: django_cool
MYSQL_PASSWORD: django_cool
MYSQL_DATABASE: django_cool_test
ports:
- 3306:3306
options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Check Out
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# - name: Install oracle instantclient
# run: |
# mkdir -p /opt/oracle
# cd /opt/oracle
# wget -q https://download.oracle.com/otn_software/linux/instantclient/211000/instantclient-basic-linux.x64-21.1.0.0.0.zip
# unzip instantclient-basic-linux.x64-21.1.0.0.0.zip
- name: Install dependencies
run: |
sudo apt-get install gettext libaio1
python -m pip install --upgrade pip
pip install flake8 "isort>=5.1.0" pytest
pip install mysqlclient psycopg2 cx_Oracle
pip install pytz
- name: Install Django 2.2
run: |
pip install 'Django>=2.2,<3'
if: matrix.django-version == 'django-2.2'
- name: Install Django 3.0
run: |
pip install 'Django>=3.0,<3.1'
if: matrix.django-version == 'django-3.0'
- name: Install Django 3.1
run: |
pip install 'Django>=3.1,<3.2'
if: matrix.django-version == 'django-3.1'
- name: Install Django 3.2
run: |
pip install 'Django>=3.2,<4'
if: matrix.django-version == 'django-3.2'
- name: Install Django 4.0
run: |
pip install 'django>=4,<4.1'
if: matrix.django-version == 'django-4.0'
- name: Install Django 4.1
run: |
pip install 'django>=4.1,<4.2'
if: matrix.django-version == 'django-4.1'
- name: Install Django 4.2
run: |
pip install 'django>=4.2,<5'
if: matrix.django-version == 'django-4.2'
- name: Install Django pre
run: |
pip install 'django' --pre
if: matrix.django-version == 'django-pre'
- name: Install Django main
run: |
pip install 'https://github.com/django/django/archive/main.tar.gz'
if: matrix.django-version == 'django-main'
- name: Install djangorestframework
run: |
pip install djangorestframework
- name: Lint with flake8
run: |
flake8 cool tests
- name: Lint with isort
run: |
isort --check-only --diff cool tests
- name: Test with pytest sqlite
run: |
pytest --db sqlite
- name: Test with pytest postgresql
run: |
pytest --db postgresql
- name: Test with pytest mysql
run: |
pytest --db mysql
# - name: Test with pytest oracle
# run: |
# export LD_LIBRARY_PATH=/opt/oracle/instantclient_21_1:${LD_LIBRARY_PATH}
# echo ${LD_LIBRARY_PATH}
# pytest --db oracle