Skip to content

Add rank_llm ordered quality gate #645

Add rank_llm ordered quality gate

Add rank_llm ordered quality gate #645

Workflow file for this run

on:
pull_request:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
env:
TMPDIR: /mnt/tmp
PRE_COMMIT_HOME: /mnt/pre-commit-cache
steps:
- uses: actions/checkout@v4
- name: Prepare temp/cache directories on /mnt
run: |
sudo mkdir -p "$TMPDIR" "$PRE_COMMIT_HOME"
sudo chown "$USER":"$USER" "$TMPDIR" "$PRE_COMMIT_HOME"
df -h /
df -h /mnt
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.11"
- name: Create lint environment
run: uv venv --python 3.11
- name: Install lint dependencies
run: uv pip install --python .venv/bin/python ruff
- name: Run lint
run: |
.venv/bin/python -m ruff check .
.venv/bin/python -m ruff format --check .
unit_tests:
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
include:
- test-suite: analysis
install-target: .
- test-suite: evaluation
install-target: ".[pyserini]"
needs-java: true
- test-suite: rerank
install-target: ".[cloud,vllm]"
env:
TMPDIR: /mnt/tmp
JAVA_TOOL_OPTIONS: --add-modules=jdk.incubator.vector
steps:
- uses: actions/checkout@v4
- name: Prepare temp directory on /mnt
run: |
sudo mkdir -p "$TMPDIR"
sudo chown "$USER":"$USER" "$TMPDIR"
df -h /
df -h /mnt
- uses: actions/setup-java@v3
if: ${{ matrix.needs-java }}
with:
distribution: "temurin"
java-version: "21"
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.11"
- name: Create test environment
run: uv venv --python 3.11
- name: Install test environment
run: uv pip install --python .venv/bin/python -e "${{ matrix.install-target }}"
- name: Run tests
run: .venv/bin/python -m unittest discover -s "test/${{ matrix.test-suite }}"
cli_smoke:
needs: lint
runs-on: ubuntu-latest
env:
TMPDIR: /mnt/tmp
JAVA_TOOL_OPTIONS: --add-modules=jdk.incubator.vector
steps:
- uses: actions/checkout@v4
- name: Prepare temp directory on /mnt
run: |
sudo mkdir -p "$TMPDIR"
sudo chown "$USER":"$USER" "$TMPDIR"
df -h /
df -h /mnt
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.11"
- name: Create CLI environment
run: uv venv --python 3.11
- name: Install CLI smoke environment
run: |
uv pip install --python .venv/bin/python -e .
uv pip install --python .venv/bin/python fastapi uvicorn "fastmcp>=2.0,<3"
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"
- name: Run CLI smoke tests
run: |
.venv/bin/python -m unittest \
test.test_cli_packaging \
test.test_cli_scaffolding \
test.test_cli_rerank_command \
test.test_cli_validation \
test.test_cli_prompt \
test.test_cli_view \
test.test_cli_introspection \
test.test_cli_utilities \
test.test_cli_http \
test.test_cli_mcp \
test.test_cli_legacy_wrappers
mypy:
needs:
- unit_tests
- cli_smoke
runs-on: ubuntu-latest
env:
TMPDIR: /mnt/tmp
steps:
- uses: actions/checkout@v4
- name: Prepare temp directory on /mnt
run: |
sudo mkdir -p "$TMPDIR"
sudo chown "$USER":"$USER" "$TMPDIR"
df -h /
df -h /mnt
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.11"
- name: Create mypy environment
run: uv venv --python 3.11
- name: Install mypy environment
run: |
uv pip install --python .venv/bin/python -e ".[server,cloud]"
uv pip install --python .venv/bin/python mypy types-PyYAML
- name: Run mypy
run: .venv/bin/python -m mypy