name: CLI on: push: branches: [main] pull_request: paths: - 'rust/lancedb/**' - 'Cargo.toml' - 'Cargo.lock' - '.github/workflows/cli.yml' permissions: contents: read jobs: test: strategy: matrix: os: [ubuntu-24.04, macos-15] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v6 with: persist-credentials: false - uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1 with: components: clippy # Use only the downloads-only cache configured below. cache: false - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2 with: # Restoring compiled targets can exhaust the hosted runner disk. prefix-key: v1-cli-downloads cache-targets: false save-if: ${{ github.ref == 'refs/heads/main' }} - name: Install Linux prerequisites if: runner.os == 'Linux' run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libssl-dev clang - name: Install macOS prerequisites if: runner.os == 'macOS' run: brew install protobuf - name: Build standalone CLI binary run: cargo build --locked --profile ci -p lancedb-cli --bin lancedb - name: Test standalone CLI run: cargo test --locked --profile ci -p lancedb-cli - name: Test SDK SQL run: cargo test --locked --profile ci -p lancedb --features remote --lib remote::sql - name: Lint CLI run: cargo clippy --locked --profile ci -p lancedb-cli --all-targets --all-features -- -D warnings - name: Check SDK without remote support # Feature-disabled SDK code has existing unused-code warnings; this is a compile check. env: RUSTFLAGS: "" run: cargo check --locked --profile ci -p lancedb --no-default-features --tests