mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-28 02:02:08 +00:00
[feat] Add comprehensive caching to CI/CD workflows
- Add ESLint cache (.eslintcache) to auto-fix and fork PR workflows - Add npm cache to all Node.js setup steps across workflows - Add Vite build cache (node_modules/.vite) to improve build performance - Add Playwright browser cache with version-specific keys - Optimize test-ui, vitest, release, and auto-fix workflows 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
29
.github/workflows/auto-fix-and-update.yaml
vendored
29
.github/workflows/auto-fix-and-update.yaml
vendored
@@ -18,7 +18,16 @@ jobs:
|
|||||||
- name: Setup ComfyUI Frontend and Backend
|
- name: Setup ComfyUI Frontend and Backend
|
||||||
uses: Comfy-Org/ComfyUI_frontend_setup_action@v2.3
|
uses: Comfy-Org/ComfyUI_frontend_setup_action@v2.3
|
||||||
|
|
||||||
# Step 1: Run lint and format fixes
|
# Step 1: Cache ESLint for better performance
|
||||||
|
- name: Cache ESLint
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ComfyUI_frontend/.eslintcache
|
||||||
|
key: ${{ runner.os }}-eslint-${{ hashFiles('ComfyUI_frontend/eslint.config.js', 'ComfyUI_frontend/package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-eslint-
|
||||||
|
|
||||||
|
# Step 2: Run lint and format fixes
|
||||||
- name: Run ESLint with auto-fix
|
- name: Run ESLint with auto-fix
|
||||||
run: npm run lint:fix
|
run: npm run lint:fix
|
||||||
working-directory: ComfyUI_frontend
|
working-directory: ComfyUI_frontend
|
||||||
@@ -27,7 +36,7 @@ jobs:
|
|||||||
run: npm run format
|
run: npm run format
|
||||||
working-directory: ComfyUI_frontend
|
working-directory: ComfyUI_frontend
|
||||||
|
|
||||||
# Step 2: Update locales (only if there are relevant changes)
|
# Step 3: Update locales (only if there are relevant changes)
|
||||||
- name: Check if locale updates needed
|
- name: Check if locale updates needed
|
||||||
id: check-locale-changes
|
id: check-locale-changes
|
||||||
run: |
|
run: |
|
||||||
@@ -63,7 +72,7 @@ jobs:
|
|||||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||||
working-directory: ComfyUI_frontend
|
working-directory: ComfyUI_frontend
|
||||||
|
|
||||||
# Step 3: Check for any changes from both lint-format and locale updates
|
# Step 4: Check for any changes from both lint-format and locale updates
|
||||||
- name: Check for changes
|
- name: Check for changes
|
||||||
id: verify-changed-files
|
id: verify-changed-files
|
||||||
run: |
|
run: |
|
||||||
@@ -77,7 +86,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
working-directory: ComfyUI_frontend
|
working-directory: ComfyUI_frontend
|
||||||
|
|
||||||
# Step 4: Commit all changes in a single commit
|
# Step 5: Commit all changes in a single commit
|
||||||
- name: Commit auto-fixes and locale updates
|
- name: Commit auto-fixes and locale updates
|
||||||
if: steps.verify-changed-files.outputs.changed == 'true'
|
if: steps.verify-changed-files.outputs.changed == 'true'
|
||||||
run: |
|
run: |
|
||||||
@@ -94,7 +103,7 @@ jobs:
|
|||||||
git push origin HEAD:${{ github.head_ref }}
|
git push origin HEAD:${{ github.head_ref }}
|
||||||
working-directory: ComfyUI_frontend
|
working-directory: ComfyUI_frontend
|
||||||
|
|
||||||
# Step 5: Run final validation
|
# Step 6: Run final validation
|
||||||
- name: Final validation
|
- name: Final validation
|
||||||
run: |
|
run: |
|
||||||
npm run lint
|
npm run lint
|
||||||
@@ -102,7 +111,7 @@ jobs:
|
|||||||
npm run knip
|
npm run knip
|
||||||
working-directory: ComfyUI_frontend
|
working-directory: ComfyUI_frontend
|
||||||
|
|
||||||
# Step 6: Comment on PR about what was fixed
|
# Step 7: Comment on PR about what was fixed
|
||||||
- name: Comment on PR about auto-fixes
|
- name: Comment on PR about auto-fixes
|
||||||
if: steps.verify-changed-files.outputs.changed == 'true'
|
if: steps.verify-changed-files.outputs.changed == 'true'
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
@@ -149,6 +158,14 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Cache ESLint
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: .eslintcache
|
||||||
|
key: ${{ runner.os }}-eslint-fork-${{ hashFiles('eslint.config.js', 'package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-eslint-fork-
|
||||||
|
|
||||||
- name: Check linting and formatting
|
- name: Check linting and formatting
|
||||||
id: check-lint-format
|
id: check-lint-format
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
9
.github/workflows/release.yaml
vendored
9
.github/workflows/release.yaml
vendored
@@ -22,6 +22,7 @@ jobs:
|
|||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 'lts/*'
|
node-version: 'lts/*'
|
||||||
|
cache: 'npm'
|
||||||
- name: Get current version
|
- name: Get current version
|
||||||
id: current_version
|
id: current_version
|
||||||
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
|
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
|
||||||
@@ -34,6 +35,13 @@ jobs:
|
|||||||
else
|
else
|
||||||
echo "is_prerelease=false" >> $GITHUB_OUTPUT
|
echo "is_prerelease=false" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
- name: Cache Vite build
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: node_modules/.vite
|
||||||
|
key: ${{ runner.os }}-vite-release-${{ hashFiles('package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-vite-release-
|
||||||
- name: Build project
|
- name: Build project
|
||||||
env:
|
env:
|
||||||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||||
@@ -117,6 +125,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 'lts/*'
|
node-version: 'lts/*'
|
||||||
registry-url: https://registry.npmjs.org
|
registry-url: https://registry.npmjs.org
|
||||||
|
cache: 'npm'
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run build:types
|
- run: npm run build:types
|
||||||
- name: Publish package
|
- name: Publish package
|
||||||
|
|||||||
26
.github/workflows/test-ui.yaml
vendored
26
.github/workflows/test-ui.yaml
vendored
@@ -35,6 +35,16 @@ jobs:
|
|||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: lts/*
|
node-version: lts/*
|
||||||
|
cache: 'npm'
|
||||||
|
cache-dependency-path: ComfyUI_frontend/package-lock.json
|
||||||
|
|
||||||
|
- name: Cache Vite build
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ComfyUI_frontend/node_modules/.vite
|
||||||
|
key: ${{ runner.os }}-vite-build-${{ hashFiles('ComfyUI_frontend/package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-vite-build-
|
||||||
|
|
||||||
- name: Build ComfyUI_frontend
|
- name: Build ComfyUI_frontend
|
||||||
run: |
|
run: |
|
||||||
@@ -92,7 +102,23 @@ jobs:
|
|||||||
wait-for-it --service 127.0.0.1:8188 -t 600
|
wait-for-it --service 127.0.0.1:8188 -t 600
|
||||||
working-directory: ComfyUI
|
working-directory: ComfyUI
|
||||||
|
|
||||||
|
- name: Get Playwright version
|
||||||
|
id: playwright-version
|
||||||
|
run: echo "version=$(npm list @playwright/test --depth=0 --json | jq -r '.dependencies["@playwright/test"].version')" >> $GITHUB_OUTPUT
|
||||||
|
working-directory: ComfyUI_frontend
|
||||||
|
|
||||||
|
- name: Cache Playwright browsers
|
||||||
|
uses: actions/cache@v4
|
||||||
|
id: playwright-cache
|
||||||
|
with:
|
||||||
|
path: ~/.cache/ms-playwright
|
||||||
|
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}-chromium
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}-
|
||||||
|
${{ runner.os }}-playwright-
|
||||||
|
|
||||||
- name: Install Playwright Browsers
|
- name: Install Playwright Browsers
|
||||||
|
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
||||||
run: npx playwright install chromium --with-deps
|
run: npx playwright install chromium --with-deps
|
||||||
working-directory: ComfyUI_frontend
|
working-directory: ComfyUI_frontend
|
||||||
|
|
||||||
|
|||||||
9
.github/workflows/vitest.yaml
vendored
9
.github/workflows/vitest.yaml
vendored
@@ -17,10 +17,19 @@ jobs:
|
|||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 'lts/*'
|
node-version: 'lts/*'
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Cache Vite
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: node_modules/.vite
|
||||||
|
key: ${{ runner.os }}-vite-${{ hashFiles('package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-vite-
|
||||||
|
|
||||||
- name: Run Vitest tests
|
- name: Run Vitest tests
|
||||||
run: |
|
run: |
|
||||||
npm run test:component
|
npm run test:component
|
||||||
|
|||||||
Reference in New Issue
Block a user