fastembed 5.13.2

Library for generating vector embeddings, reranking locally.
Documentation
name: "Cargo Tests"
on:
  pull_request:

env:
  CARGO_TERM_COLOR: always
  RUSTFLAGS: "-Dwarnings"
  ONNX_VERSION: v1.23.2

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - name: Free Disk Space
        uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
        with:
          # this might remove tools that are actually needed,
          tool-cache: false

      - name: Restore Builds
        id: cache-build-restore
        uses: actions/cache/restore@v4
        with:
          key: '${{ runner.os }}-onnxruntime-${{ env.ONNX_VERSION }}'
          path: |
            onnxruntime/build/Linux/Release/

      - name: Compile ONNX Runtime for Linux
        if: steps.cache-build-restore.outputs.cache-hit != 'true'
        run: |
          echo Cloning ONNX Runtime repository...
          git clone https://github.com/microsoft/onnxruntime --recursive --branch $ONNX_VERSION --single-branch --depth 1
          cd onnxruntime
          ./build.sh --update --build --config Release --parallel --compile_no_warning_as_error --skip_submodule_sync
          cd ..

      - name: Cargo Test With Release Build
        run: ORT_LIB_LOCATION="$(pwd)/onnxruntime/build/Linux/Release" cargo test --release --no-default-features --features hf-hub-native-tls,image-models

      - name: Cargo Test Offline
        run: ORT_LIB_LOCATION="$(pwd)/onnxruntime/build/Linux/Release" cargo test --no-default-features --features image-models

      - name: Cargo Clippy
        run: cargo clippy

      - name: Cargo FMT
        run: cargo fmt --all -- --check

      - name: Always Save Cache
        id: cache-build-save
        if: always() && steps.cache-build-restore.outputs.cache-hit != 'true'
        uses: actions/cache/save@v4
        with:
          key: '${{ steps.cache-build-restore.outputs.cache-primary-key }}'
          path: |
            onnxruntime/build/Linux/Release/