From 3c067a24773ee12fe08ed57a0a7a21ea0f80ef47 Mon Sep 17 00:00:00 2001 From: xmingc Date: Fri, 23 Jan 2026 23:47:38 +0800 Subject: [PATCH 01/13] add status badge --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ff124bf..40ee841 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Grism +[![CI](https://github.com/mirasoth/Grism/actions/workflows/ci.yml/badge.svg)](https://github.com/mirasoth/Grism/actions/workflows/ci.yml) + **AI-native, neurosymbolic hypergraph database** Grism is a hypergraph-first database designed for knowledge representation, semantic reasoning, and multi-modal data processing. It combines the expressiveness of n-ary relations with low-latency graph traversal and scalable computation. @@ -54,5 +56,4 @@ cargo test ## License -See [LICENSE](LICENSE) for details. - +See [LICENSE](LICENSE) for details. \ No newline at end of file From c2bd27231d33b91a034d45a056925ae3bb2e6b86 Mon Sep 17 00:00:00 2001 From: xmingc Date: Sat, 24 Jan 2026 00:03:53 +0800 Subject: [PATCH 02/13] update ci --- .github/workflows/ci.yml | 104 +++++++++------------------------------ 1 file changed, 22 insertions(+), 82 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 641396f..5a6144c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,119 +11,59 @@ env: RUST_BACKTRACE: 1 jobs: - fmt: - name: Format Check + check: + name: Formatting and Linting Check runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - with: - components: rustfmt - - - name: Install protobuf compiler - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - - name: Install Python dependencies - run: pip install -e .[dev] - - - name: Check formatting - run: make fmt-check - - lint: - name: Clippy Lint - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable with: components: clippy - - - name: Install protobuf compiler - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler - - - name: Set up Python - uses: actions/setup-python@v5 + - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler + - uses: actions/setup-python@v5 with: python-version: '3.10' - - - name: Install Python dependencies - run: pip install -e .[dev] - - - name: Cache dependencies - uses: Swatinem/rust-cache@v2 + - run: pip install -e .[dev] + - uses: Swatinem/rust-cache@v2 with: prefix-key: "v0-rust" shared-key: "stable" - - - name: Run clippy - run: make lint + - run: make fmt-check && make lint test: name: Rust Tests runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Install protobuf compiler - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler - - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - - - name: Cache dependencies - uses: Swatinem/rust-cache@v2 + - uses: actions/checkout@v4 + - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 with: prefix-key: "v0-rust" shared-key: "stable" - - - name: Run tests - run: make test + - run: make test build: name: Build Check runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Install protobuf compiler - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler - - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - - - name: Cache dependencies - uses: Swatinem/rust-cache@v2 + - uses: actions/checkout@v4 + - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 with: prefix-key: "v0-rust" shared-key: "stable" + - run: make build - - name: Build project - run: make build - - # Summary job that depends on all checks ci-success: name: CI Success runs-on: ubuntu-latest - needs: [fmt, lint, test, build] + needs: [check, test, build] if: always() steps: - - name: Check all jobs passed - run: | - if [[ "${{ needs.fmt.result }}" != "success" ]] || \ - [[ "${{ needs.lint.result }}" != "success" ]] || \ + - run: | + if [[ "${{ needs.check.result }}" != "success" ]] || \ [[ "${{ needs.test.result }}" != "success" ]] || \ [[ "${{ needs.build.result }}" != "success" ]]; then echo "One or more jobs failed" From 8ae6e9f41d00e549051fff099ad8051339372626 Mon Sep 17 00:00:00 2001 From: xmingc Date: Sat, 24 Jan 2026 00:10:29 +0800 Subject: [PATCH 03/13] update ci --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a6144c..cf1b583 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,11 +23,12 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.10' - - run: pip install -e .[dev] - uses: Swatinem/rust-cache@v2 with: prefix-key: "v0-rust" shared-key: "stable" + - run: pip install maturin + - run: pip install -e .[dev] - run: make fmt-check && make lint test: From 509db94c77da56d420c3422f207890c0a4650afc Mon Sep 17 00:00:00 2001 From: xmingc Date: Sat, 24 Jan 2026 00:19:45 +0800 Subject: [PATCH 04/13] Update: "specs/rfc-0012.md specs/rfc-0102.md src/common/error/src/error.rs src/common/error/src/lib.rs src/grism-core/src/types/mod.rs src/grism-core/src/types/spec.rs src/grism-engine/src/python/mod.rs src/grism-logical/src/python/mod.rs src/python/mod.rs" [skip ci] --- specs/rfc-0012.md | 4 ++-- specs/rfc-0102.md | 2 +- src/common/error/src/error.rs | 2 +- src/common/error/src/lib.rs | 3 +-- src/grism-core/src/types/mod.rs | 4 +--- src/grism-core/src/types/spec.rs | 2 +- src/grism-engine/src/python/mod.rs | 10 ++++------ src/grism-logical/src/python/mod.rs | 9 ++++----- src/python/mod.rs | 7 +++---- 9 files changed, 18 insertions(+), 25 deletions(-) diff --git a/specs/rfc-0012.md b/specs/rfc-0012.md index 700b742..1faa001 100644 --- a/specs/rfc-0012.md +++ b/specs/rfc-0012.md @@ -241,7 +241,7 @@ For the local execution engine, the following backends are supported: | Backend | Persistence | Description | | ----------------- | ----------- | ---------------------------------- | -| `InMemoryStorage` | None | Ephemeral, testing and prototyping | +| `MemoryStorage` | None | Ephemeral, testing and prototyping | | `LanceStorage` | Local FS | Persistent, Lance-based datasets | Both conform strictly to the `Storage` trait. @@ -255,7 +255,7 @@ For Ray-based distributed execution, storage is backed by cloud object stores: * S3 * GCS * Azure Blob -* Other Daft-supported backends +* Other cloud object stores Key requirements: diff --git a/specs/rfc-0102.md b/specs/rfc-0102.md index 3222219..4b914e4 100644 --- a/specs/rfc-0102.md +++ b/specs/rfc-0102.md @@ -371,7 +371,7 @@ The local runtime supports multiple storage backends: | Backend | Description | Use Case | |---------|-------------|----------| -| `InMemoryStorage` | Hash-map based storage | Testing, small datasets | +| `MemoryStorage` | Hash-map based storage | Testing, small datasets | | `LanceStorage` | Lance format file storage | Production, large datasets | Storage is accessed through the `Storage` trait defined in `grism-storage`. diff --git a/src/common/error/src/error.rs b/src/common/error/src/error.rs index 353ca9a..28ef207 100644 --- a/src/common/error/src/error.rs +++ b/src/common/error/src/error.rs @@ -117,7 +117,7 @@ impl GrismError { Self::InternalError(msg.into()) } - /// Create an out-of-spec error (following Daft's parquet2 pattern). + /// Create an out-of-spec error. #[must_use] pub fn oos>(msg: S) -> Self { Self::OutOfSpec(msg.into()) diff --git a/src/common/error/src/lib.rs b/src/common/error/src/lib.rs index c6da7ec..e8610a6 100644 --- a/src/common/error/src/lib.rs +++ b/src/common/error/src/lib.rs @@ -1,7 +1,6 @@ //! Error types and result aliases for Grism. //! -//! This module provides the core error handling infrastructure following -//! the pattern from Daft's error module. +//! This module provides the core error handling infrastructure mod error; #[cfg(feature = "python")] diff --git a/src/grism-core/src/types/mod.rs b/src/grism-core/src/types/mod.rs index 1ed6f09..af6a494 100644 --- a/src/grism-core/src/types/mod.rs +++ b/src/grism-core/src/types/mod.rs @@ -1,9 +1,7 @@ //! Type system for Grism values. //! //! This module defines the `Value` enum for runtime values and -//! `DataType` for type information, following the pattern from -//! Daft's parquet2 spec.rs for invariant checking. - +//! `DataType` for type information. mod data_type; mod spec; mod value; diff --git a/src/grism-core/src/types/spec.rs b/src/grism-core/src/types/spec.rs index 526035c..30f6cdb 100644 --- a/src/grism-core/src/types/spec.rs +++ b/src/grism-core/src/types/spec.rs @@ -1,4 +1,4 @@ -//! Type invariant checking (following Daft's parquet2/spec.rs pattern). +//! Type invariant checking. use common_error::{GrismError, GrismResult}; diff --git a/src/grism-engine/src/python/mod.rs b/src/grism-engine/src/python/mod.rs index 5377b0e..d5ec187 100644 --- a/src/grism-engine/src/python/mod.rs +++ b/src/grism-engine/src/python/mod.rs @@ -1,7 +1,6 @@ //! Python bindings for executors. //! -//! This module provides `PyO3` bindings for the Grism execution engine, -//! following the Daft pattern of individual python modules per crate. +//! This module provides `PyO3` bindings for the Grism execution engine. #![allow(unsafe_op_in_unsafe_fn)] @@ -88,14 +87,13 @@ impl PyRayExecutor { } } -// ========== Module Registration (Daft Pattern) ========== +// ========== Module Registration ========== /// Register all Python bindings from this crate with the parent module. /// -/// Following the Daft pattern, each crate exports a `register_modules` function -/// that registers its Python classes and functions with the parent module. +/// Each crate exports a `register_modules` function that registers its Python +/// classes and functions with the parent module. pub fn register_modules(parent: &Bound<'_, PyModule>) -> PyResult<()> { - // ========== Executor Classes ========== parent.add_class::()?; parent.add_class::()?; parent.add_class::()?; diff --git a/src/grism-logical/src/python/mod.rs b/src/grism-logical/src/python/mod.rs index 3696203..cef1567 100644 --- a/src/grism-logical/src/python/mod.rs +++ b/src/grism-logical/src/python/mod.rs @@ -1,8 +1,7 @@ //! Python bindings for the Grism expression system. //! -//! This module provides `PyO3` bindings for expressions, following the Daft pattern -//! of individual python modules per crate. Implements expression lowering to Rust -//! `LogicalExpr` per RFC-0003. +//! This module provides `PyO3` bindings for expressions. Implements expression +//! lowering to Rust `LogicalExpr` per RFC-0003. #![allow(unused_unsafe)] #![allow(unsafe_op_in_unsafe_fn)] @@ -1278,11 +1277,11 @@ impl PyPattern { } } -// ========== Module Registration (Daft Pattern) ========== +// ========== Module Registration ========== /// Register all Python bindings from this crate with the parent module. /// -/// Following the Daft pattern, each crate exports a `register_modules` function +/// Each crate exports a `register_modules` function /// that registers its Python classes and functions with the parent module. pub fn register_modules(parent: &Bound<'_, PyModule>) -> PyResult<()> { // ========== Expression Classes ========== diff --git a/src/python/mod.rs b/src/python/mod.rs index c8141da..f13dfde 100644 --- a/src/python/mod.rs +++ b/src/python/mod.rs @@ -1,7 +1,6 @@ //! Python bindings for Grism. //! -//! This module provides PyO3 bindings for the Grism Python API, -//! following the Daft pattern of individual python modules per crate. +//! This module provides PyO3 bindings for the Grism Python API. //! //! The Python API implements the specification in RFC-0101 (Python API Contract), //! with expression lowering to Rust LogicalPlan per RFC-0002, RFC-0003, and RFC-0006. @@ -22,11 +21,11 @@ pub use hypergraph::{ /// Register all Python bindings with the module. /// -/// Following the Daft pattern, this function orchestrates registration +/// This function orchestrates registration /// by calling each sub-crate's `register_modules` function and then /// registering types specific to the main crate. pub fn register_module(m: &Bound<'_, PyModule>) -> PyResult<()> { - // ========== Register Sub-crate Modules (Daft Pattern) ========== + // ========== Register Sub-crate Modules ========== // Each crate manages its own Python bindings grism_logical::python::register_modules(m)?; grism_engine::python::register_modules(m)?; From c60ec6a71209b1bf35c64b03cd18aead2ec207df Mon Sep 17 00:00:00 2001 From: xmingc Date: Sat, 24 Jan 2026 00:27:57 +0800 Subject: [PATCH 05/13] update ci --- .github/workflows/ci.yml | 84 ++++++++++++++++++---------------------- pyproject.toml | 2 +- 2 files changed, 39 insertions(+), 47 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf1b583..c4ce332 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,68 +6,60 @@ on: pull_request: branches: [main, master, develop] -env: - CARGO_TERM_COLOR: always - RUST_BACKTRACE: 1 +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: - check: - name: Formatting and Linting Check + fmt: + name: Format Check runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: - components: clippy - - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler - - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - uses: Swatinem/rust-cache@v2 - with: - prefix-key: "v0-rust" - shared-key: "stable" - - run: pip install maturin - - run: pip install -e .[dev] - - run: make fmt-check && make lint + components: rustfmt + - run: cargo fmt --all -- --check - test: - name: Rust Tests + backend-checks: + name: Lint, Test, and Build runs-on: ubuntu-latest + needs: fmt steps: - uses: actions/checkout@v4 - - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 + + - name: Install Protoc + run: sudo apt-get update && sudo apt-get install -y protobuf-compiler + + - name: Set up Python + uses: actions/setup-python@v5 with: - prefix-key: "v0-rust" - shared-key: "stable" - - run: make test + python-version: '3.10' + cache: 'pip' - build: - name: Build Check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable with: - prefix-key: "v0-rust" - shared-key: "stable" - - run: make build + components: clippy + + - name: Cache Rust + uses: Swatinem/rust-cache@v2 + + - name: Install Python Deps + run: | + python -m pip install --upgrade pip + pip install -e .[dev] --no-build-isolation + + - name: Lint & Test + run: | + make lint + make test + make build ci-success: name: CI Success runs-on: ubuntu-latest - needs: [check, test, build] - if: always() + needs: [fmt, backend-checks] + if: success() steps: - - run: | - if [[ "${{ needs.check.result }}" != "success" ]] || \ - [[ "${{ needs.test.result }}" != "success" ]] || \ - [[ "${{ needs.build.result }}" != "success" ]]; then - echo "One or more jobs failed" - exit 1 - fi - echo "All CI checks passed!" + - run: echo "Success!" \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 89729c1..ad2f4e9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,7 +52,7 @@ Issues = "https://github.com/mirasoth/Grism/issues" [tool.maturin] # Build with Python feature enabled -features = ["python"] +features = ["python","pyo3/extension-module"] # Python source directory (root contains the grism/ package) python-source = "." # Module name - the native extension lives at grism._grism From d4bbfce323f25dae366413d3a0feaec475a0e3cf Mon Sep 17 00:00:00 2001 From: xmingc Date: Sat, 24 Jan 2026 00:29:51 +0800 Subject: [PATCH 06/13] update ci --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4ce332..7c6e4d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,9 @@ name: CI on: push: - branches: [main, master, develop, "feat/*"] + branches: [main, master, "feat/*"] pull_request: - branches: [main, master, develop] + branches: [main, master] concurrency: group: ${{ github.workflow }}-${{ github.ref }} From 6e6ad1280b2a60a45b7f0beb7bdecede34f595ac Mon Sep 17 00:00:00 2001 From: xmingc Date: Sat, 24 Jan 2026 00:33:28 +0800 Subject: [PATCH 07/13] update ci --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c6e4d7..e4c48ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,6 +48,7 @@ jobs: - name: Install Python Deps run: | python -m pip install --upgrade pip + pip install maturin patchelf pip install -e .[dev] --no-build-isolation - name: Lint & Test From 3c433601598e540f4f8e7fb6a619b03653ad65bd Mon Sep 17 00:00:00 2001 From: xmingc Date: Sat, 24 Jan 2026 10:53:34 +0800 Subject: [PATCH 08/13] optimize ci --- .github/workflows/ci.yml | 55 +++++++++++++++++++--------------------- rust-toolchain.toml | 2 +- 2 files changed, 27 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4c48ac..cde085d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,20 +11,23 @@ concurrency: cancel-in-progress: true jobs: - fmt: - name: Format Check + # 1. Separate linting to fail fast + static-analysis: + name: Lint & Format runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - with: - components: rustfmt - - run: cargo fmt --all -- --check - - backend-checks: - name: Lint, Test, and Build + - uses: dtolnay/rust-toolchain@master # It will find the .toml automatically + - name: Rust Fmt + run: cargo fmt --all -- --check + - name: Rust Clippy + run: cargo clippy -- -D warnings + + build-and-test: + name: Build & Test runs-on: ubuntu-latest - needs: fmt + # Wait for lints to pass before burning minutes on compilation + needs: static-analysis steps: - uses: actions/checkout@v4 @@ -39,28 +42,22 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable - with: - components: clippy - - name: Cache Rust - uses: Swatinem/rust-cache@v2 + # Optimized caching: handles both Cargo registry AND target directory + - uses: Swatinem/rust-cache@v2 + + - name: Install Maturin + run: pip install maturin - - name: Install Python Deps + # Build the Rust extension ONCE in develop mode + # This replaces the need for a separate 'make build' step during CI + - name: Build Extension (Debug) + run: maturin develop + + - name: Install Python Dev Deps run: | - python -m pip install --upgrade pip - pip install maturin patchelf pip install -e .[dev] --no-build-isolation - - name: Lint & Test + - name: Run Tests run: | - make lint - make test - make build - - ci-success: - name: CI Success - runs-on: ubuntu-latest - needs: [fmt, backend-checks] - if: success() - steps: - - run: echo "Success!" \ No newline at end of file + make test \ No newline at end of file diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 7063c8d..780aa01 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.92.0" # Pin to specific version - update periodically +channel = "stable" components = ["rustfmt", "clippy"] profile = "minimal" \ No newline at end of file From 5627371a17106423d527f0d16ff4d6ba4c9a93e9 Mon Sep 17 00:00:00 2001 From: xmingc Date: Sat, 24 Jan 2026 10:54:59 +0800 Subject: [PATCH 09/13] optimize ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cde085d..4b34849 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@master # It will find the .toml automatically + - uses: dtolnay/rust-toolchain@stable - name: Rust Fmt run: cargo fmt --all -- --check - name: Rust Clippy From 56c40481e9dceeedd8237ba5e179833699090c33 Mon Sep 17 00:00:00 2001 From: xmingc Date: Sat, 24 Jan 2026 11:05:24 +0800 Subject: [PATCH 10/13] optimize ci --- .github/workflows/ci.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b34849..facfc48 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,11 +17,17 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + + - name: Install Protoc + run: sudo apt-get update && sudo apt-get install -y protobuf-compiler + - uses: dtolnay/rust-toolchain@stable + - name: Rust Fmt - run: cargo fmt --all -- --check + run: make fmt-check + - name: Rust Clippy - run: cargo clippy -- -D warnings + run: make lint build-and-test: name: Build & Test From c10e8a12f68235b1d29bff41d82e5081cdff2f36 Mon Sep 17 00:00:00 2001 From: xmingc Date: Sat, 24 Jan 2026 11:09:41 +0800 Subject: [PATCH 11/13] update ci --- .github/workflows/ci.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index facfc48..7afcfe9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,10 +19,20 @@ jobs: - uses: actions/checkout@v4 - name: Install Protoc - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler + uses: arduino/setup-protoc@v3 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + cache: 'pip' - uses: dtolnay/rust-toolchain@stable + - name: Install Linting Tools + run: | + pip install black ruff mypy + - name: Rust Fmt run: make fmt-check @@ -38,7 +48,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Protoc - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler + uses: arduino/setup-protoc@v3 - name: Set up Python uses: actions/setup-python@v5 From 385af4140eb98b2b45d7225f8c6a807dc4b2c8d0 Mon Sep 17 00:00:00 2001 From: xmingc Date: Sat, 24 Jan 2026 11:21:32 +0800 Subject: [PATCH 12/13] optimize ci --- .github/workflows/ci.yml | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7afcfe9..ede8deb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,11 +39,10 @@ jobs: - name: Rust Clippy run: make lint - build-and-test: +build-and-test: name: Build & Test runs-on: ubuntu-latest - # Wait for lints to pass before burning minutes on compilation - needs: static-analysis + needs: static-analysis steps: - uses: actions/checkout@v4 @@ -59,21 +58,25 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable - # Optimized caching: handles both Cargo registry AND target directory - - uses: Swatinem/rust-cache@v2 + # The heavy lifter: caches target/ and cargo registry + - name: Cache Rust + uses: Swatinem/rust-cache@v2 - - name: Install Maturin - run: pip install maturin - - # Build the Rust extension ONCE in develop mode - # This replaces the need for a separate 'make build' step during CI - - name: Build Extension (Debug) - run: maturin develop - - - name: Install Python Dev Deps + - name: Install Build & Test Dependencies run: | - pip install -e .[dev] --no-build-isolation + python -m pip install --upgrade pip + # patchelf is required for maturin to repair manylinux wheels + pip install maturin patchelf + + - name: Install Project (Editable) + # --no-build-isolation is the key to speed: it uses the cached + # Rust toolchain and dependencies instead of creating a fresh env. + run: pip install -e .[dev] --no-build-isolation - name: Run Tests - run: | - make test \ No newline at end of file + # Ensure 'make test' points to your pytest / python test suite + run: make test + + - name: Build Wheel (Optional check) + # This confirms the project can package correctly for distribution + run: maturin build --out dist \ No newline at end of file From d516fd4b139dca66eb305cd2c5312188b9117c72 Mon Sep 17 00:00:00 2001 From: xmingc Date: Sat, 24 Jan 2026 11:22:07 +0800 Subject: [PATCH 13/13] optimize ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ede8deb..c33da4e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: - name: Rust Clippy run: make lint -build-and-test: + build-and-test: name: Build & Test runs-on: ubuntu-latest needs: static-analysis