mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-13 06:07:58 +00:00
Some checks failed
SqlStore Integration Tests / test-postgres (3.12) (push) Failing after 0s
Integration Tests (Replay) / Integration Tests (, , , client=, vision=) (push) Failing after 4s
Test External Providers Installed via Module / test-external-providers-from-module (venv) (push) Has been skipped
Test Llama Stack Build / build-custom-container-distribution (push) Failing after 4s
Python Package Build Test / build (3.13) (push) Failing after 7s
Test Llama Stack Build / generate-matrix (push) Successful in 13s
Vector IO Integration Tests / test-matrix (push) Failing after 16s
Test Llama Stack Build / build-single-provider (push) Failing after 16s
Python Package Build Test / build (3.12) (push) Failing after 16s
Unit Tests / unit-tests (3.13) (push) Failing after 16s
Integration Auth Tests / test-matrix (oauth2_token) (push) Failing after 23s
Test Llama Stack Build / build (push) Failing after 9s
Unit Tests / unit-tests (3.12) (push) Failing after 25s
SqlStore Integration Tests / test-postgres (3.13) (push) Failing after 34s
Test Llama Stack Build / build-ubi9-container-distribution (push) Failing after 58s
Update ReadTheDocs / update-readthedocs (push) Failing after 55s
UI Tests / ui-tests (22) (push) Failing after 1m18s
Test External API and Providers / test-external (venv) (push) Failing after 2m2s
Pre-commit / pre-commit (push) Failing after 2m43s
# What does this PR do? Adds npm to pre-commit.yml installation and caches ui Removes node installation during pre-commit. <!-- If resolving an issue, uncomment and update the line below --> <!-- Closes #[issue-number] --> ## Test Plan <!-- Describe the tests you ran to verify your changes with result summaries. *Provide clear instructions so the plan can be easily re-executed.* --> Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
96 lines
3.2 KiB
YAML
96 lines
3.2 KiB
YAML
name: Pre-commit
|
|
|
|
run-name: Run pre-commit checks
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [main]
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
pre-commit:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
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@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.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@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
cache-dependency-path: 'llama_stack/ui/'
|
|
|
|
- name: Install npm dependencies
|
|
run: npm ci
|
|
working-directory: llama_stack/ui
|
|
|
|
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
|
|
continue-on-error: true
|
|
env:
|
|
SKIP: no-commit-to-branch
|
|
RUFF_OUTPUT_FORMAT: github
|
|
|
|
- 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 if there are any diff files after pre-commit
|
|
if: github.actor != 'dependabot[bot]'
|
|
run: |
|
|
git diff --exit-code || (echo "There are uncommitted changes, run pre-commit locally and commit again" && exit 1)
|
|
|
|
- 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 "There are uncommitted new files, run pre-commit locally and commit again"
|
|
echo "$unstaged_files"
|
|
exit 1
|
|
fi
|