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