chryso 0.0.2

Chryso is a Calcite-style SQL parser + optimizer engine in Rust.
Documentation
name: ci

on:
  push:
    branches: 
      - main
  pull_request:
    branches: 
      - main

jobs:
  build-test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest]
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Setup Rust
        uses: dtolnay/rust-toolchain@nightly
        with:
          toolchain: nightly-2026-01-19
          components: rustfmt
      - name: Cache cargo
        uses: Swatinem/rust-cache@v2
      - name: Format
        run: cargo fmt --all -- --check
      - name: Build
        run: cargo build
      - name: Build examples
        run: cargo build --examples
      - name: Test
        run: cargo test
      - name: Build examples (duckdb)
        run: cargo build --examples --features duckdb
      - name: Test (duckdb)
        run: cargo test --features duckdb

  velox-ffi:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest]
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Setup Rust
        uses: dtolnay/rust-toolchain@nightly
        with:
          toolchain: nightly-2026-01-19
          components: rustfmt
      - name: Cache cargo
        uses: Swatinem/rust-cache@v2
      - name: Restore velox build dir
        id: velox-ffi-build-cache
        uses: actions/cache/restore@v4
        with:
          path: ffi/velox/build
          key: ${{ runner.os }}-velox-ffi-build-${{ hashFiles('ffi/velox/CMakeLists.txt', 'ffi/velox/src/**', 'ffi/velox/include/**', 'ffi/velox/tests/**') }}
          restore-keys: |
            ${{ runner.os }}-velox-ffi-build-
      - name: Build Velox FFI stub (no submodule, no Arrow)
        run: |
          cmake -S ffi/velox -B ffi/velox/build -DCHRYSO_VELOX_USE_SUBMODULE=OFF -DCHRYSO_VELOX_USE_ARROW=OFF -DCHRYSO_VELOX_BUILD_TESTS=ON
          cmake --build ffi/velox/build -j
      - name: Save velox build dir
        if: ${{ always() }}
        uses: actions/cache/save@v4
        with:
          path: ffi/velox/build
          key: ${{ runner.os }}-velox-ffi-build-${{ hashFiles('ffi/velox/CMakeLists.txt', 'ffi/velox/src/**', 'ffi/velox/include/**', 'ffi/velox/tests/**') }}
      - name: Test Velox FFI (C++)
        run: ctest --test-dir ffi/velox/build -R chryso_velox_ffi_escape_test
      - name: Build velox adapter
        env:
          CHRYSO_VELOX_FFI_DIR: ${{ github.workspace }}/ffi/velox/build
        run: cargo build -p chryso-adapter-velox --features velox-ffi
      - name: Test velox adapter
        if: runner.os == 'Linux'
        env:
          CHRYSO_VELOX_FFI_DIR: ${{ github.workspace }}/ffi/velox/build
          LD_LIBRARY_PATH: ${{ github.workspace }}/ffi/velox/build
        run: cargo test -p chryso-adapter-velox --features velox-ffi
      - name: Test velox adapter (macos)
        if: runner.os == 'macOS'
        env:
          CHRYSO_VELOX_FFI_DIR: ${{ github.workspace }}/ffi/velox/build
          DYLD_LIBRARY_PATH: ${{ github.workspace }}/ffi/velox/build
        run: cargo test -p chryso-adapter-velox --features velox-ffi