-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
234 lines (228 loc) · 7.93 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
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# Python unit tests
name: Python
on:
push:
branches: ['master']
pull_request:
branches: ['master']
jobs:
lint:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [3.8]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libldap2-dev libsasl2-dev libssl-dev
pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: black
run: black --check setup.py flask_appbuilder
- name: flake8
run: flake8 flask_appbuilder
- name: mypy
run: mypy flask_appbuilder
- name: black
run: black --check tests
- name: flake8
run: flake8 tests
test-postgres:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9"]
env:
SQLALCHEMY_DATABASE_URI:
postgresql+psycopg2://pguser:pguserpassword@127.0.0.1:15432/app
services:
postgres:
image: postgres:14-alpine
env:
POSTGRES_USER: pguser
POSTGRES_PASSWORD: pguserpassword
POSTGRES_DB: app
ports:
- 15432:5432
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run openldap
run: |
docker run -d \
-v '${{ github.workspace }}/docker/openldap/ldifs:/ldifs' \
-v '${{ github.workspace }}/docker/openldap/schemas/memberof.ldif:/opt/bitnami/openldap/etc/schema/memberof.ldif' \
-e LDAP_URI=ldap://openldap:1389 \
-e LDAP_BASE=dc=example,dc=org \
-e LDAP_ADMIN_USERNAME=admin \
-e LDAP_ADMIN_PASSWORD=admin_password \
-e LDAP_EXTRA_SCHEMAS=cosine,inetorgperson,nis,memberof \
-p 1389:1389 \
bitnami/openldap:2.6.4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libldap2-dev libsasl2-dev libssl-dev
pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install -r requirements-extra.txt
- name: Run tests
run: |
nosetests --stop -v --with-coverage --cover-package=flask_appbuilder tests --ignore-files="test_mongoengine\.py"
- name: Upload code coverage
run: |
bash <(curl -s https://codecov.io/bash) -cF python
test-mysql:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [3.8]
env:
SQLALCHEMY_DATABASE_URI: |
mysql+mysqldb://mysqluser:mysqluserpassword@127.0.0.1:13306/app?charset=utf8mb4&binary_prefix=true
services:
mysql:
image: mysql:5.7
env:
MYSQL_USER: mysqluser
MYSQL_PASSWORD: mysqluserpassword
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: app
ports:
- 13306:3306
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run openldap
run: |
docker run -d \
-v '${{ github.workspace }}/docker/openldap/ldifs:/ldifs' \
-v '${{ github.workspace }}/docker/openldap/schemas/memberof.ldif:/opt/bitnami/openldap/etc/schema/memberof.ldif' \
-e LDAP_URI=ldap://openldap:1389 \
-e LDAP_BASE=dc=example,dc=org \
-e LDAP_ADMIN_USERNAME=admin \
-e LDAP_ADMIN_PASSWORD=admin_password \
-e LDAP_EXTRA_SCHEMAS=cosine,inetorgperson,nis,memberof \
-p 1389:1389 \
bitnami/openldap:2.6.4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libldap2-dev libsasl2-dev libssl-dev
pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install -r requirements-extra.txt
- name: Run tests
run: |
nosetests --stop -v --with-coverage --cover-package=flask_appbuilder tests --ignore-files="test_mongoengine\.py"
- name: Upload code coverage
run: |
bash <(curl -s https://codecov.io/bash) -cF python
test-mssql:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [3.8]
env:
SQLALCHEMY_DATABASE_URI: |
mssql+pyodbc://sa:Password_123@localhost:11433/master?driver=FreeTDS
services:
mssql:
image: mcr.microsoft.com/mssql/server:2017-CU8-ubuntu
env:
SA_PASSWORD: Password_123
ACCEPT_EULA: Y
ports:
- 11433:1433
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run openldap
run: |
docker run -d \
-v '${{ github.workspace }}/docker/openldap/ldifs:/ldifs' \
-v '${{ github.workspace }}/docker/openldap/schemas/memberof.ldif:/opt/bitnami/openldap/etc/schema/memberof.ldif' \
-e LDAP_URI=ldap://openldap:1389 \
-e LDAP_BASE=dc=example,dc=org \
-e LDAP_ADMIN_USERNAME=admin \
-e LDAP_ADMIN_PASSWORD=admin_password \
-e LDAP_EXTRA_SCHEMAS=cosine,inetorgperson,nis,memberof \
-p 1389:1389 \
bitnami/openldap:2.6.4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libldap2-dev libsasl2-dev libssl-dev freetds-bin unixodbc-dev tdsodbc
pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install -r requirements-extra.txt
sudo cp .github/workflows/odbcinst.ini /etc/odbcinst.ini
- name: Run tests
run: |
nosetests --stop -v --with-coverage --cover-package=flask_appbuilder tests --ignore-files="test_mongoengine\.py"
- name: Upload code coverage
run: |
bash <(curl -s https://codecov.io/bash) -cF python
test-mongodb:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [3.7]
services:
mongo:
image: mongo:4.4.1-bionic
ports:
- 27017:27017
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run openldap
run: |
docker run -d \
-v '${{ github.workspace }}/docker/openldap/ldifs:/ldifs' \
-v '${{ github.workspace }}/docker/openldap/schemas/memberof.ldif:/opt/bitnami/openldap/etc/schema/memberof.ldif' \
-e LDAP_URI=ldap://openldap:1389 \
-e LDAP_BASE=dc=example,dc=org \
-e LDAP_ADMIN_USERNAME=admin \
-e LDAP_ADMIN_PASSWORD=admin_password \
-e LDAP_EXTRA_SCHEMAS=cosine,inetorgperson,nis,memberof \
-p 1389:1389 \
bitnami/openldap:2.6.4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libldap2-dev libsasl2-dev libssl-dev
pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install -r requirements-extra.txt
pip install -r requirements-mongodb.txt
- name: Run tests
run: |
nosetests --stop -v --with-coverage --cover-package=flask_appbuilder tests/test_mongoengine.py
- name: Upload code coverage
run: |
bash <(curl -s https://codecov.io/bash) -cF python