mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
Add frontend setup composite action to reduce workflow duplication (#5805)
## Summary - Adds a local composite action at `.github/actions/setup-frontend` to replace the external `Comfy-Org/ComfyUI_frontend_setup_action` - Follows the same pattern as PR #5754 (sno-playwright-composite-action) for consistency - Updates workflows to use the new local composite action ## Motivation Similar to the Playwright composite action, this change: - Reduces external dependencies on separate action repositories - Provides better control over versioning and updates - Maintains consistency with other composite actions in the repository - Simplifies maintenance by keeping all CI/CD logic in one place ## Changes ### New composite action: `.github/actions/setup-frontend/action.yml` Direct mirror of the external action with the same 2 inputs: - `extra_server_params`: Additional parameters to pass to ComfyUI server - `devtools_ref`: Reference to use for ComfyUI_devtools The action: 1. Checks out ComfyUI, ComfyUI_frontend, and ComfyUI_devtools 2. Sets up pnpm, Node.js (LTS), and Python (3.10) 3. Installs all dependencies (Python packages, npm packages) 4. Builds the frontend 5. Starts the ComfyUI server with the built frontend ### Updated workflows: - `.github/workflows/i18n.yaml` - `.github/workflows/i18n-node-defs.yaml` - `.github/workflows/test-browser-exp.yaml` All workflows now use the local composite action instead of `Comfy-Org/ComfyUI_frontend_setup_action@v3` ## Test plan - [ ] Verify all updated workflows pass CI tests - [ ] Confirm the composite action works in all scenarios - [ ] Check that build and server startup work as expected ## Related PRs - #5754 - Similar approach for Playwright composite action 🤖 Generated with [Claude Code](https://claude.ai/code)
This commit is contained in:
68
.github/actions/setup-frontend/action.yml
vendored
Normal file
68
.github/actions/setup-frontend/action.yml
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
name: Setup Frontend
|
||||
description: 'Setup ComfyUI frontend development environment'
|
||||
inputs:
|
||||
extra_server_params:
|
||||
description: 'Additional parameters to pass to ComfyUI server'
|
||||
required: false
|
||||
default: ''
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Checkout ComfyUI
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'comfyanonymous/ComfyUI'
|
||||
path: 'ComfyUI'
|
||||
ref: 'master'
|
||||
|
||||
- name: Checkout ComfyUI_frontend
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'Comfy-Org/ComfyUI_frontend'
|
||||
path: 'ComfyUI_frontend'
|
||||
|
||||
- name: Copy ComfyUI_devtools from frontend repo
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ComfyUI/custom_nodes/ComfyUI_devtools
|
||||
cp -r ComfyUI_frontend/tools/devtools/* ComfyUI/custom_nodes/ComfyUI_devtools/
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
cache: 'pnpm'
|
||||
cache-dependency-path: 'ComfyUI_frontend/pnpm-lock.yaml'
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Install Python requirements
|
||||
shell: bash
|
||||
working-directory: ComfyUI
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
|
||||
pip install -r requirements.txt
|
||||
pip install wait-for-it
|
||||
|
||||
- name: Build & Install ComfyUI_frontend
|
||||
shell: bash
|
||||
working-directory: ComfyUI_frontend
|
||||
run: |
|
||||
pnpm install --frozen-lockfile
|
||||
pnpm build
|
||||
|
||||
- name: Start ComfyUI server
|
||||
shell: bash
|
||||
working-directory: ComfyUI
|
||||
run: |
|
||||
python main.py --cpu --multi-user --front-end-root ../ComfyUI_frontend/dist ${{ inputs.extra_server_params }} &
|
||||
wait-for-it --service 127.0.0.1:8188 -t 600
|
||||
3
.github/workflows/i18n-node-defs.yaml
vendored
3
.github/workflows/i18n-node-defs.yaml
vendored
@@ -13,7 +13,8 @@ jobs:
|
||||
update-locales:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: Comfy-Org/ComfyUI_frontend_setup_action@v3
|
||||
- name: Setup Frontend
|
||||
uses: ./.github/actions/setup-frontend
|
||||
- name: Install Playwright Browsers
|
||||
run: pnpm exec playwright install chromium --with-deps
|
||||
working-directory: ComfyUI_frontend
|
||||
|
||||
3
.github/workflows/i18n.yaml
vendored
3
.github/workflows/i18n.yaml
vendored
@@ -14,7 +14,8 @@ jobs:
|
||||
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.head_ref, 'version-bump-'))
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: Comfy-Org/ComfyUI_frontend_setup_action@v3
|
||||
- name: Setup Frontend
|
||||
uses: ./.github/actions/setup-frontend
|
||||
|
||||
- name: Cache tool outputs
|
||||
uses: actions/cache@v4
|
||||
|
||||
3
.github/workflows/test-browser-exp.yaml
vendored
3
.github/workflows/test-browser-exp.yaml
vendored
@@ -10,7 +10,8 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.label.name == 'New Browser Test Expectations'
|
||||
steps:
|
||||
- uses: Comfy-Org/ComfyUI_frontend_setup_action@v3
|
||||
- name: Setup Frontend
|
||||
uses: ./.github/actions/setup-frontend
|
||||
- name: Cache Playwright browsers
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user