forked from duckdb/duckdb
-
Notifications
You must be signed in to change notification settings - Fork 0
378 lines (329 loc) · 13 KB
/
Windows.yml
File metadata and controls
378 lines (329 loc) · 13 KB
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
name: Windows
on:
workflow_call:
inputs:
override_git_describe:
type: string
git_ref:
type: string
skip_tests:
type: string
run_all:
type: string
workflow_dispatch:
inputs:
override_git_describe:
type: string
git_ref:
type: string
skip_tests:
type: string
run_all:
type: string
push:
branches-ignore:
- 'main'
- 'feature'
- 'v*.*-*'
paths-ignore:
- '**.md'
- 'tools/**'
- '!tools/shell/**'
- '.github/patches/duckdb-wasm/**'
- '.github/workflows/**'
- '!.github/workflows/Windows.yml'
merge_group:
pull_request:
types: [opened, reopened, ready_for_review]
paths-ignore:
- '**.md'
- 'tools/**'
- '!tools/shell/**'
- '.github/patches/duckdb-wasm/**'
- '.github/workflows/**'
- '!.github/workflows/Windows.yml'
concurrency:
group: windows-${{ 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
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
OVERRIDE_GIT_DESCRIBE: ${{ inputs.override_git_describe }}
AZURE_CODESIGN_ENDPOINT: https://eus.codesigning.azure.net/
AZURE_CODESIGN_ACCOUNT: duckdb-signing-2
AZURE_CODESIGN_PROFILE: duckdb-certificate-profile
jobs:
win-release-64:
# Builds binaries for windows_amd64
name: Windows (64 Bit)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
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' }}
- name: Build
shell: bash
run: |
python scripts/windows_ci.py
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_GENERATOR_PLATFORM=x64 -DENABLE_EXTENSION_AUTOLOADING=1 -DENABLE_EXTENSION_AUTOINSTALL=1 -DDUCKDB_EXTENSION_CONFIGS="${GITHUB_WORKSPACE}/.github/config/bundled_extensions.cmake" -DDISABLE_UNITY=1 -DOVERRIDE_GIT_DESCRIBE="$OVERRIDE_GIT_DESCRIBE"
cmake --build . --config Release --parallel
- name: Set DUCKDB_INSTALL_LIB for ADBC tests
shell: pwsh
run: echo "DUCKDB_INSTALL_LIB=$((Get-ChildItem -Recurse -Filter "duckdb.dll" | Select-Object -First 1).FullName)" >> $GITHUB_ENV
- name: Test DUCKDB_INSTALL_LIB variable
shell: bash
run: echo $DUCKDB_INSTALL_LIB
- name: Test
shell: bash
if: ${{ inputs.skip_tests != 'true' }}
run: |
test/Release/unittest.exe
- name: Test with VS2019 C++ stdlib
shell: bash
if: ${{ inputs.skip_tests != 'true' }}
run: |
choco install wget -y --no-progress
wget -P test/Release https://blobs.duckdb.org/ci/msvcp140.dll
test/Release/unittest.exe
rm test/Release/msvcp140.dll
- name: Tools Test
shell: bash
if: ${{ inputs.skip_tests != 'true' }}
run: |
python -m pip install pytest
python -m pytest tools/shell/tests --shell-binary Release/duckdb.exe
tools/sqlite3_api_wrapper/Release/test_sqlite3_api_wrapper.exe
- name: Sign files with Azure Trusted Signing (TM)
if: github.repository == 'duckdb/duckdb' && github.event_name != 'pull_request'
uses: azure/trusted-signing-action@v0
with:
azure-tenant-id: ${{ secrets.AZURE_CODESIGN_TENANT_ID }}
azure-client-id: ${{ secrets.AZURE_CODESIGN_CLIENT_ID }}
azure-client-secret: ${{ secrets.AZURE_CODESIGN_CLIENT_SECRET }}
endpoint: ${{ env.AZURE_CODESIGN_ENDPOINT }}
trusted-signing-account-name: ${{ env.AZURE_CODESIGN_ACCOUNT }}
certificate-profile-name: ${{ env.AZURE_CODESIGN_PROFILE }}
files-folder: ${{ github.workspace }}
files-folder-filter: exe,dll
files-folder-recurse: true
file-digest: SHA256
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
- name: Deploy
shell: bash
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }}
run: |
python scripts/amalgamation.py
/c/msys64/usr/bin/bash.exe -lc "pacman -Sy --noconfirm zip"
/c/msys64/usr/bin/zip.exe -j duckdb_cli-windows-amd64.zip Release/duckdb.exe
/c/msys64/usr/bin/zip.exe -j libduckdb-windows-amd64.zip src/Release/duckdb.dll src/Release/duckdb.lib src/amalgamation/duckdb.hpp src/include/duckdb.h
./scripts/upload-assets-to-staging.sh github_release libduckdb-windows-amd64.zip duckdb_cli-windows-amd64.zip
- uses: actions/upload-artifact@v4
with:
name: duckdb-binaries-windows-amd64
path: |
libduckdb-windows-amd64.zip
duckdb_cli-windows-amd64.zip
- uses: ilammy/msvc-dev-cmd@v1
- name: Duckdb.dll export symbols with C++ on Windows
shell: bash
run: cl -I src/include examples/embedded-c++-windows/cppintegration.cpp -link src/Release/duckdb.lib
win-release-32:
name: Windows (32 Bit)
if: github.ref == 'refs/heads/main' || github.repository != 'duckdb/duckdb' || inputs.run_all == 'true'
runs-on: windows-latest
needs: win-release-64
steps:
- uses: actions/checkout@v4
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' }}
- name: Build
shell: bash
run: |
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_GENERATOR_PLATFORM=Win32 -DDUCKDB_EXTENSION_CONFIGS="${GITHUB_WORKSPACE}/.github/config/bundled_extensions.cmake" -DOVERRIDE_GIT_DESCRIBE="$OVERRIDE_GIT_DESCRIBE"
cmake --build . --config Release --parallel
- name: Test
shell: bash
run: test/Release/unittest.exe
- name: Tools Test
shell: bash
run: |
python -m pip install pytest
python -m pytest tools/shell/tests --shell-binary Release/duckdb.exe
tools/sqlite3_api_wrapper/Release/test_sqlite3_api_wrapper.exe
win-release-arm64:
name: Windows (ARM64)
if: github.ref == 'refs/heads/main' || github.repository != 'duckdb/duckdb' || inputs.run_all == 'true'
runs-on: windows-latest
needs: win-release-64
steps:
- uses: actions/checkout@v4
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' }}
- name: Build
shell: bash
run: |
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_GENERATOR_PLATFORM=ARM64 -DDUCKDB_EXTENSION_CONFIGS="${GITHUB_WORKSPACE}/.github/config/bundled_extensions.cmake" -DOVERRIDE_GIT_DESCRIBE="$OVERRIDE_GIT_DESCRIBE" -DDUCKDB_EXPLICIT_PLATFORM=windows_arm64 -DDUCKDB_CUSTOM_PLATFORM=windows_arm64 -DBUILD_UNITTESTS=FALSE
cmake --build . --config Release --parallel
- name: Sign files with Azure Trusted Signing (TM)
if: github.repository == 'duckdb/duckdb' && github.event_name != 'pull_request'
uses: azure/trusted-signing-action@v0
with:
azure-tenant-id: ${{ secrets.AZURE_CODESIGN_TENANT_ID }}
azure-client-id: ${{ secrets.AZURE_CODESIGN_CLIENT_ID }}
azure-client-secret: ${{ secrets.AZURE_CODESIGN_CLIENT_SECRET }}
endpoint: ${{ env.AZURE_CODESIGN_ENDPOINT }}
trusted-signing-account-name: ${{ env.AZURE_CODESIGN_ACCOUNT }}
certificate-profile-name: ${{ env.AZURE_CODESIGN_PROFILE }}
files-folder: ${{ github.workspace }}
files-folder-filter: exe,dll
files-folder-recurse: true
file-digest: SHA256
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
- name: Deploy
shell: bash
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }}
run: |
python scripts/amalgamation.py
/c/msys64/usr/bin/bash.exe -lc "pacman -Sy --noconfirm zip"
/c/msys64/usr/bin/zip.exe -j duckdb_cli-windows-arm64.zip Release/duckdb.exe
/c/msys64/usr/bin/zip.exe -j libduckdb-windows-arm64.zip src/Release/duckdb.dll src/Release/duckdb.lib src/amalgamation/duckdb.hpp src/include/duckdb.h
./scripts/upload-assets-to-staging.sh github_release libduckdb-windows-arm64.zip duckdb_cli-windows-arm64.zip
- uses: actions/upload-artifact@v4
with:
name: duckdb-binaries-windows-arm64
path: |
libduckdb-windows-arm64.zip
duckdb_cli-windows-arm64.zip
mingw:
name: MinGW (64 Bit)
runs-on: windows-latest
if: ${{ inputs.skip_tests != 'true' }}
needs: win-release-64
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.git_ref }}
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: git mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja
cache: ${{ github.ref == 'refs/heads/main' || github.repository != 'duckdb/duckdb' }}
# see here: https://gist.github.com/scivision/1de4fd6abea9ba6b2d87dc1e86b5d2ce
- name: Put MSYS2_MinGW64 on PATH
# there is not yet an environment variable for this path from msys2/setup-msys2
shell: msys2 {0}
run: export PATH=D:/a/_temp/msys/msys64/mingw64/bin:$PATH
- 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: msys2 {0}
run: |
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCORE_EXTENSIONS='parquet' -DOVERRIDE_GIT_DESCRIBE="$OVERRIDE_GIT_DESCRIBE"
cmake --build . --config Release
- name: Test
shell: msys2 {0}
run: |
cp src/libduckdb.dll .
test/unittest.exe
- name: Tools Test
shell: msys2 {0}
run: |
tools/sqlite3_api_wrapper/test_sqlite3_api_wrapper.exe
win-extensions-64:
# Builds extensions for windows_amd64
name: Windows Extensions (64-bit)
runs-on: windows-latest
needs: win-release-64
steps:
- name: Keep \n line endings
shell: bash
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.git_ref }}
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/build_extensions
with:
vcpkg_target_triplet: x64-windows-static-md
treat_warn_as_error: 0
run_tests: ${{ inputs.skip_tests != 'true' && 1 || 0 }}
run_autoload_tests: ${{ inputs.skip_tests != 'true' && 1 || 0 }}
unittest_script: python3 scripts/run_tests_one_by_one.py ./build/release/test/Release/unittest.exe
build_complete_extensions_set: ${{ github.event_name != 'pull_request' && 1 || 0 }}
- uses: actions/upload-artifact@v4
with:
name: duckdb-extensions-windows_amd64
path: |
build/release/extension/*/*.duckdb_extension
upload-windows_amd64-extensions:
name: Upload windows_amd64 Extensions
needs: win-extensions-64
uses: ./.github/workflows/_sign_deploy_extensions.yml
secrets: inherit
with:
extension_artifact_name: duckdb-extensions-windows_amd64
duckdb_arch: windows_amd64
duckdb_sha: ${{ github.sha }}
win-packaged-upload:
runs-on: windows-latest
needs:
- win-release-64
- win-release-arm64
steps:
- uses: actions/download-artifact@v4
with:
name: duckdb-binaries-windows-arm64
- uses: actions/download-artifact@v4
with:
name: duckdb-binaries-windows-amd64
- uses: actions/upload-artifact@v4
with:
name: duckdb-binaries-windows
path: |
libduckdb-windows-amd64.zip
duckdb_cli-windows-amd64.zip
libduckdb-windows-arm64.zip
duckdb_cli-windows-arm64.zip