Skip to content

refactor(vector-storage): fix vector counting logic and improve error… #381

refactor(vector-storage): fix vector counting logic and improve error…

refactor(vector-storage): fix vector counting logic and improve error… #381

Workflow file for this run

name: Pull Request Checks
on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened, ready_for_review]
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
pre-commit:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Ensure uv is available
shell: bash
run: |
set -e
if ! command -v uv >/dev/null 2>&1; then
echo "uv not found, installing..."
python3 -m pip install --user uv
echo "$HOME/.local/bin" >> $GITHUB_PATH
fi
# Use python -m uv to be safe
python3 -m uv --version || uv --version
- name: Create virtual environment (if not exists)
shell: bash
run: |
set -e
# 使用 python3 -m uv 确保 uv 命令可用
_UV="python3 -m uv"
$_UV --version
# Use Python 3.12 for onnxruntime-gpu compatibility
$_UV venv --python 3.12
- name: Install dependencies
shell: bash
run: |
set -e
python3 -m uv sync --extra dev
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install frontend dependencies
working-directory: ./frontend
run: npm ci
- name: Run pre-commit
shell: bash
run: |
set -e
python3 -m uv run python --version
python3 -m uv run pre-commit run --all-files
env:
PRE_COMMIT_USE_SYSTEM: true
pytest:
runs-on: ubuntu-latest
needs: pre-commit
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Ensure uv is available
shell: bash
run: |
set -e
if ! command -v uv >/dev/null 2>&1; then
echo "uv not found, installing..."
python3 -m pip install --user uv
echo "$HOME/.local/bin" >> $GITHUB_PATH
fi
# Use python -m uv to be safe
python3 -m uv --version || uv --version
- name: Create virtual environment (if not exists)
shell: bash
run: |
set -e
# 使用 python3 -m uv 确保 uv 命令可用
_UV="python3 -m uv"
$_UV --version
# Use Python 3.12 for onnxruntime-gpu compatibility
$_UV venv --python 3.12
- name: Install dependencies
shell: bash
run: |
set -e
python3 -m uv sync --extra dev --extra deepdoc
- name: Download NLTK data
shell: bash
run: |
set -e
python3 -m uv run python -c "import nltk; nltk.download('punkt_tab')"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pptxgenjs globally
run: |
set -e
npm install -g pptxgenjs@4.0.1
- name: Run tests
shell: bash
run: |
set -e
python3 -m uv run python -m pytest -m "not slow" -n 4 --dist=loadscope -v
- name: Run slow tests
shell: bash
run: |
set -e
python3 -m uv run python -m pytest -m "slow" -v
frontend-build:
runs-on: ubuntu-latest
needs: pre-commit
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
working-directory: ./frontend
run: npm ci
- name: Build frontend
working-directory: ./frontend
run: npm run build