11name : TileDB Python CI
22
3+ # This workflow has two modes:
4+ # 1. Default: Builds TileDB-Py normally using pre-built TileDB Core binaries.
5+ # 2. Custom TileDB: When 'libtiledb_ref' is specified via workflow_dispatch, it builds TileDB Core
6+ # from source at the specified ref (branch/tag/commit) and builds TileDB-Py against it.
7+
38on :
49 push :
510 branches : ["main", "release-*"]
611 tags : ["*"]
712 pull_request :
813 branches : ["*"]
914 workflow_dispatch :
15+ inputs :
16+ libtiledb_ref :
17+ description : ' TileDB Core ref (branch/tag/commit) to build against'
18+ required : false
19+ type : string
1020
1121concurrency :
1222 group : ${{ github.head_ref || github.run_id }}
3848 - name : Checkout TileDB-Py `main`
3949 uses : actions/checkout@v4
4050
51+ - name : Checkout TileDB Core
52+ if : inputs.libtiledb_ref
53+ uses : actions/checkout@v4
54+ with :
55+ repository : TileDB-Inc/TileDB
56+ ref : ${{ inputs.libtiledb_ref }}
57+ path : _tiledb_core
58+
59+ - name : Clone vcpkg
60+ if : inputs.libtiledb_ref
61+ run : |
62+ git clone https://github.com/microsoft/vcpkg.git $RUNNER_TEMP/vcpkg
63+ $RUNNER_TEMP/vcpkg/bootstrap-vcpkg.sh -disableMetrics
64+
4165 - name : Setup MSVC toolset (VS 2022)
4266 uses : TheMrMilchmann/setup-msvc-dev@v3
4367 if : startsWith(matrix.os, 'windows')
@@ -79,23 +103,64 @@ jobs:
79103 sudo make install
80104 cd ..
81105
106+ - name : " Build and Install TileDB Core"
107+ if : inputs.libtiledb_ref
108+ run : |
109+ # Configure with vcpkg on all platforms
110+ CMAKE_ARGS=(
111+ -S _tiledb_core
112+ -B _tiledb_core/build
113+ -DCMAKE_BUILD_TYPE=Release
114+ -DBUILD_SHARED_LIBS=ON
115+ -DCMAKE_INSTALL_PREFIX="${GITHUB_WORKSPACE//\\//}/_tiledb_core/dist"
116+ -DTILEDB_INSTALL_LIBDIR=lib
117+ -DTILEDB_SERIALIZATION=ON
118+ -DTILEDB_TESTS=OFF
119+ -DCMAKE_TOOLCHAIN_FILE="${RUNNER_TEMP//\\//}/vcpkg/scripts/buildsystems/vcpkg.cmake"
120+ )
121+
122+ cmake "${CMAKE_ARGS[@]}"
123+ cmake --build _tiledb_core/build --config Release -j4 --target install
124+
82125 - name : " Build and Install TileDB-Py"
83- # We use pipx here to produce wheel/sdist to upload as artifact in case of error
84126 run : |
85- pipx run --python ${{ matrix.python-version }} build
86- WHEEL_NAME=$(ls dist/*.whl)
87- pip install --verbose ${WHEEL_NAME}[test]
127+ if [[ -n "${{ inputs.libtiledb_ref }}" ]]; then
128+ # Build against custom TileDB
129+ export TILEDB_PATH="${GITHUB_WORKSPACE//\\//}/_tiledb_core/dist"
130+ fi
131+ # Install TileDB-Py (uses custom TileDB if TILEDB_PATH is set, otherwise uses default)
132+ python -m pip install --verbose .[test]
133+
134+ - name : " Copy TileDB DLLs to package (Windows)"
135+ if : inputs.libtiledb_ref && runner.os == 'Windows'
136+ run : |
137+ $WORKSPACE = "${{ github.workspace }}".Replace('/', '\')
138+ $SITE_PACKAGES = python -c "import sysconfig; print(sysconfig.get_path('purelib'))"
139+ Write-Host "Copying DLLs from $WORKSPACE\_tiledb_core\dist\bin to $SITE_PACKAGES\tiledb\"
140+ Copy-Item "$WORKSPACE\_tiledb_core\dist\bin\*.dll" "$SITE_PACKAGES\tiledb\" -Verbose -ErrorAction Stop
141+
142+ $VCPKG_BIN = "$WORKSPACE\_tiledb_core\build\vcpkg_installed\x64-windows\bin"
143+ if (Test-Path $VCPKG_BIN) {
144+ Write-Host "Copying vcpkg DLLs from $VCPKG_BIN"
145+ Copy-Item "$VCPKG_BIN\*.dll" "$SITE_PACKAGES\tiledb\" -Verbose -ErrorAction Stop
146+ } else {
147+ Write-Host "Warning: vcpkg bin directory not found at $VCPKG_BIN - skipping vcpkg DLL copy"
148+ }
149+ Write-Host "DLL copy completed successfully"
150+ shell : powershell
88151
89152 - name : " Run tests"
90153 run : |
91154 PROJECT_CWD=$PWD
92155 rm tiledb/__init__.py
93- cd /tmp
156+ cd $RUNNER_TEMP
94157 pytest -vv --showlocals $PROJECT_CWD
95158
96159 - name : " Re-run tests without pandas"
97160 run : |
161+ PROJECT_CWD=$PWD
98162 pip uninstall -y pandas
163+ cd $RUNNER_TEMP
99164 pytest -vv --showlocals $PROJECT_CWD
100165
101166 - name : " Print log files (failed build only)"
@@ -112,9 +177,38 @@ jobs:
112177 done;
113178 if : failure()
114179
115- - name : " Upload files for debug "
180+ - name : " Upload build logs "
116181 if : always()
117182 uses : actions/upload-artifact@v4
118183 with :
119- name : cibw-wheels-${{ matrix.os }}-${{ matrix.python-version }}
120- path : " ."
184+ name : build-logs-${{ matrix.os }}-${{ matrix.python-version }}
185+ path : |
186+ build/**/*.log
187+ _tiledb_core/build/*.log
188+ _tiledb_core/build/CMakeFiles/CMake*.log
189+ _tiledb_core/build/CMakeFiles/CMake*.yaml
190+ if-no-files-found : ignore
191+
192+ - name : " Upload crash dumps (Linux)"
193+ if : always() && startsWith(matrix.os, 'ubuntu-')
194+ uses : actions/upload-artifact@v4
195+ with :
196+ name : coredumps-${{ matrix.os }}-${{ matrix.python-version }}
197+ path : /var/lib/apport/coredump/
198+ if-no-files-found : ignore
199+
200+ - name : " Upload crash dumps (macOS)"
201+ if : always() && startsWith(matrix.os, 'macos-')
202+ uses : actions/upload-artifact@v4
203+ with :
204+ name : coredumps-${{ matrix.os }}-${{ matrix.python-version }}
205+ path : /cores/
206+ if-no-files-found : ignore
207+
208+ - name : " Upload crash dumps (Windows)"
209+ if : always() && startsWith(matrix.os, 'windows-')
210+ uses : actions/upload-artifact@v4
211+ with :
212+ name : crashdumps-${{ matrix.os }}-${{ matrix.python-version }}
213+ path : ${{ env.LOCALAPPDATA }}/CrashDumps/*.dmp
214+ if-no-files-found : ignore
0 commit comments