mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-20 22:22:29 +00:00
Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 7.1.4 to 7.1.6. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/astral-sh/setup-uv/releases">astral-sh/setup-uv's releases</a>.</em></p> <blockquote> <h2>v7.1.6 🌈 add OS version to cache key to prevent binary incompatibility</h2> <h2>Changes</h2> <p>This release will invalidate your cache existing keys!</p> <p>The os version e.g. <code>ubuntu-22.04</code> is now part of the cache key. This prevents failing builds when a cache got populated with wheels built with different tools (e.g. glibc) than are present on the runner where the cache got restored.</p> <h2>🐛 Bug fixes</h2> <ul> <li>feat: add OS version to cache key to prevent binary incompatibility <a href="https://github.com/eifinger"><code>@eifinger</code></a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/716">#716</a>)</li> </ul> <h2>🧰 Maintenance</h2> <ul> <li>chore: update known checksums for 0.9.17 @<a href="https://github.com/apps/github-actions">github-actions[bot]</a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/714">#714</a>)</li> </ul> <h2>⬆️ Dependency updates</h2> <ul> <li>Bump actions/checkout from 5.0.0 to 6.0.1 @<a href="https://github.com/apps/dependabot">dependabot[bot]</a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/712">#712</a>)</li> <li>Bump actions/setup-node from 6.0.0 to 6.1.0 @<a href="https://github.com/apps/dependabot">dependabot[bot]</a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/715">#715</a>)</li> </ul> <h2>v7.1.5 🌈 allow setting <code>cache-local-path</code> without <code>enable-cache: true</code></h2> <h2>Changes</h2> <p><a href="https://redirect.github.com/astral-sh/setup-uv/pull/612">astral-sh/setup-uv#612</a> fixed a faulty behavior where this action set <code>UV_CACHE_DIR</code> even though <code>enable-cache</code> was <code>false</code>. It also fixed the cases were the cache dir is already configured in a settings file like <code>pyproject.toml</code> or <code>UV_CACHE_DIR</code> was already set. Here the action shouldn't overwrite or set <code>UV_CACHE_DIR</code>.</p> <p>These fixes introduced an unwanted behavior: You can still set <code>cache-local-path</code> but this action didn't do anything. This release fixes that.</p> <p>You can now use <code>cache-local-path</code> to automatically set <code>UV_CACHE_DIR</code> even when <code>enable-cache</code> is <code>false</code> (or gets set to false by default e.g. on self-hosted runners)</p> <pre lang="yaml"><code>- name: This is now possible uses: astral-sh/setup-uv@v7 with: enable-cache: false cache-local-path: "/path/to/cache" </code></pre> <h2>🐛 Bug fixes</h2> <ul> <li>allow cache-local-path w/o enable-cache <a href="https://github.com/eifinger"><code>@eifinger</code></a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/707">#707</a>)</li> </ul> <h2>🧰 Maintenance</h2> <ul> <li>set biome files.maxSize to 2MiB <a href="https://github.com/eifinger"><code>@eifinger</code></a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/708">#708</a>)</li> <li>chore: update known checksums for 0.9.16 @<a href="https://github.com/apps/github-actions">github-actions[bot]</a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/706">#706</a>)</li> <li>chore: update known checksums for 0.9.15 @<a href="https://github.com/apps/github-actions">github-actions[bot]</a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/704">#704</a>)</li> <li>chore: use <code>npm ci --ignore-scripts</code> everywhere <a href="https://github.com/woodruffw"><code>@woodruffw</code></a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/699">#699</a>)</li> <li>chore: update known checksums for 0.9.14 @<a href="https://github.com/apps/github-actions">github-actions[bot]</a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/700">#700</a>)</li> <li>chore: update known checksums for 0.9.13 @<a href="https://github.com/apps/github-actions">github-actions[bot]</a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/694">#694</a>)</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="681c641aba"><code>681c641</code></a> Bump actions/checkout from 5.0.0 to 6.0.1 (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/712">#712</a>)</li> <li><a href="2e85713bb0"><code>2e85713</code></a> Bump actions/setup-node from 6.0.0 to 6.1.0 (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/715">#715</a>)</li> <li><a href="58b6d7b303"><code>58b6d7b</code></a> fix: add OS version to cache key to prevent binary incompatibility (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/716">#716</a>)</li> <li><a href="e8b52af86e"><code>e8b52af</code></a> chore: update known checksums for 0.9.17 (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/714">#714</a>)</li> <li><a href="ed21f2f24f"><code>ed21f2f</code></a> Bump peter-evans/create-pull-request from 7.0.8 to 7.0.9 (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/695">#695</a>)</li> <li><a href="93202d8fbe"><code>93202d8</code></a> bump dependencies (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/709">#709</a>)</li> <li><a href="5ce090076d"><code>5ce0900</code></a> set biome files.maxSize to 2MiB (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/708">#708</a>)</li> <li><a href="4180991cd9"><code>4180991</code></a> allow cache-local-path w/o enable-cache (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/707">#707</a>)</li> <li><a href="0439606c8e"><code>0439606</code></a> Bump github/codeql-action from 4.30.9 to 4.31.6 (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/698">#698</a>)</li> <li><a href="7dd56c18e9"><code>7dd56c1</code></a> chore: update known checksums for 0.9.16 (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/706">#706</a>)</li> <li>Additional commits viewable in <a href="1e862dfacb...681c641aba">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
181 lines
6.4 KiB
YAML
181 lines
6.4 KiB
YAML
name: Pre-commit
|
|
|
|
run-name: Run pre-commit checks
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
- 'release-[0-9]+.[0-9]+.x'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
pre-commit:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [22]
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
with:
|
|
# For dependabot PRs, we need to checkout with a token that can push changes
|
|
token: ${{ github.actor == 'dependabot[bot]' && secrets.GITHUB_TOKEN || github.token }}
|
|
# Fetch full history for dependabot PRs to allow commits
|
|
fetch-depth: ${{ github.actor == 'dependabot[bot]' && 0 || 1 }}
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
|
|
with:
|
|
python-version: '3.12'
|
|
cache: pip
|
|
cache-dependency-path: |
|
|
**/requirements*.txt
|
|
.pre-commit-config.yaml
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
|
|
with:
|
|
node-version: ${{matrix.node-version}}
|
|
cache: 'npm'
|
|
cache-dependency-path: 'src/llama_stack_ui/'
|
|
|
|
- name: Set up uv
|
|
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
|
|
|
|
- name: Install npm dependencies
|
|
run: npm ci
|
|
working-directory: src/llama_stack_ui
|
|
|
|
- name: Install pre-commit
|
|
run: python -m pip install 'pre-commit>=4.4.0'
|
|
|
|
- name: Cache pre-commit
|
|
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v4
|
|
with:
|
|
path: ~/.cache/pre-commit
|
|
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
|
|
|
|
- name: Run pre-commit
|
|
id: precommit
|
|
run: |
|
|
set +e
|
|
pre-commit run --show-diff-on-failure --color=always --all-files 2>&1 | tee /tmp/precommit.log
|
|
status=${PIPESTATUS[0]}
|
|
echo "status=$status" >> $GITHUB_OUTPUT
|
|
exit 0
|
|
env:
|
|
SKIP: no-commit-to-branch,mypy
|
|
RUFF_OUTPUT_FORMAT: github
|
|
|
|
- name: Check pre-commit results
|
|
if: steps.precommit.outputs.status != '0'
|
|
run: |
|
|
echo "::error::Pre-commit hooks failed. Please run 'pre-commit run --all-files' locally and commit the fixes."
|
|
echo ""
|
|
echo "Failed hooks output:"
|
|
cat /tmp/precommit.log
|
|
exit 1
|
|
|
|
- name: Debug
|
|
run: |
|
|
echo "github.ref: ${{ github.ref }}"
|
|
echo "github.actor: ${{ github.actor }}"
|
|
|
|
- name: Commit changes for dependabot PRs
|
|
if: github.actor == 'dependabot[bot]'
|
|
run: |
|
|
if ! git diff --exit-code || [ -n "$(git ls-files --others --exclude-standard)" ]; then
|
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
git config --local user.name "github-actions[bot]"
|
|
|
|
# Ensure we're on the correct branch
|
|
git checkout -B ${{ github.head_ref }}
|
|
git add -A
|
|
git commit -m "Apply pre-commit fixes"
|
|
|
|
# Pull latest changes from the PR branch and rebase our commit on top
|
|
git pull --rebase origin ${{ github.head_ref }}
|
|
|
|
# Push to the PR branch
|
|
git push origin ${{ github.head_ref }}
|
|
echo "Pre-commit fixes committed and pushed"
|
|
else
|
|
echo "No changes to commit"
|
|
fi
|
|
|
|
- name: Verify no uncommitted changes
|
|
if: github.actor != 'dependabot[bot]'
|
|
run: |
|
|
if ! git diff --exit-code; then
|
|
echo "::error::There are uncommitted changes after pre-commit. Please run 'pre-commit run --all-files' locally and commit the fixes."
|
|
echo "::warning::Files with changes:"
|
|
git diff --name-status
|
|
exit 1
|
|
fi
|
|
|
|
- name: Verify if there are any new files after pre-commit
|
|
if: github.actor != 'dependabot[bot]'
|
|
run: |
|
|
unstaged_files=$(git ls-files --others --exclude-standard)
|
|
if [ -n "$unstaged_files" ]; then
|
|
echo "::error::There are new untracked files after pre-commit. Please run 'pre-commit run --all-files' locally and commit the fixes."
|
|
echo "::warning::New files:"
|
|
echo "$unstaged_files"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Configure client installation
|
|
id: client-config
|
|
uses: ./.github/actions/install-llama-stack-client
|
|
|
|
- name: Sync dev + type_checking dependencies
|
|
env:
|
|
UV_EXTRA_INDEX_URL: ${{ steps.client-config.outputs.uv-extra-index-url }}
|
|
run: |
|
|
if [ -n "$UV_EXTRA_INDEX_URL" ]; then
|
|
export UV_INDEX_STRATEGY="unsafe-best-match"
|
|
fi
|
|
|
|
uv sync --group dev --group type_checking
|
|
|
|
# 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
|
|
|
|
- name: Run mypy (full type_checking)
|
|
env:
|
|
UV_EXTRA_INDEX_URL: ${{ steps.client-config.outputs.uv-extra-index-url }}
|
|
run: |
|
|
if [ -n "$UV_EXTRA_INDEX_URL" ]; then
|
|
export UV_INDEX_STRATEGY="unsafe-best-match"
|
|
fi
|
|
|
|
set +e
|
|
uv run --group dev --group type_checking mypy
|
|
status=$?
|
|
if [ $status -ne 0 ]; then
|
|
echo "::error::Full mypy failed. Reproduce locally with 'uv run pre-commit run mypy-full --hook-stage manual --all-files'."
|
|
fi
|
|
exit $status
|
|
|
|
- name: Check if any unused recordings
|
|
run: |
|
|
set -e
|
|
PYTHONPATH=$PWD uv run ./scripts/cleanup_recordings.py --delete
|
|
changes=$(git status --short tests/integration | grep 'recordings' || true)
|
|
if [ -n "$changes" ]; then
|
|
echo "::error::Unused integration recordings detected. Run 'PYTHONPATH=$(pwd) uv run ./scripts/cleanup_recordings.py --delete' locally and commit the deletions."
|
|
echo "$changes"
|
|
exit 1
|
|
fi
|