Skip to content

Commit c0d1bed

Browse files
committed
Windows CI to Support ODBC DLL & MSI Signing
* Add draft code for CI A and CI B Attempt workflow dispatch Only ODBC Windows original workflow should run. Later need to add `github.event_name != 'workflow_dispatch' ||` to all existing workflows after uncomment Use `GITHUB_REF_NAME` directly via push Add `workflow_dispatch` definitions Add `ODBC Windows Upload DLL` Use common ODBC Windows environment variables Use ODBC as composite action Create cpp_odbc.yml Initial draft temp disable test step Temp disable non-ODBC Windows workflows * Clean Up Code * Remove comments * Fix Installer path for MSI Trigger CI Fix issue with `secrets.GITHUB_TOKEN` Change `odbc_msi_upload` to boolean input Change `odbc-msvc-upload-dll` to be triggered via rc tag and can be invoked manually Work on Bryce's code review comments
1 parent 5633a18 commit c0d1bed

2 files changed

Lines changed: 245 additions & 110 deletions

File tree

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: ODBC Windows Reusable
19+
inputs:
20+
github-token:
21+
description: 'GITHUB_TOKEN for vcpkg caching'
22+
required: true
23+
runs:
24+
using: "composite"
25+
steps:
26+
- name: Disable Crash Dialogs
27+
shell: pwsh
28+
run: |
29+
reg add `
30+
"HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" `
31+
/v DontShowUI `
32+
/t REG_DWORD `
33+
/d 1 `
34+
/f
35+
- name: Download Timezone Database
36+
shell: bash
37+
run: ci/scripts/download_tz_database.sh
38+
- name: Install ccache
39+
shell: bash
40+
run: |
41+
ci/scripts/install_ccache.sh 4.12.1 /usr
42+
- name: Setup ccache
43+
shell: bash
44+
run: |
45+
ci/scripts/ccache_setup.sh
46+
- name: ccache info
47+
id: ccache-info
48+
shell: bash
49+
run: |
50+
echo "cache-dir=$(ccache --get-config cache_dir)" >> $GITHUB_OUTPUT
51+
- name: Cache ccache
52+
uses: actions/cache@v5
53+
with:
54+
path: ${{ steps.ccache-info.outputs.cache-dir }}
55+
key: cpp-odbc-ccache-windows-x64-${{ hashFiles('cpp/**') }}
56+
restore-keys: cpp-odbc-ccache-windows-x64-
57+
- name: Checkout vcpkg
58+
uses: actions/checkout@v6
59+
with:
60+
fetch-depth: 0
61+
path: vcpkg
62+
repository: microsoft/vcpkg
63+
- name: Bootstrap vcpkg
64+
shell: pwsh
65+
run: |
66+
vcpkg\bootstrap-vcpkg.bat
67+
$VCPKG_ROOT = $(Resolve-Path -LiteralPath "vcpkg").ToString()
68+
Write-Output ${VCPKG_ROOT} | `
69+
Out-File -FilePath ${Env:GITHUB_PATH} -Encoding utf8 -Append
70+
Write-Output "VCPKG_ROOT=${VCPKG_ROOT}" | `
71+
Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append
72+
- name: Setup NuGet credentials for vcpkg caching
73+
shell: bash
74+
run: |
75+
$(vcpkg fetch nuget | tail -n 1) \
76+
sources add \
77+
-source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json" \
78+
-storepasswordincleartext \
79+
-name "GitHub" \
80+
-username "$GITHUB_REPOSITORY_OWNER" \
81+
-password "${{ inputs.github-token }}"
82+
$(vcpkg fetch nuget | tail -n 1) \
83+
setapikey "${{ inputs.github-token }}" \
84+
-source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json"
85+
- name: Build
86+
shell: cmd
87+
run: |
88+
set VCPKG_ROOT_KEEP=%VCPKG_ROOT%
89+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
90+
set VCPKG_ROOT=%VCPKG_ROOT_KEEP%
91+
bash -c "ci/scripts/cpp_build.sh $(pwd) $(pwd)/build"
92+
- name: Register Flight SQL ODBC Driver
93+
shell: cmd
94+
run: |
95+
call "cpp\src\arrow\flight\sql\odbc\tests\install_odbc.cmd" ${{ github.workspace }}\build\cpp\%ARROW_BUILD_TYPE%\arrow_flight_sql_odbc.dll

0 commit comments

Comments
 (0)