-
Notifications
You must be signed in to change notification settings - Fork 85
253 lines (248 loc) · 9.43 KB
/
conda.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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
name: Build and test with conda
on:
push:
pull_request:
schedule:
- cron: '47 6 * * *'
# Automatically stop old builds on the same branch/PR
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -ex {0}
jobs:
linux-release:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Set up pixi
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659
with:
environments: default
- name: Build the sdist
run: pixi run python -m build --sdist --no-isolation
- name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && github.repository == 'blue-yonder/turbodbc'
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_UPLOAD }}
packages_dir: dist
linux-unit-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
environment:
# - "py310-pa14"
# - "py311-pa14"
- "py312-pa14"
# - "py310-pa15"
# - "py311-pa15"
# - "py312-pa15"
# - "py310-pa16"
# - "py311-pa16"
# - "py312-pa16"
- "py310-pa17"
# - "py311-pa17"
# - "py312-pa17"
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Set up pixi
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659
with:
environments: ${{ matrix.environment }}
- name: Build the wheel
run: pixi run -e ${{ matrix.environment }} meson setup -Dbuild_testing=true builddir .
- name: Build the wheel
run: pixi run -e ${{ matrix.environment }} ninja -C builddir
- name: Build the wheel
run: pixi run -e ${{ matrix.environment }} ninja -C builddir test
linux-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
environment:
- "py310-pa14"
# - "py311-pa14"
# - "py312-pa14"
# - "py310-pa15"
- "py311-pa15"
# - "py312-pa15"
# - "py310-pa16"
# - "py311-pa16"
- "py312-pa16"
# - "py310-pa17"
# - "py311-pa17"
- "py312-pa17"
services:
postgres:
image: postgres:11
options: "--hostname postgres"
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: password
POSTGRES_USER: postgres
POSTGRES_DB: test_db
mysql:
# test do not run with a newer mysql at the moment
image: mysql:8.3
# command: --default-authentication-plugin=mysql_native_password
env:
MYSQL_ROOT_PASSWORD: StrongPassword1
MYSQL_USER: mysqluser
MYSQL_PASSWORD: password
MYSQL_DATABASE: test_db
ports:
- 3306:3306
mssql:
image: mcr.microsoft.com/mssql/server:2019-latest
env:
ACCEPT_EULA: Y
SA_PASSWORD: StrongPassword1
MSSQL_SA_PASSWORD: StrongPassword1
ports:
- 1433:1433
options: >-
--health-cmd "/opt/mssql-tools18/bin/sqlcmd -C -U sa -P \"${MSSQL_SA_PASSWORD}\" -Q \"SELECT 1\""
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Fetch full git history
run: git fetch --prune --unshallow
- name: Install MS SQL Drivers
run: |
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
wget -q https://packages.microsoft.com/config/debian/9/prod.list -O- | sudo tee -a /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
ACCEPT_EULA=Y sudo apt-get install msodbcsql17 mssql-tools
ls -l /opt/microsoft/msodbcsql17/lib64/
sudo odbcinst -i -d -f /opt/microsoft/msodbcsql17/etc/odbcinst.ini
/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'StrongPassword1' -Q 'CREATE DATABASE test_db' -l 60
- name: Set up pixi
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659
with:
environments: ${{ matrix.environment }}
- name: pip list
run: pixi run -e ${{ matrix.environment }} python -m pip list
- name: pip list
run: pixi run -e ${{ matrix.environment }} python -m pip check
- name: Build the wheel
run: pixi run -e ${{ matrix.environment }} python -m build --no-isolation --wheel --verbose
- name: Install the built wheel
run: pixi run -e ${{ matrix.environment }} python -m pip install dist/*.whl
- name: Import test
run: pixi run -e ${{ matrix.environment }} python -c 'import turbodbc'
- name: Prepare ODBC
run: pixi run -e ${{ matrix.environment }} bash -c 'sed -i "s;CONDA_PREFIX;${CONDA_PREFIX};g" odbc_test_linux/odbcinst.ini'
- name: Build and test
run: ODBCSYSINI=$(pwd)/odbc_test_linux pixi run -e ${{ matrix.environment }} pytest
env:
# TURBODBC_TEST_CONFIGURATION_FILES: "tests/query_fixtures_postgresql.json,tests/query_fixtures_mysql.json,tests/query_fixtures_mssql.json"
TURBODBC_TEST_CONFIGURATION_FILES: "tests/query_fixtures_postgresql.json,tests/query_fixtures_mssql.json"
macos-tests:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
environment:
- "py310-pa14"
#- "py311-pa14"
#- "py312-pa14"
- "py310-pa15"
#- "py311-pa15"
#- "py312-pa15"
#- "py310-pa16"
- "py311-pa16"
#- "py312-pa16"
#- "py310-pa17"
#- "py311-pa17"
- "py312-pa17"
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Fetch full git history
run: git fetch --prune --unshallow
- name: Set up pixi
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659
with:
environments: ${{ matrix.environment }}
- name: Create postgres test_db
run: pixi run -e ${{ matrix.environment }} bash -c 'initdb -D test_db --username="runner" --pwfile=<(printf "%s\n" "password")'
- name: Start postgres
run: pixi run -e ${{ matrix.environment }} pg_ctl -D test_db -l logfile start
- name: Create inner database
run: pixi run -e ${{ matrix.environment }} createdb --owner=runner test_db
- name: Build the wheel
run: pixi run -e ${{ matrix.environment }} bash -c 'CXXFLAGS="$CXXFLAGS -ggdb -fno-omit-frame-pointer" python -m build --no-isolation'
- name: Install the built wheel
run: pixi run -e ${{ matrix.environment }} python -m pip install dist/*.whl
- name: Import test
run: pixi run -e ${{ matrix.environment }} python -c 'import turbodbc'
- name: Prepare ODBC
run: pixi run -e ${{ matrix.environment }} bash -c 'sed -i "s;CONDA_PREFIX;${CONDA_PREFIX};g" odbc_test_osx/odbcinst.ini'
- name: Build and test
env:
TURBODBC_TEST_CONFIGURATION_FILES: "tests/query_fixtures_postgresql.json"
run: pixi run -e ${{ matrix.environment }} bash -c 'ulimit -c unlimited && ODBCSYSINI=$(pwd)/odbc_test_osx pytest -sv || (lldb -o "target create python --core $(ls /cores/core*)" -o "bt all" -o "quit"; exit 1)'
windows-pixi-tests:
defaults:
run:
shell: cmd /C call {0}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
environment:
- "py310-pa14"
# - "py311-pa14"
# - "py312-pa14"
# - "py310-pa15"
- "py311-pa15"
# - "py312-pa15"
# - "py310-pa16"
# - "py311-pa16"
- "py312-pa16"
# - "py310-pa17"
# - "py311-pa17"
- "py312-pa17"
steps:
- name: Create SQL Server
shell: pwsh
run: |
Write-Host "Downloading"
Import-Module BitsTransfer
Start-BitsTransfer -Source "https://download.microsoft.com/download/3/8/d/38de7036-2433-4207-8eae-06e247e17b25/SqlLocalDB.msi" -Destination SqlLocalDB.msi
Write-Host "Installing"
Start-Process -FilePath "SqlLocalDB.msi" -Wait -ArgumentList "/qn", "/norestart", "/l*v SqlLocalDBInstall.log", "IACCEPTSQLLOCALDBLICENSETERMS=YES"
sqlcmd -S '(localdb)\MSSQLLocalDB' -Q 'CREATE DATABASE test_db' -l 60
- name: Configure ODBC Data Source
run: |
odbcconf /a {CONFIGDSN "ODBC Driver 17 for SQL Server" "DSN=MSSQL|Server=(localdb)\MSSQLLocalDB|Database=test_db|Trusted_Connection=Yes"}
if %errorlevel% neq 0 exit /b %errorlevel%
- name: Checkout branch
uses: actions/checkout@v4
- name: Fetch full git history
run: git fetch --prune --unshallow
- name: Set up pixi
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659
with:
environments: ${{ matrix.environment }}
- name: Build wheel
run: pixi run -e ${{ matrix.environment }} python -m build --no-isolation
- name: Install wheel
run: pixi run -e ${{ matrix.environment }} python -m pip install 'dist\*.whl'
- name: Test
run: pixi run -e ${{ matrix.environment }} pytest -sv
env:
TURBODBC_TEST_CONFIGURATION_FILES: "tests/query_fixtures_mssql.json"