ruvector/.github/workflows/ci.yml

394 lines
15 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Workspace CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
# Skip building unused proc-macro features in test bin link steps
CARGO_INCREMENTAL: 0
jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-22.04
timeout-minutes: 30
continue-on-error: true
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
submodules: recursive
- name: Install Rust stable
uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4
with:
components: rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
check:
name: Cargo check
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
submodules: recursive
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev
- name: Install Rust stable
uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4
- name: Cache Rust
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32
- name: Cargo check (workspace)
run: cargo check --workspace --exclude ruvector-postgres
clippy:
name: Clippy
runs-on: ubuntu-22.04
timeout-minutes: 30
continue-on-error: true
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
submodules: recursive
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev
- name: Install Rust stable
uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4
with:
components: clippy
- name: Cache Rust
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32
- name: Clippy (workspace)
run: cargo clippy --workspace --exclude ruvector-postgres --all-targets -- -W warnings
# The full workspace test suite exceeds the 30-minute timeout on a single
# runner. We split the work into parallel matrix jobs grouped by domain so
# each shard fits comfortably under the timeout, and use `cargo-nextest` for
# faster test discovery and execution.
test:
name: Tests (${{ matrix.name }})
runs-on: ubuntu-22.04
# `core-and-rest` is the catch-all shard and compiles ~50 crates; on a
# cold cache the build alone has hit ~90min, so headroom matters more
# than tight feedback for this job. Faster shards still finish in ~1020m.
# Iter 231 — bumped 150→180. Historical successful runs landed at
# 2h 30m 16s (just under the old cap); two PR-413 runs (iter 228 +
# iter 230) both hit the cap and got cancelled mid-test. Excluding
# the iter-219 hailo crates from the catch-all (iter 230) was a
# necessary but not sufficient fix — the shard was already at the
# ragged edge. Iter 232+ — natural duration drifted to 155165 min
# (ci/supply-chain-guards branch), hitting the 180-min cap. Bumped
# 180→240 to restore headroom. The right long-term fix is to split
# heavy crates out into a new sibling shard.
timeout-minutes: 240
strategy:
fail-fast: false
matrix:
include:
- name: vector-index
packages: >-
-p ruvector-rabitq
-p ruvector-rulake
-p ruvector-diskann
-p ruvector-graph
-p ruvector-gnn
-p ruvector-cnn
- name: rvagent
packages: >-
-p rvagent-a2a
-p rvagent-acp
-p rvagent-backends
-p rvagent-cli
-p rvagent-core
-p rvagent-mcp
-p rvagent-middleware
-p rvagent-subagents
-p rvagent-tools
-p rvagent-wasm
- name: ruvix
packages: >-
-p ruvix-aarch64
-p ruvix-bench
-p ruvix-boot
-p ruvix-cap
-p ruvix-demo
-p ruvix-drivers
-p ruvix-hal
-p ruvix-integration
-p ruvix-nucleus
-p ruvix-proof
-p ruvix-queue
-p ruvix-region
-p ruvix-sched
-p ruvix-shell
-p ruvix-types
-p ruvix-vecgraph
- name: ml-research-heavy
# Heaviest crates split into their own shard so ml-research
# doesn't exceed the 45-min timeout.
packages: >-
-p ruvector-attention
-p ruvector-mincut
-p ruvector-fpga-transformer
-p ruvector-graph-transformer
- name: ml-research-rest
packages: >-
-p ruvector-scipix
-p ruvector-sparse-inference
-p ruvector-sparsifier
-p ruvector-solver
-p ruvector-domain-expansion
-p ruvector-robotics
- name: core-and-rest-heavy
# Hoist the known-heavy long-tail crates out of core-and-rest
# so neither shard exceeds the 90-min timeout.
packages: >-
-p ruvllm
-p ruvllm-cli
-p ruvector-dag
-p ruvector-nervous-system
-p ruvector-math
-p ruvector-consciousness
-p prime-radiant
-p mcp-brain
-p ruvector-decompiler
- name: core-and-rest-wasm
# Iter 232 — split out the 29 *-wasm crates from core-and-rest
# because the catch-all shard had grown to 115 crates and was
# consistently missing the 180min cap (iter-228 + iter-230 +
# iter-231 all cancelled at the timeout boundary). The wasm
# crates are a natural sub-group: thin bindings on top of host
# crates, easy to compile + test in isolation.
packages: >-
-p neural-trader-wasm
-p ruvector-acorn-wasm
-p ruvector-attention-unified-wasm
-p ruvector-attention-wasm
-p ruvector-cnn-wasm
-p ruvector-consciousness-wasm
-p ruvector-dag-wasm
-p ruvector-decompiler-wasm
-p ruvector-delta-wasm
-p ruvector-domain-expansion-wasm
-p ruvector-economy-wasm
-p ruvector-exotic-wasm
-p ruvector-fpga-transformer-wasm
-p ruvector-gnn-wasm
-p ruvector-graph-transformer-wasm
-p ruvector-graph-wasm
-p ruvector-learning-wasm
-p ruvector-math-wasm
-p ruvector-mincut-gated-transformer-wasm
-p ruvector-mincut-wasm
-p ruvector-nervous-system-wasm
-p ruvector-rabitq-wasm
-p ruvector-router-wasm
-p ruvector-solver-wasm
-p ruvector-sparsifier-wasm
-p ruvector-tiny-dancer-wasm
-p ruvector-verified-wasm
-p ruvector-wasm
# Iter 233 — `ruvllm-wasm` excluded from native nextest:
# 11 of its 195 tests (sona_instant + workers::feature_detect)
# fail or SIGABRT on native because they're wasm-target
# specific (need wasm-bindgen-test). Surfaced by iter-232's
# split; previously masked by the iter-228..231 timeout
# cancellations of the megaShard. Tracking as workspace
# follow-up — fix is to gate the affected modules behind
# `#[cfg(target_arch = "wasm32")]` or migrate to
# wasm-bindgen-test runners.
- name: research-nightly
# Nightly research PoC crates (iter 240+). Kept in a separate shard
# so their compile + test time doesn't inflate core-and-rest.
# timeout-minutes is intentionally tight — if a research crate
# takes more than 30 min it signals an unbounded benchmark in tests.
packages: >-
-p ruvector-lsm-ann
-p ruvector-matryoshka
-p ruvector-pq-search
-p ruvector-hybrid
-p ruvector-hnsw-repair
-p ruvector-coherence-hnsw
-p ruvector-maxsim
-p photonlayer-core
-p photonlayer-bench
-p photonlayer-cli
-p photonlayer-wasm
-p photonlayer-ruvector
timeout-minutes: 30
- name: core-and-rest
# Everything else: core, delta, server/cluster, etc.
# Uses --workspace + --exclude to subtract the groups above so we
# don't have to enumerate ~100 crates by hand.
packages: >-
--workspace
# Nightly research crates run in the research-nightly shard (iter 240+)
--exclude photonlayer-core
--exclude photonlayer-bench
--exclude photonlayer-cli
--exclude photonlayer-wasm
--exclude photonlayer-ruvector
--exclude ruvector-lsm-ann
--exclude ruvector-matryoshka
--exclude ruvector-pq-search
--exclude ruvector-hybrid
--exclude ruvector-hnsw-repair
--exclude ruvector-coherence-hnsw
--exclude ruvector-maxsim
--exclude ruvector-postgres
--exclude ruvector-decompiler
--exclude timesfm
--exclude ruvllm
--exclude ruvllm-cli
--exclude ruvector-dag
--exclude ruvector-nervous-system
--exclude ruvector-math
--exclude ruvector-consciousness
--exclude prime-radiant
--exclude mcp-brain
--exclude ruvector-rabitq
--exclude ruvector-rulake
--exclude ruvector-diskann
--exclude ruvector-graph
--exclude ruvector-gnn
--exclude ruvector-cnn
--exclude rvagent-a2a
--exclude rvagent-acp
--exclude rvagent-backends
--exclude rvagent-cli
--exclude rvagent-core
--exclude rvagent-mcp
--exclude rvagent-middleware
--exclude rvagent-subagents
--exclude rvagent-tools
--exclude rvagent-wasm
--exclude ruvix-aarch64
--exclude ruvix-bench
--exclude ruvix-boot
--exclude ruvix-cap
--exclude ruvix-demo
--exclude ruvix-drivers
--exclude ruvix-hal
--exclude ruvix-integration
--exclude ruvix-nucleus
--exclude ruvix-proof
--exclude ruvix-queue
--exclude ruvix-region
--exclude ruvix-sched
--exclude ruvix-shell
--exclude ruvix-types
--exclude ruvix-vecgraph
--exclude ruvector-attention
--exclude ruvector-mincut
--exclude ruvector-scipix
--exclude ruvector-fpga-transformer
--exclude ruvector-sparse-inference
--exclude ruvector-sparsifier
--exclude ruvector-solver
--exclude ruvector-graph-transformer
--exclude ruvector-domain-expansion
--exclude ruvector-robotics
--exclude hailort-sys
--exclude ruvector-hailo
--exclude ruvector-mmwave
--exclude ruvector-hailo-cluster
--exclude neural-trader-wasm
--exclude ruvector-acorn-wasm
--exclude ruvector-attention-unified-wasm
--exclude ruvector-attention-wasm
--exclude ruvector-cnn-wasm
--exclude ruvector-consciousness-wasm
--exclude ruvector-dag-wasm
--exclude ruvector-decompiler
--exclude timesfm-wasm
--exclude ruvector-delta-wasm
--exclude ruvector-domain-expansion-wasm
--exclude ruvector-economy-wasm
--exclude ruvector-exotic-wasm
--exclude ruvector-fpga-transformer-wasm
--exclude ruvector-gnn-wasm
--exclude ruvector-graph-transformer-wasm
--exclude ruvector-graph-wasm
--exclude ruvector-learning-wasm
--exclude ruvector-math-wasm
--exclude ruvector-mincut-gated-transformer-wasm
--exclude ruvector-mincut-wasm
--exclude ruvector-nervous-system-wasm
--exclude ruvector-rabitq-wasm
--exclude ruvector-router-wasm
--exclude ruvector-solver-wasm
--exclude ruvector-sparsifier-wasm
--exclude ruvector-tiny-dancer-wasm
--exclude ruvector-verified-wasm
--exclude ruvector-wasm
--exclude ruvllm-wasm
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
submodules: recursive
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev
- name: Install Rust stable
uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4
- name: Cache Rust
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32
with:
key: test-${{ matrix.name }}
- name: Install cargo-nextest
uses: taiki-e/install-action@67729d5c413db75907f0ad1e39bb04b9c868ff60
with:
tool: cargo-nextest
- name: Run tests (${{ matrix.name }})
run: cargo nextest run --no-fail-fast ${{ matrix.packages }}
- name: Run timesfm tests (candle feature, research-nightly only)
if: matrix.name == 'research-nightly'
run: cargo nextest run --no-fail-fast -p timesfm --features candle
- name: Run doctests (${{ matrix.name }})
# nextest does not run doctests; do them in a separate step. Cheap
# because compilation is already cached from the nextest run.
run: cargo test --doc ${{ matrix.packages }}
audit:
name: Security audit
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
submodules: recursive
- name: Install cargo-audit
uses: taiki-e/install-action@67729d5c413db75907f0ad1e39bb04b9c868ff60
with:
tool: cargo-audit
- name: Run cargo audit
# Configuration (including the justified ignore list) lives in
# .cargo/audit.toml at the workspace root.
run: cargo audit