-
Notifications
You must be signed in to change notification settings - Fork 0
266 lines (227 loc) · 8.79 KB
/
Copy pathci.yml
File metadata and controls
266 lines (227 loc) · 8.79 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
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
# Cancel in-flight runs for the same ref when a new commit lands.
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
jobs:
check:
name: fmt + clippy + test
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
# `rust-toolchain.toml` at the repo root pins the channel (1.94)
# and components (rustfmt, clippy). We still specify `stable` here
# so the action installs the modern launcher; the toolchain file
# takes precedence when invoking cargo from the workspace root.
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo registry, index, and target
uses: Swatinem/rust-cache@v2
- name: Check cross-ecosystem versions
run: python3 scripts/check_version_sync.py
- name: Check formatting
run: cargo fmt --all -- --check
# We exclude samkhya-py from the workspace lint/test pass:
# * samkhya-py — PyO3 extension module; needs the matching Python
# dev headers and is built end-to-end by `maturin` in the Python
# matrix below.
# samkhya-duckdb is included with its dependency-free default feature
# set; its `bundled` integration requires a separate native-toolchain job.
- name: Clippy (workspace, deny warnings)
run: cargo clippy --locked --workspace --exclude samkhya-py -- -D warnings
- name: Test (workspace)
run: cargo test --locked --workspace --exclude samkhya-py
# Verify the default-feature compatibility floor declared by
# workspace.package.rust-version. Heavy opt-in engine features run on the
# pinned development toolchain in optional-features below.
msrv:
name: MSRV (Rust 1.85)
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install MSRV toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.85"
- name: Cache cargo registry, index, and target
uses: Swatinem/rust-cache@v2
with:
key: msrv-1.85
- name: Check workspace at the declared MSRV
run: cargo +1.85 check --locked --workspace
# Compile and test feature-gated code that the default workspace pass skips.
# Each matrix entry is self-contained so a heavy adapter cannot starve the rest.
optional-features:
name: Optional feature (${{ matrix.name }})
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- name: core-all
package: samkhya-core
feature_args: --all-features
- name: iceberg
package: samkhya-iceberg
feature_args: --features iceberg
- name: polars
package: samkhya-polars
feature_args: --features engine
- name: duckdb
package: samkhya-duckdb
feature_args: --features bundled
- name: puffin-cross-engine
package: samkhya-it
feature_args: --features puffin-cross-engine --test puffin_cross_engine
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo registry, index, and target
uses: Swatinem/rust-cache@v2
with:
key: feature-${{ matrix.name }}
- name: Test feature surface
run: cargo test --locked -p ${{ matrix.package }} ${{ matrix.feature_args }}
python:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.12", "3.13"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
samkhya-py/pyproject.toml
samkhya-gpudb/scripts/requirements-llm.txt
- name: Cache cargo registry, index, and target
uses: Swatinem/rust-cache@v2
with:
key: python-${{ matrix.python-version }}
- name: Install Python build and test tools
run: >-
python -m pip install "maturin>=1.7,<2.0" "pytest>=7"
-r samkhya-gpudb/scripts/requirements-llm.txt
- name: Build the distributable wheel
run: >-
maturin build --locked --release --interpreter python
--out target/wheels -m samkhya-py/Cargo.toml
- name: Install the built wheel
run: python -m pip install --no-deps target/wheels/samkhya-*.whl
- name: Test Python bindings
run: python -m pytest samkhya-py/tests
- name: Test Python HTTP wire contract
run: python samkhya-gpudb/scripts/wire_contract_test.py
- name: Test primary Python HTTP server
if: matrix.python-version != '3.9'
run: python samkhya-gpudb/scripts/wire_contract_test.py --primary
typescript:
name: TypeScript transport
runs-on: ubuntu-latest
timeout-minutes: 15
defaults:
run:
working-directory: samkhya-gpudb/scripts
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: samkhya-gpudb/scripts/package-lock.json
- name: Install locked dependencies
run: npm ci --ignore-scripts
- name: Audit Node dependency tree
run: npm audit --audit-level=low
- name: Type-check transport implementations
run: npm run lint
- name: Test stable HTTP wire contract
run: npm run test:wire
# ---------------------------------------------------------------------------
# cargo-deny — supply-chain hygiene. Runs the four checks (bans /
# licenses / advisories / sources) configured in `deny.toml` at the
# repository root. Every PR and release candidate must pass it.
#
# Fuzzing is NOT enabled in CI: cargo-fuzz requires a nightly toolchain
# and a long-running budget that's incompatible with per-PR feedback.
# Fuzz targets live in `samkhya-core/fuzz/` (a standalone workspace) and
# are run locally before each release tag.
# ---------------------------------------------------------------------------
deny:
name: cargo-deny
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
# Installed as a prebuilt binary from the cargo-deny GitHub release
# rather than via EmbarkStudios/cargo-deny-action@v2. That action is a
# Docker action: every run rebuilds an image `FROM rust:1.85.0-alpine`,
# so a Docker Hub outage or pull-rate limit fails the job for reasons
# that have nothing to do with this repository. It did exactly that on
# 2026-07-25 (run 30173310053, i/o timeout to registry-1.docker.io) on
# a commit that changed one line of README. taiki-e/install-action
# pulls from GitHub releases, which CI already depends on.
- name: Install cargo-deny
uses: taiki-e/install-action@v2
with:
tool: cargo-deny
# `check` runs all four checks: bans, licenses, advisories, sources.
#
# Locked, default-feature workspace resolution aligns with the release
# pre-flight verification (default features). Passing --workspace
# explicitly matters: cargo-deny-action defaulted to --all-features,
# which activates samkhya-postgres's pgrx 0.12 path (pulling
# unmaintained serde_cbor via RUSTSEC-2021-0127) and produces ~60
# duplicate-version bans from arrow/brotli/hashbrown/rand co-activation
# across pgrx + polars-all-features + iceberg + duckdb. Retire this
# scoping when (a) pgrx ≥ 0.13 lands and drops serde_cbor, and (b) we
# have a strategy for the cross-engine arrow / hashbrown version sprawl
# under all-features.
- name: Run cargo-deny
run: cargo deny --locked --workspace check