Update vendored DuckDB sources to fe2c07fcd2 #834
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ODBC | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| override_git_describe: | |
| description: 'Override git describe' | |
| required: false | |
| workflow_call: | |
| repository_dispatch: | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
| OVERRIDE_GIT_DESCRIBE: ${{ inputs.override_git_describe }} | |
| jobs: | |
| odbc-linux-amd64: | |
| name: Linux (amd64) | |
| runs-on: ubuntu-latest | |
| env: | |
| MANYLINUX_IMAGE: quay.io/pypa/manylinux_2_28_x86_64 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ inputs.git_ref }} | |
| - name: Cache Key | |
| id: cache_key | |
| run: | | |
| DUCKDB_VERSION=$(python ./scripts/print_duckdb_version.py) | |
| KEY="${{ runner.os }}-${{ runner.arch }}-$DUCKDB_VERSION" | |
| echo "value=${KEY}" >> "${GITHUB_OUTPUT}" | |
| - name: Restore Cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ${{ github.workspace }}/ccache | |
| key: ${{ steps.cache_key.outputs.value }} | |
| - name: Build | |
| run: | | |
| docker run \ | |
| -v.:/duckdb \ | |
| -e GEN=ninja \ | |
| -e CC='ccache gcc' \ | |
| -e CXX='ccache g++' \ | |
| -e CCACHE_DIR=/duckdb/ccache \ | |
| ${{ env.MANYLINUX_IMAGE }} \ | |
| bash -c " | |
| set -e | |
| cat /etc/os-release | |
| dnf install -y \ | |
| ccache \ | |
| ninja-build \ | |
| unixODBC-devel | |
| make -C /duckdb release | |
| " | |
| - name: Save Cache | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: ${{ github.workspace }}/ccache | |
| key: ${{ steps.cache_key.outputs.value }} | |
| - name: List Symbols | |
| run: | | |
| nm -gU ./build/release/libduckdb_odbc.so | |
| - name: ODBC Tests | |
| if: ${{ inputs.skip_tests != 'true' }} | |
| run: | | |
| docker run \ | |
| -v.:/duckdb \ | |
| ${{ env.MANYLINUX_IMAGE }} \ | |
| bash -c " | |
| set -e | |
| cat /etc/os-release | |
| dnf install -y \ | |
| unixODBC-devel | |
| /duckdb/build/release/test/test_odbc | |
| " | |
| - name: Deploy | |
| env: | |
| AWS_ENDPOINT_URL: ${{ secrets.S3_DUCKDB_STAGING_ENDPOINT }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }} | |
| run: | | |
| zip -j duckdb_odbc-linux-amd64.zip build/release/libduckdb_odbc.so linux_setup/unixodbc_setup.sh linux_setup/update_odbc_path.py | |
| ./scripts/upload-assets-to-staging.sh github_release duckdb_odbc-linux-amd64.zip | |
| - name: Upload | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: odbc-linux-amd64 | |
| path: | | |
| duckdb_odbc-linux-amd64.zip | |
| odbc-linux-aarch64: | |
| name: Linux (aarch64) | |
| runs-on: ubuntu-24.04-arm | |
| needs: odbc-linux-amd64 | |
| env: | |
| MANYLINUX_IMAGE: quay.io/pypa/manylinux_2_28_aarch64 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ inputs.git_ref }} | |
| - name: Cache Key | |
| id: cache_key | |
| run: | | |
| DUCKDB_VERSION=$(python ./scripts/print_duckdb_version.py) | |
| KEY="${{ runner.os }}-${{ runner.arch }}-$DUCKDB_VERSION" | |
| echo "value=${KEY}" >> "${GITHUB_OUTPUT}" | |
| - name: Restore Cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ${{ github.workspace }}/ccache | |
| key: ${{ steps.cache_key.outputs.value }} | |
| - name: Build | |
| shell: bash | |
| run: | | |
| docker run \ | |
| -v.:/duckdb \ | |
| -e GEN=ninja \ | |
| -e CC='ccache gcc' \ | |
| -e CXX='ccache g++' \ | |
| -e CCACHE_DIR=/duckdb/ccache \ | |
| ${{ env.MANYLINUX_IMAGE }} \ | |
| bash -c " | |
| set -e | |
| cat /etc/os-release | |
| dnf install -y \ | |
| ccache \ | |
| ninja-build \ | |
| unixODBC-devel | |
| make -C /duckdb release | |
| " | |
| - name: Save Cache | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: ${{ github.workspace }}/ccache | |
| key: ${{ steps.cache_key.outputs.value }} | |
| - name: List Symbols | |
| run: | | |
| nm -gU ./build/release/libduckdb_odbc.so | |
| - name: ODBC Tests | |
| shell: bash | |
| if: ${{ inputs.skip_tests != 'true' }} | |
| run: | | |
| docker run \ | |
| -v.:/duckdb \ | |
| ${{ env.MANYLINUX_IMAGE }} \ | |
| bash -c " | |
| set -e | |
| cat /etc/os-release | |
| dnf install -y \ | |
| unixODBC-devel | |
| /duckdb/build/release/test/test_odbc | |
| " | |
| - name: Deploy | |
| shell: bash | |
| env: | |
| AWS_ENDPOINT_URL: ${{ secrets.S3_DUCKDB_STAGING_ENDPOINT }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }} | |
| run: | | |
| zip -j duckdb_odbc-linux-arm64.zip build/release/libduckdb_odbc.so linux_setup/unixodbc_setup.sh linux_setup/update_odbc_path.py | |
| ./scripts/upload-assets-to-staging.sh github_release duckdb_odbc-linux-arm64.zip | |
| - name: Upload | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: odbc-linux-arm64 | |
| path: | | |
| duckdb_odbc-linux-arm64.zip | |
| odbc-windows-amd64: | |
| name: Windows (amd64) | |
| runs-on: windows-latest | |
| needs: odbc-linux-amd64 | |
| env: | |
| CC: 'ccache cl' | |
| CXX: 'ccache cl' | |
| CCACHE_DIR: ${{ github.workspace }}/ccache | |
| AZURE_CODESIGN_ENDPOINT: https://eus.codesigning.azure.net/ | |
| AZURE_CODESIGN_ACCOUNT: duckdb-signing-2 | |
| AZURE_CODESIGN_PROFILE: duckdb-certificate-profile | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ inputs.git_ref }} | |
| - name: Dependencies | |
| shell: bash | |
| run: | | |
| choco install \ | |
| ccache \ | |
| wget \ | |
| zip \ | |
| -y --force --no-progress | |
| - name: Cache Key | |
| id: cache_key | |
| shell: bash | |
| run: | | |
| DUCKDB_VERSION=$(python ./scripts/print_duckdb_version.py) | |
| KEY="${{ runner.os }}-${{ runner.arch }}-$DUCKDB_VERSION" | |
| echo "value=${KEY}" >> "${GITHUB_OUTPUT}" | |
| - name: Restore Cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ${{ github.workspace }}/ccache | |
| key: ${{ steps.cache_key.outputs.value }} | |
| - name: Build | |
| shell: cmd | |
| run: | | |
| call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
| mkdir build | |
| cd build | |
| mkdir release | |
| cd release | |
| cmake ../.. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release | |
| cmake --build . --config Release | |
| - name: Save Cache | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: ${{ github.workspace }}/ccache | |
| key: ${{ steps.cache_key.outputs.value }} | |
| - name: List Symbols | |
| shell: cmd | |
| run: | | |
| call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
| dumpbin.exe /imports build\release\bin\duckdb_odbc.dll | |
| dumpbin.exe /exports build\release\bin\duckdb_odbc.dll | |
| - name: Setup ODBC | |
| shell: bash | |
| run: | | |
| ./build/release/bin/odbc_install.exe //CI //Install | |
| Reg Query "HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources" | |
| Reg Query "HKLM\SOFTWARE\ODBC\ODBC.INI\DuckDB" | |
| Reg Query "HKLM\SOFTWARE\ODBC\ODBCINST.INI\DuckDB Driver" | |
| - name: Enable ODBC Trace HKCU | |
| shell: bash | |
| run: | | |
| REG ADD "HKCU\SOFTWARE\ODBC\ODBC.INI\ODBC" //f | |
| REG ADD "HKCU\SOFTWARE\ODBC\ODBC.INI\ODBC" //v Trace //t REG_SZ //d 1 | |
| REG ADD "HKCU\SOFTWARE\ODBC\ODBC.INI\ODBC" //v TraceDll //t REG_SZ //d "C:\Windows\system32\odbctrac.dll" | |
| REG ADD "HKCU\SOFTWARE\ODBC\ODBC.INI\ODBC" //v TraceFile //t REG_SZ //d "D:\a\duckdb-odbc\duckdb-odbc\ODBC_TRACE.log" | |
| echo "----------------------------------------------------------------" | |
| Reg Query "HKCU\SOFTWARE\ODBC\ODBC.INI\ODBC" | |
| - name: Test Standard ODBC tests | |
| if: ${{ inputs.skip_tests != 'true' }} | |
| shell: bash | |
| run: | | |
| ./build/release/bin/test_odbc.exe | |
| - name: Test Standard ODBC tests with VS2019 C++ stdlib | |
| if: ${{ inputs.skip_tests != 'true' }} | |
| shell: bash | |
| run: | | |
| wget -P build/release/bin https://blobs.duckdb.org/ci/msvcp140.dll | |
| ./build/release/bin/test_odbc.exe | |
| rm build/release/bin/msvcp140.dll | |
| - name: Test PyODBC | |
| if: ${{ inputs.skip_tests != 'true' }} | |
| shell: bash | |
| run: | | |
| pip install pyodbc | |
| python ./test/pyodbc-test.py | |
| - name: Setup Register For Connection Tests | |
| shell: bash | |
| run: | | |
| python ./scripts/create_ini_reg.py | |
| echo "----------------------------------------------------------------" | |
| Reg Query "HKCU\SOFTWARE\ODBC\ODBC.INI\DuckDB" | |
| - name: Test Connection ODBC tests | |
| if: ${{ inputs.skip_tests != 'true' }} | |
| shell: bash | |
| run: | | |
| ./build/release/bin/test_connection_odbc.exe | |
| - name: Print ODBC trace on failure | |
| if: ${{ failure() }} | |
| shell: bash | |
| run: cat ODBC_TRACE.log | |
| - name: Sign files with Azure Trusted Signing (TM) | |
| if: github.repository == 'duckdb/duckdb-odbc' && 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_ENDPOINT_URL: ${{ secrets.S3_DUCKDB_STAGING_ENDPOINT }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }} | |
| run: | | |
| zip -j duckdb_odbc-windows-amd64.zip \ | |
| ./build/release/bin/duckdb_odbc.dll \ | |
| ./build/release/bin/duckdb_odbc_setup.dll \ | |
| ./build/release/bin/odbc_install.exe | |
| ./scripts/upload-assets-to-staging.sh github_release duckdb_odbc-windows-amd64.zip | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: odbc-windows-amd64 | |
| path: | | |
| duckdb_odbc-windows-amd64.zip | |
| odbc-windows-arm64: | |
| name: Windows (aarch64) | |
| runs-on: windows-11-arm | |
| needs: odbc-linux-amd64 | |
| env: | |
| CC: 'ccache cl' | |
| CXX: 'ccache cl' | |
| CCACHE_DIR: ${{ github.workspace }}/ccache | |
| AZURE_CODESIGN_ENDPOINT: https://eus.codesigning.azure.net/ | |
| AZURE_CODESIGN_ACCOUNT: duckdb-signing-2 | |
| AZURE_CODESIGN_PROFILE: duckdb-certificate-profile | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ inputs.git_ref }} | |
| - name: Dependencies | |
| shell: bash | |
| run: | | |
| choco install \ | |
| ccache \ | |
| wget \ | |
| zip \ | |
| -y --force --no-progress | |
| - name: Cache Key | |
| id: cache_key | |
| shell: bash | |
| run: | | |
| DUCKDB_VERSION=$(python ./scripts/print_duckdb_version.py) | |
| KEY="${{ runner.os }}-${{ runner.arch }}-$DUCKDB_VERSION" | |
| echo "value=${KEY}" >> "${GITHUB_OUTPUT}" | |
| - name: Restore Cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ${{ github.workspace }}/ccache | |
| key: ${{ steps.cache_key.outputs.value }} | |
| - name: Build | |
| shell: cmd | |
| run: | | |
| call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsarm64.bat" | |
| mkdir build | |
| cd build | |
| mkdir release | |
| cd release | |
| cmake ../.. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release | |
| cmake --build . --config Release | |
| - name: Save Cache | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: ${{ github.workspace }}/ccache | |
| key: ${{ steps.cache_key.outputs.value }} | |
| - name: List Symbols | |
| shell: cmd | |
| run: | | |
| call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsarm64.bat" | |
| dumpbin.exe /imports build\release\bin\duckdb_odbc.dll | |
| dumpbin.exe /exports build\release\bin\duckdb_odbc.dll | |
| - name: Setup ODBC | |
| shell: bash | |
| run: | | |
| ./build/release/bin/odbc_install.exe //CI //Install | |
| Reg Query "HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources" | |
| Reg Query "HKLM\SOFTWARE\ODBC\ODBC.INI\DuckDB" | |
| Reg Query "HKLM\SOFTWARE\ODBC\ODBCINST.INI\DuckDB Driver" | |
| - name: Enable ODBC Trace HKCU | |
| shell: bash | |
| run: | | |
| REG ADD "HKCU\SOFTWARE\ODBC\ODBC.INI\ODBC" //f | |
| REG ADD "HKCU\SOFTWARE\ODBC\ODBC.INI\ODBC" //v Trace //t REG_SZ //d 1 | |
| REG ADD "HKCU\SOFTWARE\ODBC\ODBC.INI\ODBC" //v TraceDll //t REG_SZ //d "C:\Windows\system32\odbctrac.dll" | |
| REG ADD "HKCU\SOFTWARE\ODBC\ODBC.INI\ODBC" //v TraceFile //t REG_SZ //d "D:\a\duckdb-odbc\duckdb-odbc\ODBC_TRACE.log" | |
| echo "----------------------------------------------------------------" | |
| Reg Query "HKCU\SOFTWARE\ODBC\ODBC.INI\ODBC" | |
| - name: Test Standard ODBC tests | |
| if: ${{ inputs.skip_tests != 'true' }} | |
| shell: bash | |
| run: | | |
| ./build/release/bin/test_odbc.exe | |
| - name: Test PyODBC | |
| if: ${{ inputs.skip_tests != 'true' }} | |
| shell: bash | |
| run: | | |
| pip install pyodbc | |
| python ./test/pyodbc-test.py | |
| - name: Setup Register For Connection Tests | |
| shell: bash | |
| run: | | |
| python ./scripts/create_ini_reg.py | |
| echo "----------------------------------------------------------------" | |
| Reg Query "HKCU\SOFTWARE\ODBC\ODBC.INI\DuckDB" | |
| - name: Test Connection ODBC tests | |
| if: ${{ inputs.skip_tests != 'true' }} | |
| shell: bash | |
| run: | | |
| ./build/release/bin/test_connection_odbc.exe | |
| - name: Print ODBC trace on failure | |
| if: ${{ failure() }} | |
| shell: bash | |
| run: cat ODBC_TRACE.log | |
| - name: Sign files with Azure Trusted Signing (TM) | |
| if: github.repository == 'duckdb/duckdb-odbc' && 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_ENDPOINT_URL: ${{ secrets.S3_DUCKDB_STAGING_ENDPOINT }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }} | |
| run: | | |
| zip -j duckdb_odbc-windows-arm64.zip \ | |
| ./build/release/bin/duckdb_odbc.dll \ | |
| ./build/release/bin/duckdb_odbc_setup.dll \ | |
| ./build/release/bin/odbc_install.exe | |
| ./scripts/upload-assets-to-staging.sh github_release duckdb_odbc-windows-arm64.zip | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: odbc-windows-arm64 | |
| path: | | |
| duckdb_odbc-windows-arm64.zip | |
| odbc-osx-universal: | |
| name: macOS (Universal) | |
| runs-on: macos-latest | |
| env: | |
| GEN: ninja | |
| CC: 'ccache clang' | |
| CXX: 'ccache clang++' | |
| CCACHE_DIR: ${{ github.workspace }}/ccache | |
| ODBC_CONFIG: ${{ github.workspace }}/build/unixodbc/build/bin/odbc_config | |
| OSX_BUILD_UNIVERSAL: 1 | |
| needs: odbc-linux-amd64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ inputs.git_ref }} | |
| - name: Dependencies | |
| run: | | |
| brew install -q \ | |
| ccache \ | |
| ninja | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.14" | |
| - name: Cache Key | |
| id: cache_key | |
| run: | | |
| DUCKDB_VERSION=$(python3 ./scripts/print_duckdb_version.py) | |
| KEY="${{ runner.os }}-${{ runner.arch }}-$DUCKDB_VERSION" | |
| echo "value=${KEY}" >> "${GITHUB_OUTPUT}" | |
| - name: Restore Cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ${{ github.workspace }}/ccache | |
| key: ${{ steps.cache_key.outputs.value }} | |
| - name: Install UnixODBC | |
| shell: bash | |
| run: CFLAGS="-arch x86_64 -arch arm64" ./scripts/install_unixodbc.sh | |
| - name: Build | |
| shell: bash | |
| run: make release | |
| - name: Save Cache | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: ${{ github.workspace }}/ccache | |
| key: ${{ steps.cache_key.outputs.value }} | |
| - name: List Dependencies | |
| run: | | |
| otool -L ./build/release/libduckdb_odbc.dylib | |
| - name: List Symbols | |
| run: | | |
| nm -gU ./build/release/libduckdb_odbc.dylib | |
| - name: ODBC Tests | |
| if: ${{ inputs.skip_tests != 'true' }} | |
| shell: bash | |
| run: | | |
| ./build/release/test/test_odbc | |
| - name: See if this actually universal | |
| shell: bash | |
| run: | | |
| lipo -archs build/release/libduckdb_odbc.dylib | grep "x86_64 arm64" | |
| - name: Deploy | |
| env: | |
| AWS_ENDPOINT_URL: ${{ secrets.S3_DUCKDB_STAGING_ENDPOINT }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }} | |
| run: | | |
| zip -j duckdb_odbc-osx-universal.zip build/release/libduckdb_odbc.dylib | |
| ./scripts/upload-assets-to-staging.sh github_release duckdb_odbc-osx-universal.zip | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: odbc-osx-universal | |
| path: | | |
| duckdb_odbc-osx-universal.zip | |
| debug: | |
| name: Debug Tests | |
| runs-on: ubuntu-22.04 | |
| needs: odbc-linux-amd64 | |
| env: | |
| GEN: ninja | |
| CC: 'ccache gcc' | |
| CXX: 'ccache g++' | |
| CCACHE_DIR: ${{ github.workspace }}/ccache | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Dependencies | |
| run: | | |
| echo "set man-db/auto-update false" | sudo debconf-communicate | |
| sudo dpkg-reconfigure man-db | |
| sudo apt-get update -y -q -o=Dpkg::Use-Pty=0 | |
| sudo apt-get install -y -q -o=Dpkg::Use-Pty=0 \ | |
| ccache \ | |
| dotnet-sdk-8.0 \ | |
| ninja-build \ | |
| odbcinst \ | |
| unixodbc-dev | |
| - name: Cache Key | |
| id: cache_key | |
| run: | | |
| DUCKDB_VERSION=$(python ./scripts/print_duckdb_version.py) | |
| KEY="${{ runner.os }}-${{ runner.arch }}-$DUCKDB_VERSION" | |
| echo "value=${KEY}" >> "${GITHUB_OUTPUT}" | |
| - name: Restore Cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ${{ github.workspace }}/ccache | |
| key: ${{ steps.cache_key.outputs.value }}-debug | |
| - name: Install PyODBC | |
| run: | | |
| pip3 install pyodbc | |
| - name: Install nanodbc | |
| run: | | |
| wget https://github.com/nanodbc/nanodbc/archive/refs/tags/v2.14.0.tar.gz -O nanodbc.tgz | |
| mkdir nanodbc | |
| tar xvf nanodbc.tgz -C nanodbc --strip-components=1 | |
| cd nanodbc | |
| wget https://github.com/catchorg/Catch2/releases/download/v2.13.9/catch.hpp | |
| cp catch.hpp test/catch/catch.hpp | |
| sed -i -e "s/set(test_list/set(test_list odbc/" test/CMakeLists.txt | |
| mkdir build | |
| cd build | |
| cmake -DNANODBC_DISABLE_TESTS=OFF .. | |
| cmake --build . | |
| - name: Build | |
| shell: bash | |
| run: make debug | |
| - name: Save Cache | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: ${{ github.workspace }}/ccache | |
| key: ${{ steps.cache_key.outputs.value }}-debug | |
| - name: Test Standard ODBC tests | |
| shell: bash | |
| run: build/debug/test/test_odbc | |
| - name: Test Connection ODBC tests | |
| shell: bash | |
| run: | | |
| chmod +x scripts/create_ini_file.sh | |
| scripts/create_ini_file.sh | |
| build/debug/test/test_connection_odbc | |
| - name: Test nanodbc | |
| shell: bash | |
| run: ./test/run_nanodbc_tests.sh | |
| - name: Test isql | |
| shell: bash | |
| run: ./test/run_isql_tests.sh | |
| - name: Test R ODBC | |
| shell: bash | |
| run: R -f test/rodbc.R | |
| - name: Test Python ODBC | |
| shell: bash | |
| run: ./test/run_pyodbc_tests.sh | |
| - name: Test .NET Linux ODBC | |
| shell: bash | |
| working-directory: ./test/tests/dotnet-linux | |
| run: dotnet run | |
| odbc-merge-vendoring-pr: | |
| name: Merge vendoring PR | |
| if: ${{ github.repository == 'duckdb/duckdb-odbc' && github.event_name == 'pull_request' && github.head_ref == format('vendoring-{0}', github.base_ref) }} | |
| needs: | |
| - odbc-linux-amd64 | |
| - odbc-linux-aarch64 | |
| - odbc-windows-amd64 | |
| - odbc-windows-arm64 | |
| - odbc-osx-universal | |
| - debug | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Merge vendoring PR | |
| id: merge_vendoring_pr | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| echo "Merging PR number: ${{ github.event.pull_request.number }} with message: ${{ github.event.pull_request.title }}" | |
| gh pr merge vendoring-${{ github.base_ref }} \ | |
| --rebase \ | |
| --subject "${{ github.event.pull_request.title }}" \ | |
| --body "" | |
| - name: Update vendoring branch | |
| id: update_vendoring_branch | |
| if: ${{ steps.merge_vendoring_pr.outcome == 'success' }} | |
| run: | | |
| # Delete vendoring-${{ github.base_ref }} branch and re-create it for future PRs | |
| git push --delete origin vendoring-${{ github.base_ref }} | |
| git checkout --track origin/${{ github.base_ref }} | |
| git pull --ff-only | |
| git branch vendoring-${{ github.base_ref }} | |
| git push origin vendoring-${{ github.base_ref }} |