-
Notifications
You must be signed in to change notification settings - Fork 8
318 lines (275 loc) · 10.1 KB
/
ODBC.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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
name: ODBC
on:
push:
pull_request:
workflow_dispatch:
workflow_call:
repository_dispatch:
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
OVERRIDE_GIT_DESCRIBE: ${{ inputs.override_git_describe }}
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
concurrency:
group: ODBC-${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' || github.sha }}-${{ inputs.override_git_describe }}
cancel-in-progress: true
jobs:
odbc-linux-amd64:
name: ODBC Linux (amd64)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ inputs.git_ref }}
- name: Build
shell: bash
run: docker run -v.:/duckdb quay.io/pypa/manylinux2014_x86_64 bash -c 'cd /duckdb && ./scripts/install_unixodbc.sh && ODBC_CONFIG=../../build/unixodbc/build/bin/odbc_config make release'
- name: ODBC Tests
shell: bash
if: ${{ inputs.skip_tests != 'true' }}
run: docker run -v.:/duckdb quay.io/pypa/manylinux2014_x86_64 /duckdb/build/release/test/test_odbc
- name: Deploy
shell: bash
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }}
run: |
zip -j duckdb_odbc-linux-amd64.zip build/release/libduckdb_odbc.so linux_setup/unixodbc_setup.sh linux_setup/update_odbc_path.py
./scripts/upload-assets-to-staging.sh github_release duckdb_odbc-linux-amd64.zip
- uses: actions/upload-artifact@v3
with:
name: odbc-linux-amd64
path: |
duckdb_odbc-linux-amd64.zip
odbc-linux-aarch64:
name: ODBC Linux (aarch64)
runs-on: ubuntu-latest
container:
image: ubuntu:20.04
needs: odbc-linux-amd64
env:
GEN: ninja
DUCKDB_PLATFORM: linux_arm64
ODBC_CONFIG: ../../build/unixodbc/build/bin/odbc_config
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ inputs.git_ref }}
- uses: ./.github/actions/ubuntu_18_setup
with:
ccache: 1
aarch64_cross_compile: 1
- name: Install unixODBC
shell: bash
run: | # we need an x86 odbc_config tool to run cmake. fun.
apt-get remove -y unixodbc unixodbc-dev
CC=gcc ./scripts/install_unixodbc.sh
cp build/unixodbc/build/bin/odbc_config .
CC=aarch64-linux-gnu-gcc ./scripts/install_unixodbc.sh --host aarch64-linux-gnu
cp odbc_config build/unixodbc/build/bin/odbc_config
- name: Build
shell: bash
run: CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ make release
- name: Deploy
shell: bash
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }}
run: |
zip -j duckdb_odbc-linux-aarch64.zip build/release/libduckdb_odbc.so linux_setup/unixodbc_setup.sh linux_setup/update_odbc_path.py
./scripts/upload-assets-to-staging.sh github_release duckdb_odbc-linux-aarch64.zip
- uses: actions/upload-artifact@v3
with:
name: odbc-linux-aarch64
path: |
duckdb_odbc-linux-aarch64.zip
odbc-windows-amd64:
name: ODBC Windows (amd64)
runs-on: windows-latest
needs: odbc-linux-amd64
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ inputs.git_ref }}
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Setup Ccache
uses: hendrikmuhs/ccache-action@main
with:
key: ${{ github.job }}
save: ${{ github.ref == 'refs/heads/main' || github.repository != 'duckdb/duckdb-java' }}
- name: Build
shell: bash
run: make release
- name: Setup ODBC
shell: bash
run: |
./build/release/bin/Release/odbc_install.exe //CI //Install
Reg Query "HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources"
Reg Query "HKLM\SOFTWARE\ODBC\ODBC.INI\DuckDB"
Reg Query "HKLM\SOFTWARE\ODBC\ODBCINST.INI\DuckDB Driver"
- name: Enable ODBC Trace HKCU
shell: bash
run: |
REG ADD "HKCU\SOFTWARE\ODBC\ODBC.INI\ODBC" //f
REG ADD "HKCU\SOFTWARE\ODBC\ODBC.INI\ODBC" //v Trace //t REG_SZ //d 1
REG ADD "HKCU\SOFTWARE\ODBC\ODBC.INI\ODBC" //v TraceDll //t REG_SZ //d "C:\Windows\system32\odbctrac.dll"
REG ADD "HKCU\SOFTWARE\ODBC\ODBC.INI\ODBC" //v TraceFile //t REG_SZ //d "D:\a\duckdb-odbc\duckdb-odbc\ODBC_TRACE.log"
echo "----------------------------------------------------------------"
Reg Query "HKCU\SOFTWARE\ODBC\ODBC.INI\ODBC"
- name: Test Standard ODBC tests
if: ${{ inputs.skip_tests != 'true' }}
shell: bash
run: |
./build/release/bin/Release/test_odbc.exe
- name: Setup Register For Connection Tests
shell: bash
run: |
REG ADD "HKCU\SOFTWARE\ODBC\ODBC.INI\DuckDB" //v database //t REG_SZ //d "/d/a/duckdb-odbc/duckdb-odbc/test/sql/storage_version/storage_version.db"
REG ADD "HKCU\SOFTWARE\ODBC\ODBC.INI\DuckDB" //v access_mode //t REG_SZ //d "READ_ONLY"
REG ADD "HKCU\SOFTWARE\ODBC\ODBC.INI\DuckDB" //v allow_unsigned_extensions //t REG_SZ //d "true"
echo "----------------------------------------------------------------"
Reg Query "HKCU\SOFTWARE\ODBC\ODBC.INI\DuckDB"
- name: Test Connection ODBC tests
if: ${{ inputs.skip_tests != 'true' }}
shell: bash
run: |
./build/release/bin/Release/test_connection_odbc.exe
- name: Print ODBC trace on failure
if: ${{ failure() }}
shell: bash
run: cat ODBC_TRACE.log
- name: System.Data.ODBC tests
shell: bash
run: |
./build/release/bin/Release/SystemDataODBC_tests.exe
- name: Deploy
shell: bash
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }}
run: |
choco install zip -y --force
zip -j duckdb_odbc-windows-amd64.zip ./build/release/bin/Release/*
./scripts/upload-assets-to-staging.sh github_release duckdb_odbc-windows-amd64.zip
- uses: actions/upload-artifact@v3
with:
name: odbc-windows-amd64
path: |
duckdb_odbc-windows-amd64.zip
odbc-osx-universal:
name: ODBC OSX (Universal)
runs-on: macos-14
env:
GEN: ninja
ODBC_CONFIG: ../../build/unixodbc/build/bin/odbc_config
OSX_BUILD_UNIVERSAL: 1
needs: odbc-linux-amd64
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ inputs.git_ref }}
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Setup Ccache
uses: hendrikmuhs/ccache-action@main
with:
key: ${{ github.job }}
save: ${{ github.ref == 'refs/heads/main' }}
- name: Install Ninja
run: brew install ninja
- name: Install UnixODBC
shell: bash
run: CFLAGS="-arch x86_64 -arch arm64" ./scripts/install_unixodbc.sh
- name: Build
shell: bash
run: make release
- name: ODBC Tests
if: ${{ inputs.skip_tests != 'true' }}
shell: bash
run: ./build/release/test/test_odbc
- name: See if this actually universal
shell: bash
run: lipo -archs build/release/libduckdb_odbc.dylib | grep "x86_64 arm64"
- name: Deploy
shell: bash
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }}
run: |
zip -j duckdb_odbc-osx-universal.zip build/release/libduckdb_odbc.dylib
./scripts/upload-assets-to-staging.sh github_release duckdb_odbc-osx-universal.zip
- uses: actions/upload-artifact@v3
with:
name: odbc-osx-universal
path: |
duckdb_odbc-osx-universal.zip
debug:
name: ODBC Tests
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-22.04
needs: odbc-linux-amd64
env:
BUILD_ODBC: 1
GEN: ninja
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Dependencies
shell: bash
run: |
sudo apt-get update -y -qq
sudo apt-get install -y -qq ninja-build unixodbc-dev
pip3 install pyodbc
- name: Install nanodbc
shell: bash
run: |
wget https://github.com/nanodbc/nanodbc/archive/refs/tags/v2.14.0.tar.gz -O nanodbc.tgz
mkdir nanodbc
tar xvf nanodbc.tgz -C nanodbc --strip-components=1
cd nanodbc
wget https://github.com/catchorg/Catch2/releases/download/v2.13.9/catch.hpp
cp catch.hpp test/catch/catch.hpp
sed -i -e "s/set(test_list/set(test_list odbc/" test/CMakeLists.txt
mkdir build
cd build
cmake -DNANODBC_DISABLE_TESTS=OFF ..
cmake --build .
- name: Setup Ccache
uses: hendrikmuhs/ccache-action@main
with:
key: ${{ github.job }}
save: ${{ github.ref == 'refs/heads/main' || github.repository != 'duckdb/duckdb' }}
- name: Build
shell: bash
run: make debug
- name: Test Standard ODBC tests
shell: bash
run: build/debug/test/test_odbc
- name: Test Connection ODBC tests
shell: bash
run: |
chmod +x scripts/create_ini_file.sh
scripts/create_ini_file.sh
build/debug/test/test_connection_odbc
- name: Test nanodbc
shell: bash
run: ./test/run_nanodbc_tests.sh
- name: Test isql
shell: bash
run: ./test/run_isql_tests.sh
- name: Test R ODBC
shell: bash
run: R -f test/rodbc.R
- name: Test Python ODBC
shell: bash
run: ./test/run_pyodbc_tests.sh