mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-04 02:03:44 +00:00
refactor: extract client install logic into reusable action
Moved the release branch detection and client pre-install logic into a dedicated action to eliminate duplication between setup-runner and pre-commit workflows.
This commit is contained in:
parent
afa9f08823
commit
c86e6e906a
3 changed files with 41 additions and 50 deletions
28
.github/workflows/pre-commit.yml
vendored
28
.github/workflows/pre-commit.yml
vendored
|
|
@ -130,32 +130,8 @@ jobs:
|
|||
exit 1
|
||||
fi
|
||||
|
||||
- name: Install client from release branch if needed
|
||||
run: |
|
||||
# Determine the branch we're working with
|
||||
# For PRs: use base_ref (target branch)
|
||||
# For pushes: use ref (current branch)
|
||||
BRANCH="${{ github.base_ref || github.ref }}"
|
||||
BRANCH="${BRANCH#refs/heads/}" # Strip refs/heads/ prefix
|
||||
|
||||
echo "Working with branch: $BRANCH"
|
||||
|
||||
# If on a release branch, install from matching release branch BEFORE uv sync
|
||||
# This allows uv sync to resolve dependencies that reference unreleased RC versions
|
||||
if [[ "$BRANCH" =~ ^release-[0-9]+\.[0-9]+\.x$ ]]; then
|
||||
echo "Detected release branch: $BRANCH"
|
||||
echo "Checking if matching branch exists in llama-stack-client-python..."
|
||||
|
||||
# Check if the branch exists in the client repo
|
||||
if git ls-remote --exit-code --heads https://github.com/llamastack/llama-stack-client-python.git "$BRANCH" > /dev/null 2>&1; then
|
||||
echo "Installing llama-stack-client-python from matching branch: $BRANCH"
|
||||
uv pip install git+https://github.com/llamastack/llama-stack-client-python.git@$BRANCH
|
||||
else
|
||||
echo "::error::Branch $BRANCH not found in llama-stack-client-python repository"
|
||||
echo "::error::Please create the matching release branch in llama-stack-client-python before testing"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
- name: Pre-install client for release branches
|
||||
uses: ./.github/actions/install-client-for-release
|
||||
|
||||
- name: Sync dev + type_checking dependencies
|
||||
run: uv sync --group dev --group type_checking
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue