embeddenator-retrieval 0.22.0

Semantic retrieval and search operations for VSA-based vector representations
Documentation
name: CI

on:
  push:
    branches: [main, develop, dev]
  pull_request:
    types: [opened, synchronize, reopened]
  workflow_dispatch:

permissions:
  contents: read
  checks: write

env:
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: 1

jobs:
  build-and-test:
    name: Build and Test
    runs-on: ubuntu-latest
    timeout-minutes: 20
    steps:
      - uses: actions/checkout@v6

      # Clone path dependencies for all branches.
      # Note: Cargo.toml uses path deps for local development. When releasing
      # to crates.io, these are overridden with versioned dependencies.
      - name: Clone dependency repos
        run: |
          cd ..
          echo "Branch: ${{ github.ref }}, Base: ${{ github.base_ref }}"
          echo "Cloning path dependencies..."
          for repo in embeddenator-vsa embeddenator-io embeddenator-fs; do
            if [ ! -d "$repo" ]; then
              echo "Cloning $repo..."
              git clone --depth 1 https://github.com/tzervas/$repo.git || true
            fi
          done

      - name: Set up Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy, rustfmt

      - name: Rust cache
        uses: Swatinem/rust-cache@v2
        with:
          key: embeddenator-retrieval

      - name: Check formatting
        run: cargo fmt --check

      - name: Clippy lints
        run: cargo clippy --all-targets --all-features -- -D warnings

      - name: Build
        run: cargo build --all-features

      - name: Run tests
        run: cargo test --all-features --verbose