vector-db-core 0.1.111

A high-performance vector database core for reading and writing historical records such as logs and chat records
Documentation
name: Rust CI

on:
  push:
    branches:
      - master  # 仅在 master 分支推送时触发

jobs:
  test:
    name: Run Unit and Integration Tests
    runs-on: ubuntu-latest  # 使用 Ubuntu 作为运行环境

    steps:
      # 检出代码库
      - name: Checkout Code
        uses: actions/checkout@v4  # 更新到最新版本的 checkout action

      # 设置 Rust 环境为 nightly 版本
      - name: Set up Rust (nightly)
        uses: dtolnay/rust-toolchain@stable  # 推荐使用最新的 rust-toolchain
        with:
          toolchain: nightly  # 使用 nightly 版本
          components: rustfmt, clippy  # 可选:添加常用组件


      # 缓存 Cargo 依赖项,提高运行速度
      - name: Cache Cargo dependencies
        uses: actions/cache@v4  # 使用最新版本的 cache action
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
          restore-keys: |
            ${{ runner.os }}-cargo-

      # 编译项目(确保没有编译错误)
      - name: Build Project
        run: cargo build --verbose

      # 运行单元测试
      - name: Run Unit Tests
        run: cargo test --verbose

      # 运行集成测试(tests 文件夹中的所有测试)
      - name: Run Integration Tests
        run: cd tests && cargo test --test '*' --verbose