Files
ComfyUI_frontend/.github/actions/setup-comfyui-server/action.yml
snomiao c1649426a9 refactor: reorganize GitHub Actions for better reusability
This refactoring improves the CI/CD workflow structure by:

- Split the monolithic setup-frontend action into two focused actions:
  - setup-frontend: Now only handles frontend dependency installation and building
  - setup-comfyui-server: New action for ComfyUI server setup and launch

- Simplified workflow structure with better separation of concerns:
  - Frontend and server setup are now independent and reusable
  - Each action has clearer responsibilities and inputs
  - Removed duplicate setup code across workflows

- Improved tests-ci.yaml workflow:
  - Uses cache/save and cache/restore for the entire workspace
  - Test jobs now restore cached build instead of rebuilding
  - Reduced redundant setup steps in each test shard
  - Better parallelization with faster test execution

- Updated all locale update workflows to use new action structure
- Made setup-playwright a standalone reusable action

Benefits:
- Faster CI runs by reducing redundant builds
- More maintainable with DRY principle
- Easier to debug individual components
- Better action reusability across workflows
2025-10-08 21:27:03 +00:00

51 lines
1.6 KiB
YAML

name: Setup ComfyUI Server
description: 'Setup ComfyUI server for continuous integration (with ComfyUI_devtools node installed)'
inputs:
extra_server_params:
description: 'Additional parameters to pass to ComfyUI server'
required: false
default: ''
launch_server:
description: 'Whether to launch the server after setup'
required: false
default: 'true'
runs:
using: 'composite'
steps:
# Note: this workflow assume frontend repo is checked out and is built in ../dist
# Checkout ComfyUI repo, install the dev_tools node and start server
- name: Checkout ComfyUI
uses: actions/checkout@v5
with:
repository: 'comfyanonymous/ComfyUI'
path: 'ComfyUI'
- name: Install ComfyUI_devtools from frontend repo
shell: bash
run: |
mkdir -p ComfyUI/custom_nodes/ComfyUI_devtools
cp -r ./tools/devtools/* ComfyUI/custom_nodes/ComfyUI_devtools/
- 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: Start ComfyUI server
if: ${{ inputs.launch_server == 'true' }}
shell: bash
working-directory: ComfyUI
run: |
python main.py --cpu --multi-user --front-end-root ../dist ${{ inputs.extra_server_params }} &
wait-for-it --service 127.0.0.1:8188 -t 600