llama-stack-mirror/.github/actions/setup-runner/action.yml
Ashwin Bharambe ffcb76597b fix(ci): export UV_INDEX_STRATEGY to current shell before running uv sync
The previous fix only exported UV_INDEX_STRATEGY to GITHUB_ENV, which
only affects subsequent GitHub Actions steps. However, uv sync runs in
the same step, so it never saw the UV_INDEX_STRATEGY variable.

This caused uv to fail when UV_EXTRA_INDEX_URL was set (on release
branches) because uv would find packages on test.pypi but refuse to
check PyPI for compatible versions, resulting in:

  setuptools was found on test.pypi but not at the requested version.
  A compatible version may be available on PyPI. Use --index-strategy
  unsafe-best-match to check all indexes.

The fix adds export UV_INDEX_STRATEGY=unsafe-best-match to make it
available in the current shell before running uv commands.
2025-11-01 07:45:27 -07:00

53 lines
1.9 KiB
YAML

name: Setup runner
description: Prepare a runner for the tests (install uv, python, project dependencies, etc.)
inputs:
python-version:
description: The Python version to use
required: false
default: "3.12"
client-version:
description: The llama-stack-client-python version to test against (latest or published)
required: false
default: "latest"
runs:
using: "composite"
steps:
- name: Install uv
uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
with:
python-version: ${{ inputs.python-version }}
version: 0.7.6
- name: Configure client installation
id: client-config
uses: ./.github/actions/install-llama-stack-client
with:
client-version: ${{ inputs.client-version }}
- name: Install dependencies
shell: bash
env:
UV_EXTRA_INDEX_URL: ${{ steps.client-config.outputs.uv-extra-index-url }}
run: |
# Export UV env vars for current step and persist to GITHUB_ENV for subsequent steps
if [ -n "$UV_EXTRA_INDEX_URL" ]; then
export UV_INDEX_STRATEGY=unsafe-best-match
echo "UV_EXTRA_INDEX_URL=$UV_EXTRA_INDEX_URL" >> $GITHUB_ENV
echo "UV_INDEX_STRATEGY=$UV_INDEX_STRATEGY" >> $GITHUB_ENV
echo "Exported UV environment variables for current and subsequent steps"
fi
echo "Updating project dependencies via uv sync"
uv sync --all-groups
echo "Installing ad-hoc dependencies"
uv pip install faiss-cpu
# Install specific client version after sync if needed
if [ "${{ steps.client-config.outputs.install-after-sync }}" = "true" ]; then
echo "Installing llama-stack-client from: ${{ steps.client-config.outputs.install-source }}"
uv pip install ${{ steps.client-config.outputs.install-source }}
fi
echo "Installed llama packages"
uv pip list | grep llama