forked from apache/arrow
-
Notifications
You must be signed in to change notification settings - Fork 0
418 lines (352 loc) · 17.6 KB
/
win-build.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
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
name: ODBC Driver for Windows
on:
push:
paths:
- '.github/workflows/win-build.yml'
- 'cpp/src/flightsql_odbc/amazon-timestream-odbc-driver/**'
pull_request:
paths:
- '.github/workflows/win-build.yml'
- 'cpp/src/flightsql_odbc/amazon-timestream-odbc-driver/**'
env:
SIGNING_ENABLED: ${{ github.event.inputs.sign }}
CI_OUTPUT_PATH: "ci-output"
ODBC_LIB_PATH: "${{github.workspace}}/cpp/src/flightsql_odbc/amazon-timestream-odbc-driver/build/odbc/lib"
ODBC_BIN_PATH: "${{github.workspace}}/cpp/src/flightsql_odbc/amazon-timestream-odbc-driver/build/odbc/bin/Release"
ODBC_DEBUG_PATH: "${{github.workspace}}/cpp/src/flightsql_odbc/amazon-timestream-odbc-driver/build/odbc/bin/Debug"
ODBC_BUILD_PATH: "${{github.workspace}}/cpp/src/flightsql_odbc/amazon-timestream-odbc-driver/build/odbc/cmake"
VCPKG_ROOT: "c:/vcpkg"
TIMESTREAM_LOG_PATH: "${{github.workspace}}/cpp/src/flightsql_odbc/amazon-timestream-odbc-driver/build/odbc/logs"
TIMESTREAM_LOG_LEVEL: "4"
BIG_TABLE_PAGINATION_TEST_ENABLE: "TRUE"
# # AAD Test environment variables. Uncomment out to use GitHub secrets to enable AAD integration tests
# ENABLE_AAD_TEST: "TRUE"
# AAD_APP_ID: ${{secrets.AAD_APP_ID}}
# AAD_ROLE_ARN: ${{secrets.AAD_ROLE_ARN}}
# AAD_IDP_ARN: ${{secrets.AAD_IDP_ARN}}
# AAD_TENANT: ${{secrets.AAD_TENANT}}
# AAD_USER: ${{secrets.AAD_USER}}
# AAD_USER_PWD: ${{secrets.AAD_USER_PWD}}
# AAD_CLIENT_SECRET: ${{secrets.AAD_CLIENT_SECRET}}
# # OKTA Test environment variables. Uncomment out to use GitHub secrets to enable AAD integration tests
# ENABLE_OKTA_TEST: "TRUE"
# OKTA_HOST: ${{secrets.OKTA_HOST}}
# OKTA_USER: ${{secrets.OKTA_USER}}
# OKTA_USER_PWD: ${{secrets.OKTA_USER_PWD}}
# OKTA_APP_ID: ${{secrets.OKTA_APP_ID}}
# OKTA_ROLE_ARN: ${{secrets.OKTA_ROLE_ARN}}
# OKTA_IDP_ARN: ${{secrets.OKTA_IDP_ARN}}
jobs:
build-windows32:
runs-on: windows-2022
steps:
- uses: actions/checkout@v2
- name: Install Chocolatey
run: |
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
- name: "Update path for WIX Toolset"
run: |
echo "C:\Program Files (x86)\WiX Toolset v3.11\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Get latest version of CMake
uses: lukka/get-cmake@latest
- name: add-msbuild-to-path
uses: microsoft/[email protected]
- name: Cache dependencies Windows 32
id: cache-dependencies-windows-32
uses: actions/cache@v3
with:
path: |
${{ env.VCPKG_ROOT }}
key: ${{ runner.os }}-cache-dependencies-windows-32-v1
- name: Install dependencies Windows
run: vcpkg integrate install; vcpkg install boost-test:x86-windows boost-asio:x86-windows boost-chrono:x86-windows boost-interprocess:x86-windows boost-regex:x86-windows boost-system:x86-windows boost-thread:x86-windows --recurse
env:
VCPKG_ROOT: ${{ env.VCPKG_ROOT }}
- name: configure-and-build-driver
run: |
cd cpp/src/flightsql_odbc/amazon-timestream-odbc-driver
.\build_win_release32.ps1
- name: Build PowerBI connector
run: |
cd cpp/src/flightsql_odbc/amazon-timestream-odbc-driver/src/PowerBIConnector
.\AmazonTimestreamConnector.ps1
cd ${{github.workspace}}/cpp/src/flightsql_odbc/amazon-timestream-odbc-driver
- name: Upload ODBC connector build
uses: actions/upload-artifact@v3
with:
name: AmazonTimestreamConnector.mez
path: ./cpp/src/flightsql_odbc/amazon-timestream-odbc-driver/src/PowerBIConnector/AmazonTimestreamConnector.mez
- name: register-driver
run: |
.\cpp\src\flightsql_odbc\amazon-timestream-odbc-driver\src\odbc\install\install_amd64.cmd ${{env.ODBC_BIN_PATH}}\timestream.odbc.dll ${{env.ODBC_BIN_PATH}}\timestream.odbc.dll
- name: run-unit-tests
id: rununittests
run: |
mkdir -p "${{env.TIMESTREAM_LOG_PATH}}"
${{env.ODBC_BIN_PATH}}/timestream-odbc-unit-tests.exe
- name: upload-unit-test-report
if: always()
uses: EnricoMi/publish-unit-test-result-action/[email protected]
with:
check_name: "Windows x32 Build Unit Test Results Check"
comment_title: "Windows 2022 (x32) Build Unit Test Results"
files: ./odbc_unit_test_result.xml
- name: upload-unit-test-file
if: always()
uses: actions/upload-artifact@v3
with:
name: odbc-unit-test-results
path: |
./odbc_unit_test_result.xml
./cpp/src/flightsql_odbc/amazon-timestream-odbc-driver/build/odbc/logs/timestream_odbc_*.log
# - name: run-integration-tests
# id: runintegrationtests
# run: |
# ${{env.ODBC_BIN_PATH}}/timestream-odbc-integration-tests.exe
- name: upload-integration-test-report
if: always()
uses: EnricoMi/publish-unit-test-result-action/[email protected]
with:
check_name: "Windows x32 Build Integration Test Results Check"
comment_title: "Windows 2022 (x32) Build Integration Test Results"
files: ./odbc_test_result.xml
- name: upload-integration-test-file
if: always()
uses: actions/upload-artifact@v3
with:
name: odbc-test-results
path: |
./odbc_test_result.xml
./cpp/src/flightsql_odbc/amazon-timestream-odbc-driver/build/odbc/logs/timestream_odbc_*.log
- name: Read VERSION file
if: ${{ env.SIGNING_ENABLED == 'true' }}
id: getversion
run: echo "::set-output name=version::$(cat cpp/src/flightsql_odbc/amazon-timestream-odbc-driver/src/ODBC_DRIVER_VERSION.txt)"
# TODO remove code for signing the installer
# - name: "Configure AWS credentials"
# if: ${{ env.SIGNING_ENABLED == 'true' }}
# uses: aws-actions/configure-aws-credentials@v2
# with:
# role-skip-session-tagging: true
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: us-west-2
# role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
# role-external-id: ${{ secrets.AWS_ROLE_EXTERNAL_ID }}
# role-duration-seconds: 3600
# # Name of signed executable is same as unsigned exeuctable
# - name: Sign executables
# if: ${{ env.SIGNING_ENABLED == 'true' }}
# id: sign-executables-32
# shell: pwsh
# run: |
# . ./scripts/sign_installer.ps1
# choco install jq -y
# Invoke-SignInstaller build\odbc\cmake\Release x86 ${{ steps.getversion.outputs.version }} ${{ secrets.AWS_UNSIGNED_BUCKET }} ${{ secrets.AWS_SIGNED_BUCKET }} ${{ secrets.AWS_KEY }}
- name: Upload ODBC driver build
uses: actions/upload-artifact@v3
with:
name: timestream-odbc-driver-32
path: cpp/src/flightsql_odbc/amazon-timestream-odbc-driver/build/odbc/cmake/Release
build-windows64:
runs-on: windows-2022
steps:
- uses: actions/checkout@v2
- name: Install Chocolatey
run: |
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
- name: "Update path for WIX Toolset"
run: |
echo "C:\Program Files (x86)\WiX Toolset v3.11\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Get latest version of CMake
uses: lukka/get-cmake@latest
- name: add-msbuild-to-path
uses: microsoft/[email protected]
- name: Cache dependencies Windows 64
id: cache-dependencies-windows-64
uses: actions/cache@v3
with:
path: |
${{ env.VCPKG_ROOT }}
key: ${{ runner.os }}-cache-dependencies-windows-64-v1
- name: Install dependencies Windows
run: vcpkg integrate install; vcpkg install boost-test:x64-windows boost-asio:x64-windows boost-chrono:x64-windows boost-interprocess:x64-windows boost-regex:x64-windows boost-system:x64-windows boost-thread:x64-windows --recurse
env:
VCPKG_ROOT: ${{env.VCPKG_ROOT}}
- name: configure-and-build-driver
run: |
cd cpp/src/flightsql_odbc/amazon-timestream-odbc-driver
.\build_win_release64.ps1
- name: Build PowerBI connector
run: |
cd cpp/src/flightsql_odbc/amazon-timestream-odbc-driver/src/PowerBIConnector
.\AmazonTimestreamConnector.ps1
cd ${{github.workspace}}/cpp/src/flightsql_odbc/amazon-timestream-odbc-driver
- name: Upload ODBC connector build
uses: actions/upload-artifact@v3
with:
name: AmazonTimestreamConnector.mez
path: ./cpp/src/flightsql_odbc/amazon-timestream-odbc-driver/src/PowerBIConnector/AmazonTimestreamConnector.mez
- name: register-driver
run: |
.\cpp\src\flightsql_odbc\amazon-timestream-odbc-driver\src\odbc\install\install_amd64.cmd ${{env.ODBC_BIN_PATH}}\timestream.odbc.dll
- name: run-unit-tests
id: rununittests
run: |
mkdir -p "${{env.TIMESTREAM_LOG_PATH}}"
${{env.ODBC_BIN_PATH}}/timestream-odbc-unit-tests.exe
- name: upload-unit-test-report
if: always()
uses: EnricoMi/publish-unit-test-result-action/[email protected]
with:
check_name: "Windows 2022 (x64) Build Unit Test Results Check"
comment_title: "Windows 2022 (x64) Build Unit Test Results"
files: ./odbc_unit_test_result.xml
- name: upload-unit-test-file
if: always()
uses: actions/upload-artifact@v3
with:
name: odbc-unit-test-results
path: |
./odbc_unit_test_result.xml
./cpp/src/flightsql_odbc/amazon-timestream-odbc-driver/build/odbc/logs/timestream_odbc_*.log
# TODO enable integration tests
# - name: run-integration-tests
# id: runintegrationtests
# run: |
# ${{env.ODBC_BIN_PATH}}/timestream-odbc-integration-tests.exe
- name: upload-integration-test-report
if: always()
uses: EnricoMi/publish-unit-test-result-action/[email protected]
with:
check_name: "Windows 2022 (x64) Build Integration Test Results Check"
comment_title: "Windows 2022 (x64) Build Integration Test Results"
files: ./odbc_test_result.xml
- name: upload-integration-test-file
if: always()
uses: actions/upload-artifact@v3
with:
name: odbc-test-results
path: |
./odbc_test_result.xml
./cpp/src/flightsql_odbc/amazon-timestream-odbc-driver/build/odbc/logs/timestream_odbc_*.log
- name: Read VERSION file
if: ${{ env.SIGNING_ENABLED == 'true' }}
id: getversion
run: echo "::set-output name=version::$(cat cpp/src/flightsql_odbc/amazon-timestream-odbc-driver/src/ODBC_DRIVER_VERSION.txt)"
# - name: "Configure AWS credentials"
# if: ${{ env.SIGNING_ENABLED == 'true' }}
# uses: aws-actions/configure-aws-credentials@v2
# with:
# role-skip-session-tagging: true
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: us-west-2
# role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
# role-external-id: ${{ secrets.AWS_ROLE_EXTERNAL_ID }}
# role-duration-seconds: 3600
# Name of signed executable is same as unsigned exeuctable
# - name: Sign executables
# if: ${{ env.SIGNING_ENABLED == 'true' }}
# id: sign-executables-64
# shell: pwsh
# run: |
# . ./scripts/sign_installer.ps1
# choco install jq -y
# Invoke-SignInstaller build\odbc\cmake\Release x64 ${{ steps.getversion.outputs.version }} ${{ secrets.AWS_UNSIGNED_BUCKET }} ${{ secrets.AWS_SIGNED_BUCKET }} ${{ secrets.AWS_KEY }}
- name: Upload ODBC driver build
uses: actions/upload-artifact@v3
with:
name: timestream-odbc-driver-64
path: cpp/src/flightsql_odbc/amazon-timestream-odbc-driver/build/odbc/cmake/Release
build-windows64_coverage:
runs-on: windows-2022
steps:
- uses: actions/checkout@v2
- name: Install Chocolatey
run: |
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
- name: "Update path for WIX Toolset"
run: |
echo "C:\Program Files (x86)\WiX Toolset v3.11\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Get latest version of CMake
uses: lukka/get-cmake@latest
- name: add-msbuild-to-path
uses: microsoft/[email protected]
- name: setup-opencppcoverage-and-add-to-path
id: setup_opencppcoverage
run: |
choco install OpenCppCoverage -y
echo "C:\Program Files\OpenCppCoverage" >> $env:GITHUB_PATH
- name: Cache dependencies Windows 64
id: cache-dependencies-windows-64
uses: actions/cache@v3
with:
path: |
${{ env.VCPKG_ROOT }}
key: ${{ runner.os }}-cache-dependencies-windows-64-v1
- name: Install dependencies Windows
run: vcpkg integrate install; vcpkg install boost-test:x64-windows boost-asio:x64-windows boost-chrono:x64-windows boost-interprocess:x64-windows boost-regex:x64-windows boost-system:x64-windows boost-thread:x64-windows --recurse
env:
VCPKG_ROOT: ${{env.VCPKG_ROOT}}
- name: configure-and-build-driver
run: |
cd cpp/src/flightsql_odbc/amazon-timestream-odbc-driver
.\build_win_debug64.ps1
- name: Build PowerBI connector
run: |
cd cpp/src/flightsql_odbc/amazon-timestream-odbc-driver/src/PowerBIConnector
.\AmazonTimestreamConnector.ps1
cd ${{github.workspace}}/cpp/src/flightsql_odbc/amazon-timestream-odbc-driver/
- name: register-driver
run: |
.\cpp\src\flightsql_odbc\amazon-timestream-odbc-driver\src\odbc\install\install_amd64.cmd ${{env.ODBC_DEBUG_PATH}}\timestream.odbc.dll
# TODO re-enable integration tests
- name: run-tests
run: |
# run code coverage against unit test first
opencppcoverage --sources \cpp\src\flightsql_odbc\amazon-timestream-odbc-driver\src\odbc\src --sources \cpp\src\flightsql_odbc\amazon-timestream-odbc-driver\src\odbc\include --export_type cobertura:coverage.cobertura.xml --excluded_modules boost_unit_test_framework --excluded_modules timestream-odbc-integration-tests --excluded_modules zlib --excluded_modules aws --excluded_modules boost --excluded_sources \cpp\src\flightsql_odbc\amazon-timestream-odbc-driver\src\odbc\src\ignite --excluded_sources \cpp\src\flightsql_odbc\amazon-timestream-odbc-driver\src\odbc\include\ignite -- ${{env.ODBC_DEBUG_PATH}}/timestream-odbc-unit-tests.exe
# TODO after integration tests are enabled, merge unit test coverage with integraion test coverage; replace below lines with above.
# opencppcoverage --sources \cpp\src\flightsql_odbc\amazon-timestream-odbc-driver\src\odbc\src --sources \cpp\src\flightsql_odbc\amazon-timestream-odbc-driver\src\odbc\include --export_type binary:unit.test.cov --excluded_modules boost_unit_test_framework --excluded_modules timestream-odbc-integration-tests --excluded_modules zlib --excluded_modules aws --excluded_modules boost --excluded_sources \cpp\src\flightsql_odbc\amazon-timestream-odbc-driver\src\odbc\src\ignite --excluded_sources \cpp\src\flightsql_odbc\amazon-timestream-odbc-driver\src\odbc\include\ignite -- ${{env.ODBC_DEBUG_PATH}}/timestream-odbc-unit-tests.exe
# run code coverage against integration test and merge the result with the unit test one
# opencppcoverage --sources \cpp\src\flightsql_odbc\amazon-timestream-odbc-driver\src\odbc\src --sources \cpp\src\flightsql_odbc\amazon-timestream-odbc-driver\src\odbc\include --input_coverage unit.test.cov --export_type cobertura:coverage.cobertura.xml --excluded_modules boost_unit_test_framework --excluded_modules timestream-odbc-integration-tests --excluded_modules zlib --excluded_modules aws --excluded_modules boost --excluded_sources \cpp\src\flightsql_odbc\amazon-timestream-odbc-driver\src\odbc\src\ignite --excluded_sources \cpp\src\flightsql_odbc\amazon-timestream-odbc-driver\src\odbc\include\ignite -- ${{env.ODBC_DEBUG_PATH}}/timestream-odbc-integration-tests.exe
- name: upload-coverage
if: always()
uses: actions/upload-artifact@v3
with:
name: code-coverage
path: coverage.cobertura.xml
comment_PR_coverage:
runs-on: ubuntu-latest
needs: build-windows64_coverage
steps:
- uses: actions/checkout@v2
- name: Retrieve coverage
uses: actions/download-artifact@v2
with:
name: code-coverage
- name: Code Coverage Summary Report
uses: irongut/[email protected]
with:
filename: coverage.cobertura.xml
badge: true
format: markdown
indicators: true
output: both
- name: Add Header for Code Coverage Summary Report
run: |
echo "## Windows 2022 (x64) Debug Build Code Coverage Test Results Check" > coverage-cobertura.md
cat code-coverage-results.md >> coverage-cobertura.md
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
header: windows
recreate: true
path: coverage-cobertura.md