-
Notifications
You must be signed in to change notification settings - Fork 38
214 lines (187 loc) · 6.99 KB
/
ci.yml
File metadata and controls
214 lines (187 loc) · 6.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
name: TileDB Python CI
# This workflow has two modes:
# 1. Default: Builds TileDB-Py normally using pre-built TileDB Core binaries.
# 2. Custom TileDB: When 'libtiledb_ref' is specified via workflow_dispatch, it builds TileDB Core
# from source at the specified ref (branch/tag/commit) and builds TileDB-Py against it.
on:
push:
branches: ["main", "release-*"]
tags: ["*"]
pull_request:
branches: ["*"]
workflow_dispatch:
inputs:
libtiledb_ref:
description: 'TileDB Core ref (branch/tag/commit) to build against'
required: false
type: string
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
S3_BUCKET: ${{ vars.S3_BUCKET }}
TILEDB_NAMESPACE: ${{ vars.TILEDB_NAMESPACE }}
TILEDB_TOKEN: ${{ secrets.TILEDB_TOKEN }}
jobs:
build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
matrix:
os:
- ubuntu-latest
- macos-15-intel
- macos-26
- windows-latest
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
fail-fast: false
env:
MACOSX_DEPLOYMENT_TARGET: "11"
steps:
- name: Checkout TileDB-Py `main`
uses: actions/checkout@v6
- name: Checkout TileDB Core
if: inputs.libtiledb_ref
uses: actions/checkout@v6
with:
repository: TileDB-Inc/TileDB
ref: ${{ inputs.libtiledb_ref }}
path: _tiledb_core
- name: Clone vcpkg
if: inputs.libtiledb_ref
run: |
git clone https://github.com/microsoft/vcpkg.git $RUNNER_TEMP/vcpkg
$RUNNER_TEMP/vcpkg/bootstrap-vcpkg.sh -disableMetrics
- name: Setup MSVC toolset (VS 2022)
uses: TheMrMilchmann/setup-msvc-dev@v3
if: startsWith(matrix.os, 'windows')
with:
arch: x64
- name: Install Ninja (VS 2022)
uses: seanmiddleditch/gha-setup-ninja@v4
if: startsWith(matrix.os, 'windows')
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Print Python version
run: |
which python
which pip
python --version
- name: Print env
run: printenv
- name: Print pip debug info
run: pip debug --verbose
# Remove after upstream PR fully-deployed:
# - https://github.com/actions/runner-images/pull/7125
- name: "Install homebrew dependencies"
run: brew install pkg-config
if: startsWith(matrix.os, 'macos')
- name: "Install libfaketime (Linux only)"
if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: |
git clone https://github.com/wolfcw/libfaketime/
cd libfaketime
sudo make install
cd ..
- name: "Build and Install TileDB Core"
if: inputs.libtiledb_ref
run: |
# Configure with vcpkg on all platforms
CMAKE_ARGS=(
-S _tiledb_core
-B _tiledb_core/build
-DCMAKE_BUILD_TYPE=Release
-DBUILD_SHARED_LIBS=ON
-DCMAKE_INSTALL_PREFIX="${GITHUB_WORKSPACE//\\//}/_tiledb_core/dist"
-DTILEDB_INSTALL_LIBDIR=lib
-DTILEDB_SERIALIZATION=ON
-DTILEDB_TESTS=OFF
-DCMAKE_TOOLCHAIN_FILE="${RUNNER_TEMP//\\//}/vcpkg/scripts/buildsystems/vcpkg.cmake"
)
cmake "${CMAKE_ARGS[@]}"
cmake --build _tiledb_core/build --config Release -j4 --target install
- name: "Build and Install TileDB-Py"
run: |
if [[ -n "${{ inputs.libtiledb_ref }}" ]]; then
# Build against custom TileDB
export TILEDB_PATH="${GITHUB_WORKSPACE//\\//}/_tiledb_core/dist"
fi
# Install TileDB-Py (uses custom TileDB if TILEDB_PATH is set, otherwise uses default)
python -m pip install --verbose .[test]
- name: "Copy TileDB DLLs to package (Windows)"
if: inputs.libtiledb_ref && runner.os == 'Windows'
run: |
$WORKSPACE = "${{ github.workspace }}".Replace('/', '\')
$SITE_PACKAGES = python -c "import sysconfig; print(sysconfig.get_path('purelib'))"
Write-Host "Copying DLLs from $WORKSPACE\_tiledb_core\dist\bin to $SITE_PACKAGES\tiledb\"
Copy-Item "$WORKSPACE\_tiledb_core\dist\bin\*.dll" "$SITE_PACKAGES\tiledb\" -Verbose -ErrorAction Stop
$VCPKG_BIN = "$WORKSPACE\_tiledb_core\build\vcpkg_installed\x64-windows\bin"
if (Test-Path $VCPKG_BIN) {
Write-Host "Copying vcpkg DLLs from $VCPKG_BIN"
Copy-Item "$VCPKG_BIN\*.dll" "$SITE_PACKAGES\tiledb\" -Verbose -ErrorAction Stop
} else {
Write-Host "Warning: vcpkg bin directory not found at $VCPKG_BIN - skipping vcpkg DLL copy"
}
Write-Host "DLL copy completed successfully"
shell: powershell
- name: "Run tests"
run: |
PROJECT_CWD=$PWD
rm tiledb/__init__.py
cd $RUNNER_TEMP
pytest -vv --showlocals $PROJECT_CWD
- name: "Re-run tests without pandas"
run: |
PROJECT_CWD=$PWD
pip uninstall -y pandas
cd $RUNNER_TEMP
pytest -vv --showlocals $PROJECT_CWD
- name: "Print log files (failed build only)"
run: |
set -xeo pipefail
# Display log files if the build failed
echo 'Dumping log files for failed build'
echo '----------------------------------'
for f in $(find build -name *.log);
do echo '------'
echo $f
echo '======'
cat $f
done;
if: failure()
- name: "Upload build logs"
if: always()
uses: actions/upload-artifact@v5
with:
name: build-logs-${{ matrix.os }}-${{ matrix.python-version }}
path: |
build/**/*.log
_tiledb_core/build/*.log
_tiledb_core/build/CMakeFiles/CMake*.log
_tiledb_core/build/CMakeFiles/CMake*.yaml
if-no-files-found: ignore
- name: "Upload crash dumps (Linux)"
if: always() && startsWith(matrix.os, 'ubuntu-')
uses: actions/upload-artifact@v5
with:
name: coredumps-${{ matrix.os }}-${{ matrix.python-version }}
path: /var/lib/apport/coredump/
if-no-files-found: ignore
- name: "Upload crash dumps (macOS)"
if: always() && startsWith(matrix.os, 'macos-')
uses: actions/upload-artifact@v5
with:
name: coredumps-${{ matrix.os }}-${{ matrix.python-version }}
path: /cores/
if-no-files-found: ignore
- name: "Upload crash dumps (Windows)"
if: always() && startsWith(matrix.os, 'windows-')
uses: actions/upload-artifact@v5
with:
name: crashdumps-${{ matrix.os }}-${{ matrix.python-version }}
path: ${{ env.LOCALAPPDATA }}/CrashDumps/*.dmp
if-no-files-found: ignore