|
| 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 | + |
| 20 | +runs: |
| 21 | + using: "composite" |
| 22 | + steps: |
| 23 | + - name: Disable Crash Dialogs |
| 24 | + shell: pwsh |
| 25 | + run: | |
| 26 | + reg add ` |
| 27 | + "HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" ` |
| 28 | + /v DontShowUI ` |
| 29 | + /t REG_DWORD ` |
| 30 | + /d 1 ` |
| 31 | + /f |
| 32 | + - name: Download Timezone Database |
| 33 | + shell: bash |
| 34 | + run: ci/scripts/download_tz_database.sh |
| 35 | + - name: Install ccache |
| 36 | + shell: bash |
| 37 | + run: | |
| 38 | + ci/scripts/install_ccache.sh 4.12.1 /usr |
| 39 | + - name: Setup ccache |
| 40 | + shell: bash |
| 41 | + run: | |
| 42 | + ci/scripts/ccache_setup.sh |
| 43 | + - name: ccache info |
| 44 | + id: ccache-info |
| 45 | + shell: bash |
| 46 | + run: | |
| 47 | + echo "cache-dir=$(ccache --get-config cache_dir)" >> $GITHUB_OUTPUT |
| 48 | + - name: Cache ccache |
| 49 | + uses: actions/cache@v5 |
| 50 | + with: |
| 51 | + path: ${{ steps.ccache-info.outputs.cache-dir }} |
| 52 | + key: cpp-odbc-ccache-windows-x64-${{ hashFiles('cpp/**') }} |
| 53 | + restore-keys: cpp-odbc-ccache-windows-x64- |
| 54 | + - name: Checkout vcpkg |
| 55 | + uses: actions/checkout@v6 |
| 56 | + with: |
| 57 | + fetch-depth: 0 |
| 58 | + path: vcpkg |
| 59 | + repository: microsoft/vcpkg |
| 60 | + - name: Bootstrap vcpkg |
| 61 | + shell: pwsh |
| 62 | + run: | |
| 63 | + vcpkg\bootstrap-vcpkg.bat |
| 64 | + $VCPKG_ROOT = $(Resolve-Path -LiteralPath "vcpkg").ToString() |
| 65 | + Write-Output ${VCPKG_ROOT} | ` |
| 66 | + Out-File -FilePath ${Env:GITHUB_PATH} -Encoding utf8 -Append |
| 67 | + Write-Output "VCPKG_ROOT=${VCPKG_ROOT}" | ` |
| 68 | + Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append |
| 69 | + - name: Setup NuGet credentials for vcpkg caching |
| 70 | + shell: bash |
| 71 | + run: | |
| 72 | + $(vcpkg fetch nuget | tail -n 1) \ |
| 73 | + sources add \ |
| 74 | + -source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json" \ |
| 75 | + -storepasswordincleartext \ |
| 76 | + -name "GitHub" \ |
| 77 | + -username "$GITHUB_REPOSITORY_OWNER" \ |
| 78 | + -password "${{ secrets.GITHUB_TOKEN }}" |
| 79 | + $(vcpkg fetch nuget | tail -n 1) \ |
| 80 | + setapikey "${{ secrets.GITHUB_TOKEN }}" \ |
| 81 | + -source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json" |
| 82 | + - name: Build |
| 83 | + shell: cmd |
| 84 | + run: | |
| 85 | + set VCPKG_ROOT_KEEP=%VCPKG_ROOT% |
| 86 | + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 |
| 87 | + set VCPKG_ROOT=%VCPKG_ROOT_KEEP% |
| 88 | + bash -c "ci/scripts/cpp_build.sh $(pwd) $(pwd)/build" |
| 89 | + - name: Register Flight SQL ODBC Driver |
| 90 | + shell: cmd |
| 91 | + run: | |
| 92 | + 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