From 61742104195780afa8d325b5b7de5252d6e17e77 Mon Sep 17 00:00:00 2001 From: ryan-crabbe-berri Date: Fri, 10 Jul 2026 12:00:31 -0700 Subject: [PATCH] ci(ui): only run the UI build when dashboard files change build-ui ran a full `next build` (~10 min, npm ci + build) on every PR, including backend-only ones. Mirror the frontend-lint job's pattern: keep the job always running so the required check never strands, but gate the install and build steps on whether anything under ui/litellm-dashboard actually changed. On backend-only PRs the job now reports success immediately without installing or building. --- .github/workflows/test-litellm-ui-build.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/test-litellm-ui-build.yml b/.github/workflows/test-litellm-ui-build.yml index 67bec6715f03..00730947a26a 100644 --- a/.github/workflows/test-litellm-ui-build.yml +++ b/.github/workflows/test-litellm-ui-build.yml @@ -22,9 +22,23 @@ jobs: - name: Checkout repository uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: + fetch-depth: 0 persist-credentials: false + - name: Detect UI changes + id: changed + env: + BASE_SHA: ${{ github.event.pull_request.base.sha }} + run: | + if git diff --name-only "$BASE_SHA"...HEAD -- . | grep -q .; then + echo "ui_changed=true" >> "$GITHUB_OUTPUT" + else + echo "ui_changed=false" >> "$GITHUB_OUTPUT" + echo "No ui/litellm-dashboard changes in this PR; skipping build." + fi + - name: Setup Node.js + if: steps.changed.outputs.ui_changed == 'true' uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 with: node-version: "20" @@ -32,9 +46,11 @@ jobs: cache-dependency-path: ui/litellm-dashboard/package-lock.json - name: Install dependencies + if: steps.changed.outputs.ui_changed == 'true' run: npm ci - name: Build + if: steps.changed.outputs.ui_changed == 'true' run: npm run build frontend-lint: