lance-nd 0.1.0

N-dimensional datasets stored in Lance, one dataset or chunk per row
Documentation
name: CI

on:
  push:
    branches: [main]
  pull_request:
  # The release workflows run this first.
  workflow_call:

permissions:
  contents: read

env:
  CARGO_TERM_COLOR: always
  # Each test binary links Lance. With debug info, they fill the runner disk.
  CARGO_PROFILE_DEV_DEBUG: "0"
  CARGO_PROFILE_TEST_DEBUG: "0"
  PROTOC_VERSION: "29.3"

jobs:
  lint:
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v7
      # Lance needs protoc to build.
      - uses: taiki-e/install-action@v2
        with:
          tool: protoc@3.${{ env.PROTOC_VERSION }}
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy
      - uses: Swatinem/rust-cache@v2
      - run: cargo fmt --all --check
      - run: cargo clippy --workspace --all-targets --all-features -- -D warnings
      # Fails when a dependency is not on crates.io. The test jobs build the crate.
      - run: cargo package -p lance-nd --no-verify

  rust:
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-24.04, macos-26, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v7
      - uses: taiki-e/install-action@v2
        with:
          tool: protoc@3.${{ env.PROTOC_VERSION }}
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - run: cargo test --workspace

  s3:
    runs-on: ubuntu-24.04
    env:
      LANCE_ND_S3_ENDPOINT: http://127.0.0.1:5155
    steps:
      - uses: actions/checkout@v7
      - uses: taiki-e/install-action@v2
        with:
          tool: protoc@3.${{ env.PROTOC_VERSION }}
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - uses: actions/setup-python@v7
        with:
          python-version: "3.12"
      - name: Start an S3 server
        run: |
          python -m pip install "moto[server]"
          nohup moto_server -H 127.0.0.1 -p 5155 > moto.log 2>&1 &
          curl -s --retry 20 --retry-connrefused --retry-delay 1 -X PUT http://127.0.0.1:5155/lance-nd-test
      - run: cargo test --features aws --test object_store

  python:
    runs-on: ubuntu-24.04
    env:
      LANCE_ND_S3_ENDPOINT: http://127.0.0.1:5155
    steps:
      - uses: actions/checkout@v7
      - uses: taiki-e/install-action@v2
        with:
          tool: protoc@3.${{ env.PROTOC_VERSION }}
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - uses: actions/setup-python@v7
        with:
          python-version: "3.12"
      - name: Start an S3 server
        run: |
          python -m pip install "moto[server]"
          nohup moto_server -H 127.0.0.1 -p 5155 > moto.log 2>&1 &
          curl -s --retry 20 --retry-connrefused --retry-delay 1 -X PUT http://127.0.0.1:5155/lance-nd-test
      - name: Build and install the package
        working-directory: python
        run: |
          python -m venv .venv
          .venv/bin/python -m pip install maturin
          VIRTUAL_ENV=$PWD/.venv .venv/bin/python -m maturin develop --release --extras dev
      - name: Test
        working-directory: python
        run: .venv/bin/python -m pytest
      - name: Type check
        working-directory: python
        run: .venv/bin/python -m mypy