Skip to content

Commit dcf56c2

Browse files
committed
Create cpp_odbc.yml
1 parent 7df62c8 commit dcf56c2

File tree

1 file changed

+153
-0
lines changed

1 file changed

+153
-0
lines changed

.github/cpp_odbc.yml

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
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: C++ ODBC
19+
20+
#-AL- TODO change into ODBC workflow
21+
# path should be odbc only.
22+
23+
on:
24+
push:
25+
branches:
26+
- '**'
27+
- '!dependabot/**'
28+
tags:
29+
- '**'
30+
paths:
31+
- '.github/workflows/cpp_odbc.yml'
32+
- 'ci/scripts/cpp_*'
33+
- 'cpp/src/arrow/flight/sql/odbc/*'
34+
pull_request:
35+
paths:
36+
- '.github/workflows/cpp_odbc.yml'
37+
- 'ci/scripts/cpp_*'
38+
- 'cpp/src/arrow/flight/sql/odbc/*'
39+
40+
jobs:
41+
windows:
42+
runs-on: windows-2022
43+
timeout-minutes: 240
44+
env:
45+
ARROW_BUILD_SHARED: ON
46+
ARROW_BUILD_STATIC: ON
47+
# -AL- todo have Github issue for this if it fails
48+
ARROW_BUILD_TESTS: ON
49+
ARROW_BUILD_TYPE: release
50+
ARROW_DATASET: ON
51+
ARROW_DEPENDENCY_SOURCE: VCPKG
52+
ARROW_FLIGHT: ON
53+
ARROW_FLIGHT_SQL: ON
54+
ARROW_FLIGHT_SQL_ODBC: ON
55+
ARROW_SIMD_LEVEL: AVX2
56+
CMAKE_CXX_STANDARD: "17"
57+
CMAKE_GENERATOR: Ninja
58+
CMAKE_INSTALL_PREFIX: /usr
59+
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
60+
VCPKG_DEFAULT_TRIPLET: x64-windows
61+
steps:
62+
- name: Disable Crash Dialogs
63+
run: |
64+
reg add `
65+
"HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" `
66+
/v DontShowUI `
67+
/t REG_DWORD `
68+
/d 1 `
69+
/f
70+
- name: Checkout Arrow
71+
uses: actions/checkout@v5
72+
with:
73+
fetch-depth: 0
74+
submodules: recursive
75+
- name: Download Timezone Database
76+
shell: bash
77+
run: ci/scripts/download_tz_database.sh
78+
- name: Install msys2 (for tzdata for ORC tests)
79+
uses: msys2/setup-msys2@v2
80+
id: setup-msys2
81+
- name: Install cmake
82+
shell: bash
83+
run: |
84+
ci/scripts/install_cmake.sh 4.1.2 /usr
85+
- name: Install ccache
86+
shell: bash
87+
run: |
88+
ci/scripts/install_ccache.sh 4.12.1 /usr
89+
- name: Setup ccache
90+
shell: bash
91+
run: |
92+
ci/scripts/ccache_setup.sh
93+
- name: ccache info
94+
id: ccache-info
95+
shell: bash
96+
run: |
97+
echo "cache-dir=$(ccache --get-config cache_dir)" >> $GITHUB_OUTPUT
98+
- name: Cache ccache
99+
uses: actions/cache@v4
100+
with:
101+
path: ${{ steps.ccache-info.outputs.cache-dir }}
102+
key: cpp-ccache-windows-${{ inputs.arch }}-${{ hashFiles('cpp/**') }}
103+
restore-keys: cpp-ccache-windows-${{ inputs.arch }}-
104+
- name: Checkout vcpkg
105+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
106+
with:
107+
fetch-depth: 0
108+
path: vcpkg
109+
repository: microsoft/vcpkg
110+
- name: Bootstrap vcpkg
111+
run: |
112+
vcpkg\bootstrap-vcpkg.bat
113+
$VCPKG_ROOT = $(Resolve-Path -LiteralPath "vcpkg").ToString()
114+
Write-Output ${VCPKG_ROOT} | `
115+
Out-File -FilePath ${Env:GITHUB_PATH} -Encoding utf8 -Append
116+
Write-Output "VCPKG_ROOT=${VCPKG_ROOT}" | `
117+
Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append
118+
- name: Setup NuGet credentials for vcpkg caching
119+
shell: bash
120+
run: |
121+
$(vcpkg fetch nuget | tail -n 1) \
122+
sources add \
123+
-source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json" \
124+
-storepasswordincleartext \
125+
-name "GitHub" \
126+
-username "$GITHUB_REPOSITORY_OWNER" \
127+
-password "${{ secrets.GITHUB_TOKEN }}"
128+
$(vcpkg fetch nuget | tail -n 1) \
129+
setapikey "${{ secrets.GITHUB_TOKEN }}" \
130+
-source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json"
131+
- name: Build
132+
shell: cmd
133+
run: |
134+
set VCPKG_ROOT_KEEP=%VCPKG_ROOT%
135+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ inputs.arch }}
136+
set VCPKG_ROOT=%VCPKG_ROOT_KEEP%
137+
bash -c "ci/scripts/cpp_build.sh $(pwd) $(pwd)/build"
138+
- name: Register Flight SQL ODBC Driver
139+
shell: cmd
140+
run: |
141+
call "cpp\src\arrow\flight\sql\odbc\tests\install_odbc.cmd" ${{ github.workspace }}\build\cpp\%ARROW_BUILD_TYPE%\arrow_flight_sql_odbc.dll
142+
- name: Test
143+
shell: cmd
144+
run: |
145+
set VCPKG_ROOT_KEEP=%VCPKG_ROOT%
146+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ inputs.arch }}
147+
# For ORC
148+
set TZDIR=${{ steps.setup-msys2.outputs.msys2-location }}\usr\share\zoneinfo
149+
150+
# Convert VCPKG Windows path to MSYS path
151+
for /f "usebackq delims=" %%I in (`bash -c "cygpath -u \"$VCPKG_ROOT_KEEP\""` ) do set VCPKG_ROOT=%%I
152+
153+
bash -c "ci/scripts/cpp_test.sh $(pwd) $(pwd)/build"

0 commit comments

Comments
 (0)