-
Notifications
You must be signed in to change notification settings - Fork 145
515 lines (486 loc) · 19.3 KB
/
ci.yml
File metadata and controls
515 lines (486 loc) · 19.3 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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
name: Linters and Tests
# Concurrency control:
# - PRs: new commits on a feature branch will cancel in-progress (outdated) runs.
# - Push to develop: runs queue sequentially, never cancelled.
# - `workflow_dispatch`: groups by branch and queues if run on develop.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
on:
push:
branches: [develop]
pull_request: { }
workflow_dispatch: { }
permissions:
actions: read
contents: read
checks: write # audit-check creates checks
issues: write # audit-check creates issues
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
NIGHTLY_TOOLCHAIN: nightly-2026-02-05
jobs:
lint-toml:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- uses: spiraldb/actions/.github/actions/lint-toml@0.18.5
validate-workflow-yaml:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- name: Validate YAML file
run: |
# Lint the workflows and yamllint's configuration file.
yamllint \
--strict \
-c .yamllint.yaml \
.github/
python-lint:
name: "Python (lint)"
runs-on: >-
${{ github.repository == 'vortex-data/vortex'
&& format('runs-on={0}/runner=amd64-medium/image=ubuntu24-full-x64-pre-v2/tag=python-lint', github.run_id)
|| 'ubuntu-latest' }}
timeout-minutes: 10
steps:
- uses: runs-on/action@v2
if: github.repository == 'vortex-data/vortex'
with:
sccache: s3
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-prebuild
# Use uvx for ruff to avoid building the Rust extension (saves ~4.5 min)
- name: Python Lint - Format
run: uvx ruff format --check .
- name: Python Lint - Ruff
run: uvx ruff check .
# PyRight needs the project for type information, so use uv run
- name: Python Lint - PyRight
env:
MATURIN_PEP517_ARGS: "--profile ci"
run: |
uv sync --all-packages
uv run basedpyright vortex-python
python-test:
name: "Python (test)"
runs-on: >-
${{ github.repository == 'vortex-data/vortex'
&& format('runs-on={0}/runner=amd64-large/image=ubuntu24-full-x64-pre-v2/tag=python-test', github.run_id)
|| 'ubuntu-latest' }}
timeout-minutes: 30
env:
RUST_LOG: "info,maturin=off,uv=debug"
MATURIN_PEP517_ARGS: "--profile ci"
steps:
- uses: runs-on/action@v2
if: github.repository == 'vortex-data/vortex'
with:
sccache: s3
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-prebuild
- name: Pytest - Vortex
run: |
uv run --all-packages pytest --benchmark-disable -n auto test/
working-directory: vortex-python/
- name: Setup benchmark environment
run: sudo bash scripts/setup-benchmark.sh
- name: Pytest Benchmarks - Vortex
run: |
bash ../scripts/bench-taskset.sh uv run --all-packages pytest --benchmark-only benchmark/
working-directory: vortex-python/
- name: Doctest - PyVortex
run: |
uv run --all-packages make doctest
working-directory: docs/
- name: Ensure docs build - PyVortex
run: |
uv run --all-packages make html
working-directory: docs/
rust-docs:
name: "Rust (docs)"
timeout-minutes: 30
runs-on: >-
${{ github.repository == 'vortex-data/vortex'
&& format('runs-on={0}/runner=amd64-small/image=ubuntu24-full-x64-pre-v2/tag=rust-docs', github.run_id)
|| 'ubuntu-latest' }}
steps:
- uses: runs-on/action@v2
if: github.repository == 'vortex-data/vortex'
with:
sccache: s3
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-prebuild
- name: Docs
run: |
RUSTDOCFLAGS="-D warnings" cargo doc --profile ci --no-deps
# nextest doesn't support doc tests, so we run it here
cargo test --profile ci --doc --workspace --all-features --exclude vortex-cxx --exclude vortex-jni --exclude vortex-ffi --exclude xtask --no-fail-fast
build-rust:
name: "Rust build (${{matrix.config.name}})"
timeout-minutes: 30
runs-on: >-
${{ github.repository == 'vortex-data/vortex'
&& format('runs-on={0}/runner={1}/image=ubuntu24-full-x64-pre-v2/tag={2}', github.run_id, matrix.config.runner, matrix.config.name)
|| 'ubuntu-latest' }}
env:
# disable lints for build, they will be caught in Rust lint job.
RUSTFLAGS: "-A warnings"
strategy:
fail-fast: false
matrix:
config:
- name: "all-features"
runner: amd64-large
args: "--all-features --all-targets"
- name: "default features"
runner: amd64-large
args: "--all-targets"
- name: "with tokio dispatcher"
runner: amd64-small
# Only build the crates that have the tokio features, not re-building other crates with no-default-features
args: "--no-default-features --features tokio --all-targets -p vortex -p vortex-io -p vortex-file -p vortex-layout"
- name: "wasm32 with default features"
runner: amd64-medium
target: wasm32-unknown-unknown
env:
rustflags: "RUSTFLAGS='-A warnings --cfg getrandom_backend=\"unsupported\"'"
args: "--target wasm32-unknown-unknown --exclude vortex --exclude vortex-cuda --exclude vortex-cub --exclude vortex-nvcomp --exclude vortex-datafusion --exclude vortex-duckdb --exclude vortex-tui --exclude vortex-zstd --exclude vortex-test-e2e-cuda --exclude vortex-sqllogictest"
steps:
- uses: runs-on/action@v2
if: github.repository == 'vortex-data/vortex'
with:
sccache: s3
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-prebuild
- name: Install wasm32 target
if: ${{ matrix.config.target == 'wasm32-unknown-unknown' }}
run: rustup target add wasm32-unknown-unknown
- uses: ./.github/actions/check-rebuild
with:
command: "${{matrix.config.env.rustflags}} cargo hack build --profile ci --locked ${{matrix.config.args}} --ignore-private"
- name: "Make sure no files changed after build"
run: |
git status --porcelain
test -z "$(git status --porcelain)"
check-min-deps:
name: "Check build with minimal dependencies"
timeout-minutes: 30
runs-on: >-
${{ github.repository == 'vortex-data/vortex'
&& format('runs-on={0}/runner=amd64-medium/image=ubuntu24-full-x64-pre-v2/tag=rust-min-deps', github.run_id)
|| 'ubuntu-latest' }}
steps:
- uses: runs-on/action@v2
if: github.repository == 'vortex-data/vortex'
with:
sccache: s3
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-prebuild
- run: cargo minimal-versions check --direct --workspace --ignore-private
rust-lint:
name: "Rust (lint)"
timeout-minutes: 30
runs-on: >-
${{ github.repository == 'vortex-data/vortex'
&& format('runs-on={0}/runner=amd64-large/image=ubuntu24-full-x64-pre-v2/tag=rust-lint', github.run_id)
|| 'ubuntu-latest' }}
steps:
- uses: runs-on/action@v2
if: github.repository == 'vortex-data/vortex'
with:
sccache: s3
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-prebuild
- name: Install nightly for fmt
run: rustup toolchain install $NIGHTLY_TOOLCHAIN --component rustfmt
- name: Rust Lint - Format
run: cargo +$NIGHTLY_TOOLCHAIN fmt --all --check
- name: Rustc check
run: RUSTFLAGS="-D warnings" cargo check --profile ci --locked --all-features --all-targets
- name: Rustc check (release)
run: RUSTFLAGS="-D warnings" cargo check --locked --all-features --all-targets --release
- name: Rust Lint - Clippy All Features
run: cargo clippy --profile ci --locked --all-features --all-targets -- -D warnings
- name: Rust Lint - Clippy Default Features
run: cargo clippy --profile ci --locked --all-targets -- -D warnings
cpp-lint:
name: "C/C++ (lint)"
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- name: C/C++ Lint - clang-format
run: |
git ls-files vortex-cuda vortex-cxx vortex-duckdb vortex-ffi \
| grep -E '\.(cpp|hpp|cu|cuh|h)$' \
| grep -v 'kernels/src/bit_unpack_.*\.cu$' \
| grep -v 'kernels/src/bit_unpack_.*_lanes\.cuh$' \
| xargs clang-format --dry-run --Werror --style=file
rust-lint-no-default:
name: "Rust (lint, no default)"
timeout-minutes: 30
runs-on: >-
${{ github.repository == 'vortex-data/vortex'
&& format('runs-on={0}/runner=amd64-medium/image=ubuntu24-full-x64-pre-v2/tag=rust-lint-no-default', github.run_id)
|| 'ubuntu-latest' }}
steps:
- uses: runs-on/action@v2
if: github.repository == 'vortex-data/vortex'
with:
sccache: s3
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-prebuild
- name: Rust Lint - Clippy No Default Features
shell: bash
run: |
cargo hack --no-dev-deps --ignore-private clippy --profile ci --no-default-features -- -D warnings
public-api:
name: "Public API lock files"
timeout-minutes: 30
runs-on: >-
${{ github.repository == 'vortex-data/vortex'
&& format('runs-on={0}/runner=amd64-xsmall/image=ubuntu24-full-x64-pre-v2/tag=public-api', github.run_id)
|| 'ubuntu-latest' }}
steps:
- uses: runs-on/action@v2
if: github.repository == 'vortex-data/vortex'
with:
sccache: s3
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-prebuild
- name: Install nightly for public-api
run: rustup toolchain install $NIGHTLY_TOOLCHAIN
- name: Regenerate public API lock files
run: cargo +$NIGHTLY_TOOLCHAIN run --profile ci -p xtask -- public-api
- name: Verify lock files are up to date
run: |
if ! git diff --quiet '**/public-api.lock'; then
git diff -U0 '**/public-api.lock'
echo ""
echo ""
echo "Changed files:"
git diff --name-only '**/public-api.lock'
echo ""
echo ""
echo "Public API lock files are out of date."
echo "Run './scripts/public-api.sh' locally to"
echo "regenerate them, then commit the changes."
exit 1
fi
rust-test-other:
name: "Rust tests (${{ matrix.os }})"
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- os: windows-x64
runner: runs-on=${{ github.run_id }}/pool=windows-x64-pre
fallback_runner: windows-latest
- os: linux-arm64
runner: runs-on=${{ github.run_id }}/runner=arm64-medium/image=ubuntu24-full-arm64-pre-v2/tag=rust-test-linux-arm64
runs-on: >-
${{ github.repository == 'vortex-data/vortex'
&& matrix.runner
|| matrix.fallback_runner }}
steps:
- uses: runs-on/action@v2
if: github.repository == 'vortex-data/vortex'
with:
sccache: s3
- uses: actions/checkout@v6
- name: Setup (Windows)
if: matrix.os == 'windows-x64'
run: |
echo "C:\rust\cargo\bin" >> $env:GITHUB_PATH
- uses: ./.github/actions/setup-prebuild
- name: Rust Tests (Windows)
if: matrix.os == 'windows-x64'
run: |
cargo nextest run --cargo-profile ci --locked --workspace --all-features --no-fail-fast `
--exclude vortex-bench --exclude vortex-python --exclude vortex-duckdb `
--exclude vortex-fuzz --exclude vortex-cuda --exclude vortex-nvcomp `
--exclude vortex-cub --exclude vortex-test-e2e-cuda --exclude duckdb-bench `
--exclude lance-bench --exclude datafusion-bench --exclude random-access-bench `
--exclude compress-bench --exclude xtask --exclude vortex-datafusion `
--exclude gpu-scan-cli --exclude vortex-sqllogictest
- name: Rust Tests (Other)
if: matrix.os != 'windows-x64'
run: |
cargo nextest run --cargo-profile ci --locked --workspace --all-features --no-fail-fast --exclude vortex-bench --exclude xtask --exclude vortex-sqllogictest
- uses: ./.github/actions/check-rebuild
if: matrix.os != 'windows-x64'
with:
command: "cargo test --profile ci --locked --workspace --all-features --no-run --exclude vortex-bench --exclude xtask --exclude vortex-sqllogictest"
- name: Alert incident.io
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/develop'
uses: ./.github/actions/alert-incident-io
with:
api-key: ${{ secrets.INCIDENT_IO_ALERT_TOKEN }}
alert-title: "Rust tests (${{ matrix.os }}) failed on develop"
deduplication-key: ci-rust-test-${{ matrix.os }}-failure
build-java:
name: "Java"
runs-on: >-
${{ github.repository == 'vortex-data/vortex'
&& format('runs-on={0}/pool=amd64-medium-pre-v2/tag=java', github.run_id)
|| 'ubuntu-latest' }}
timeout-minutes: 30
steps:
- uses: runs-on/action@v2
if: github.repository == 'vortex-data/vortex'
with:
sccache: s3
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-prebuild
- run: ./gradlew test --parallel
working-directory: ./java
license-check-and-audit-check:
name: License Check and Audit Check
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
checks:
- advisories
- bans licenses sources
# Prevent sudden announcement of a new advisory from failing ci:
continue-on-error: ${{ matrix.checks == 'advisories' }}
steps:
- uses: actions/checkout@v6
- uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check ${{ matrix.checks }}
cxx-test:
name: "C++ build"
timeout-minutes: 30
runs-on: >-
${{ github.repository == 'vortex-data/vortex'
&& format('runs-on={0}/runner=amd64-medium/image=ubuntu24-full-x64-pre-v2/tag=cxx-build', github.run_id)
|| 'ubuntu-latest' }}
steps:
- uses: runs-on/action@v2
if: github.repository == 'vortex-data/vortex'
with:
sccache: s3
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-prebuild
- name: Build and run C++ unit tests
run: |
mkdir -p vortex-cxx/build
cmake -S vortex-cxx -B vortex-cxx/build -DVORTEX_ENABLE_TESTING=ON -DVORTEX_ENABLE_ASAN=ON
cmake --build vortex-cxx/build --parallel $(nproc)
ctest --test-dir vortex-cxx/build -j $(nproc) -V
- name: Build and run the example in release mode
run: |
cmake -S vortex-cxx/examples -B vortex-cxx/examples/build -DCMAKE_BUILD_TYPE=Release
cmake --build vortex-cxx/examples/build --parallel $(nproc)
vortex-cxx/examples/build/hello-vortex vortex-cxx/examples/goldenfiles/example.vortex
- uses: ./.github/actions/check-rebuild
with:
command: "cargo build --profile ci --locked -p vortex-cxx --lib"
sqllogic-test:
name: "SQL logic tests"
runs-on: >-
${{ github.repository == 'vortex-data/vortex'
&& format('runs-on={0}/runner=amd64-medium/image=ubuntu24-full-x64-pre-v2/tag=sql-logic-test', github.run_id)
|| 'ubuntu-latest' }}
timeout-minutes: 30
steps:
- uses: runs-on/action@v2
if: github.repository == 'vortex-data/vortex'
with:
sccache: s3
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-prebuild
- name: Run sqllogictest tests
run: |
./vortex-sqllogictest/slt/tpch/generate_data.sh
cargo test --profile ci -p vortex-sqllogictest --test sqllogictests
- uses: ./.github/actions/check-rebuild
with:
command: "cargo test --profile ci -p vortex-sqllogictest --test sqllogictests --no-run"
wasm-integration:
name: "WASM integration smoke test"
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-rust
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
targets: "wasm32-wasip1"
- name: Setup Wasmer
shell: bash
run: |
curl https://get.wasmer.io -sSfL | sh
echo "$HOME/.wasmer/bin" >> $GITHUB_PATH
- run: cargo build --profile ci --target wasm32-wasip1
working-directory: ./wasm-test
- run: wasmer run ./target/wasm32-wasip1/ci/wasm-test.wasm
working-directory: ./wasm-test
generated-files:
name: "Check generated source files are up to date"
runs-on: >-
${{ github.repository == 'vortex-data/vortex'
&& format('runs-on={0}/runner=amd64-medium/image=ubuntu24-full-x64-pre-v2/tag=generated-files', github.run_id)
|| 'ubuntu-latest' }}
timeout-minutes: 30
steps:
- uses: runs-on/action@v2
if: github.repository == 'vortex-data/vortex'
with:
sccache: s3
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-prebuild
- name: Install nightly for cbindgen macro expansion
run: rustup toolchain install $NIGHTLY_TOOLCHAIN
- name: "regenerate all .fbs/.proto Rust code"
run: |
cargo run --profile ci -p xtask -- generate-fbs
cargo run --profile ci -p xtask -- generate-proto
- name: "regenerate FFI header file"
run: |
cargo +$NIGHTLY_TOOLCHAIN build --profile ci -p vortex-ffi
- name: "Make sure no files changed after regenerating"
run: |
git status --porcelain
test -z "$(git status --porcelain)"
- name: "Checkout develop flatbuffers"
working-directory: vortex-flatbuffers/
run: |
cp -R flatbuffers flatbuffers.HEAD
git fetch origin develop --depth 1
git checkout origin/develop -- flatbuffers
- name: "Verify flatbuffer back-compat"
working-directory: vortex-flatbuffers/
run: |
find flatbuffers/ -type f -name "*.fbs" | sed 's/^flatbuffers\///' | xargs -I{} -n1 flatc -I flatbuffers.HEAD --conform-includes flatbuffers --conform flatbuffers/{} flatbuffers.HEAD/{}
ffi-c-test:
name: "C API test build"
timeout-minutes: 10
runs-on: >-
${{ github.repository == 'vortex-data/vortex'
&& format('runs-on={0}/runner=amd64-medium/image=ubuntu24-full-x64-pre-v2/tag=cxx-build', github.run_id)
|| 'ubuntu-latest' }}
steps:
- uses: runs-on/action@v2
if: github.repository == 'vortex-data/vortex'
with:
sccache: s3
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-prebuild
- name: "regenerate FFI header file"
run: |
cargo +$NIGHTLY_TOOLCHAIN build --profile ci -p vortex-ffi
- name: Build and run C++ unit tests
run: |
cd vortex-ffi
mkdir build
cmake -Bbuild -DRUST_BUILD_PROFILE=ci
cmake --build build -j $(nproc)
ctest --test-dir build -j $(nproc)