-
Notifications
You must be signed in to change notification settings - Fork 321
79 lines (79 loc) · 2.37 KB
/
test.yaml
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
name: Tests
on: [push, pull_request]
jobs:
test:
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest']
python-version:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
tox_env: ['sqlalchemy14', 'sqlalchemy2']
include:
# Test against Python 3.9 and sqlalchemy 1.3
- os: 'ubuntu-20.04'
python-version: '3.9'
tox_env: 'sqlalchemy13'
# Test against Python 3.9 and sqlalchemy 1.4
- os: 'ubuntu-20.04'
python-version: '3.9'
tox_env: 'sqlalchemy14'
runs-on: ${{ matrix.os }}
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: sqlalchemy_utils_test
# Set health checks to wait until PostgreSQL has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
mysql:
image: mysql:latest
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: sqlalchemy_utils_test
ports:
- 3306:3306
mssql:
image: mcr.microsoft.com/mssql/server:2017-latest
env:
ACCEPT_EULA: Y
SA_PASSWORD: Strong_Passw0rd
# Set health checks to wait until SQL Server has started
options: >-
--health-cmd "/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P ${SA_PASSWORD} -Q 'SELECT 1;' -b"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 1433:1433
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install MS SQL stuff
run: bash .ci/install_mssql.sh
- name: Add hstore extension to the sqlalchemy_utils_test database
env:
PGHOST: localhost
PGPASSWORD: postgres
PGPORT: 5432
run: psql -U postgres -d sqlalchemy_utils_test -c 'CREATE EXTENSION hstore;'
- name: Install tox
run: pip install tox
- name: Run tests
env:
SQLALCHEMY_UTILS_TEST_POSTGRESQL_PASSWORD: postgres
run: tox -e ${{ matrix.tox_env }}