-
Notifications
You must be signed in to change notification settings - Fork 2
206 lines (171 loc) · 4.64 KB
/
main.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
---
name: pysqlsync database integration tests
on:
workflow_dispatch:
defaults:
run:
shell: bash
env:
TEST_INTEGRATION: 1
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Fetch source code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Set up build dependencies
run: |
python -m pip install --upgrade pip
python -m pip --disable-pip-version-check install -r requirements-dev.txt
- name: Run sanity checks
run: |
./check.sh
- name: Build PyPI package
run: |
python -m build
- name: Save PyPI package as artifact
uses: actions/upload-artifact@v4
with:
name: pysqlsync-dist
path: dist/**
if-no-files-found: error
compression-level: 0
test-postgresql:
runs-on: ubuntu-latest
needs: build
services:
postgres:
image: postgres:15-alpine
env:
POSTGRES_PORT: 5432
POSTGRES_USER: levente.hunyadi
POSTGRES_PASSWORD: "<?YourStrong@Passw0rd>"
POSTGRES_DB: levente.hunyadi
ports:
- 5432:5432
# set health checks to wait until PostgreSQL has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
--health-start-period 10s
env:
TEST_POSTGRESQL: 1
strategy:
matrix:
python-version: ["3.9", "3.12"]
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
- name: Test PyPI package
uses: ./.github/actions/test
with:
python-version: ${{ matrix.python-version }}
options-extras: postgresql
test-oracle:
runs-on: ubuntu-latest
needs: build
services:
oracle:
image: container-registry.oracle.com/database/free:latest
env:
ORACLE_PWD: "<?YourStrong@Passw0rd>"
ports:
- 1521:1521
# set health checks to wait until Oracle has started
options: >-
--health-interval 20s
--health-timeout 10s
--health-retries 10
--health-start-period 30s
env:
TEST_ORACLE: 1
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
- name: Test PyPI package
uses: ./.github/actions/test
with:
python-version: ${{ matrix.python-version }}
options-extras: oracle
test-mysql:
runs-on: ubuntu-latest
needs: build
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: "<?YourStrong@Passw0rd>"
MYSQL_DATABASE: levente_hunyadi
ports:
- 3306:3306
# set health checks to wait until MySQL has started
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
--health-start-period 10s
env:
TEST_MYSQL: 1
strategy:
matrix:
python-version: ["3.9", "3.12"]
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
- name: Test PyPI package
uses: ./.github/actions/test
with:
python-version: ${{ matrix.python-version }}
options-extras: mysql
test-mssql:
runs-on: ubuntu-latest
needs: build
services:
mssql:
image: mcr.microsoft.com/mssql/server:2022-latest
env:
ACCEPT_EULA: Y
MSSQL_SA_PASSWORD: "<?YourStrong@Passw0rd>"
SQLCMDPASSWORD: "<?YourStrong@Passw0rd>"
ports:
- 1433:1433
# set health checks to wait until Microsoft SQL Server has started
options: >-
--health-cmd "/opt/mssql-tools18/bin/sqlcmd -S localhost -N -C -U sa -Q 'SELECT @@VERSION' -b"
--health-interval 10s
--health-timeout 5s
--health-retries 5
--health-start-period 10s
env:
TEST_MSSQL: 1
strategy:
matrix:
python-version: ["3.12"]
steps:
- name: Install Microsoft ODBC
run: sudo ACCEPT_EULA=Y apt-get install msodbcsql18 -y
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
- name: Test PyPI package
uses: ./.github/actions/test
with:
python-version: ${{ matrix.python-version }}
options-extras: mssql