mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 10:42:44 +00:00
refactor: Reorganize GitHub Actions for better reusability (#5949)
## Summary This PR refactors the GitHub Actions workflow structure to improve reusability, maintainability, and CI performance. ## Changes ### New Actions - **setup-comfyui-server**: New composite action that handles ComfyUI server setup and launch - Checks out ComfyUI repository - Installs ComfyUI_devtools custom node - Sets up Python environment and dependencies - Optionally launches the server with configurable parameters ### Refactored Actions - **setup-frontend**: Simplified to focus only on frontend-specific tasks - Installs pnpm and Node.js - Installs dependencies - Optionally builds the frontend (can be skipped when using cached builds) - No longer handles server setup or checkout ### Workflow Improvements #### tests-ci.yaml - Introduced a setup job that builds once and caches the entire workspace - Test jobs now restore the cached workspace instead of rebuilding - Eliminated redundant setup steps in each test shard - Better separation between setup and test execution phases - Significant performance improvement through workspace caching #### Locale Update Workflows - Updated `update-locales.yaml` to use the new action structure - Updated `update-locales-for-given-custom-node-repository.yaml` with proper custom node installation - Updated `update-node-definitions-locales.yaml` to use new actions - Removed `working-directory` references where appropriate #### Other Workflows - Updated `update-playwright-expectations.yaml` to use new action structure - Consistent action usage across all workflows ## Benefits 1. **Better Performance**: Workspace caching eliminates redundant builds in CI, significantly reducing test execution time 2. **Improved Maintainability**: Clear separation of concerns makes actions easier to understand and modify 3. **Enhanced Reusability**: Actions can be composed in different ways for different workflows 4. **DRY Principle**: Eliminated code duplication across workflows 5. **Easier Debugging**: Smaller, focused actions make it easier to identify and fix issues ## Testing - [ ] Verify tests-ci workflow runs successfully - [ ] Verify locale update workflows function correctly - [ ] Verify playwright expectations update workflow works - [ ] Confirm cache/restore mechanism works as expected ## Related Issues This refactoring addresses workflow complexity and reduces CI runtime by leveraging GitHub Actions caching more effectively. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5949-refactor-Reorganize-GitHub-Actions-for-better-reusability-2846d73d365081ae8e16f151423b5a88) by [Unito](https://www.unito.io) --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Alexander Brown <drjkl@comfy.org> Co-authored-by: DrJKL <DrJKL0424@gmail.com>
This commit is contained in:
55
.github/actions/setup-comfyui-server/action.yml
vendored
Normal file
55
.github/actions/setup-comfyui-server/action.yml
vendored
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
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: 'false'
|
||||||
|
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
|
||||||
|
if ! cp -r ./tools/devtools/* ComfyUI/custom_nodes/ComfyUI_devtools/; then
|
||||||
|
echo "::error::Failed to copy ComfyUI_devtools from ./tools/devtools/"
|
||||||
|
echo "::error::This action assumes the ComfyUI_frontend repository is checked out in the current working directory."
|
||||||
|
echo "::error::Please ensure you have run 'actions/checkout@v5' before calling this action."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- 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
|
||||||
67
.github/actions/setup-frontend/action.yml
vendored
67
.github/actions/setup-frontend/action.yml
vendored
@@ -1,30 +1,16 @@
|
|||||||
name: Setup Frontend
|
name: Setup ComfyUI Frontend
|
||||||
description: 'Setup ComfyUI frontend development environment'
|
description: 'Install nodejs/pnpm/dependencies and optionally build ComfyUI_frontend'
|
||||||
inputs:
|
inputs:
|
||||||
extra_server_params:
|
include_build_step:
|
||||||
description: 'Additional parameters to pass to ComfyUI server'
|
description: 'Include the build step to build the frontend. Set to true for workflows that need a built frontend'
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: 'false'
|
||||||
runs:
|
runs:
|
||||||
using: 'composite'
|
using: 'composite'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout ComfyUI
|
# Note: this workflow assume frontend repo is checked out in the root of the workspace
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
repository: 'comfyanonymous/ComfyUI'
|
|
||||||
path: 'ComfyUI'
|
|
||||||
|
|
||||||
- name: Checkout ComfyUI_frontend
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
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/
|
|
||||||
|
|
||||||
|
# Install pnpm, Node.js, build frontend
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
with:
|
with:
|
||||||
@@ -35,32 +21,25 @@ runs:
|
|||||||
with:
|
with:
|
||||||
node-version: 'lts/*'
|
node-version: 'lts/*'
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
cache-dependency-path: 'ComfyUI_frontend/pnpm-lock.yaml'
|
cache-dependency-path: './pnpm-lock.yaml'
|
||||||
|
|
||||||
- name: Setup Python
|
# Restore tool caches before running any build/lint operations
|
||||||
uses: actions/setup-python@v4
|
- name: Restore tool output cache
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
path: |
|
||||||
|
./.cache
|
||||||
|
./tsconfig.tsbuildinfo
|
||||||
|
key: tool-cache-${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml') }}-${{ hashFiles('./src/**/*.{ts,vue,js,mts}', './*.config.*') }}
|
||||||
|
restore-keys: |
|
||||||
|
tool-cache-${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml') }}-
|
||||||
|
tool-cache-${{ runner.os }}-
|
||||||
|
|
||||||
- name: Install Python requirements
|
- name: Install dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: ComfyUI
|
run: pnpm install --frozen-lockfile
|
||||||
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
|
- name: Build ComfyUI_frontend
|
||||||
|
if: ${{ inputs.include_build_step == 'true' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: ComfyUI_frontend
|
run: pnpm build
|
||||||
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/actions/setup-playwright/action.yml
vendored
3
.github/actions/setup-playwright/action.yml
vendored
@@ -6,7 +6,6 @@ runs:
|
|||||||
- name: Detect Playwright version
|
- name: Detect Playwright version
|
||||||
id: detect-version
|
id: detect-version
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
run: |
|
run: |
|
||||||
PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test --json | jq --raw-output '.[0].devDependencies["@playwright/test"].version')
|
PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test --json | jq --raw-output '.[0].devDependencies["@playwright/test"].version')
|
||||||
echo "playwright-version=$PLAYWRIGHT_VERSION" >> $GITHUB_OUTPUT
|
echo "playwright-version=$PLAYWRIGHT_VERSION" >> $GITHUB_OUTPUT
|
||||||
@@ -22,10 +21,8 @@ runs:
|
|||||||
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
|
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: pnpm exec playwright install chromium --with-deps
|
run: pnpm exec playwright install chromium --with-deps
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
|
|
||||||
- name: Install Playwright Browsers (operating system dependencies)
|
- name: Install Playwright Browsers (operating system dependencies)
|
||||||
if: steps.cache-playwright-browsers.outputs.cache-hit == 'true'
|
if: steps.cache-playwright-browsers.outputs.cache-hit == 'true'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: pnpm exec playwright install-deps
|
run: pnpm exec playwright install-deps
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
197
.github/workflows/tests-ci.yaml
vendored
197
.github/workflows/tests-ci.yaml
vendored
@@ -13,63 +13,27 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
cache-key: ${{ steps.cache-key.outputs.key }}
|
cache-key: ${{ steps.cache-key.outputs.key }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout ComfyUI
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
|
# Setup Test Environment, build frontend but do not start server yet
|
||||||
|
- name: Setup ComfyUI server
|
||||||
|
uses: ./.github/actions/setup-comfyui-server
|
||||||
|
- name: Setup frontend
|
||||||
|
uses: ./.github/actions/setup-frontend
|
||||||
with:
|
with:
|
||||||
repository: 'comfyanonymous/ComfyUI'
|
include_build_step: 'true'
|
||||||
path: 'ComfyUI'
|
- name: Setup Playwright
|
||||||
ref: master
|
uses: ./.github/actions/setup-playwright # Setup Playwright and cache browsers
|
||||||
|
|
||||||
- name: Checkout ComfyUI_frontend
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
path: 'ComfyUI_frontend'
|
|
||||||
|
|
||||||
- name: Copy ComfyUI_devtools from frontend repo
|
|
||||||
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
|
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: lts/*
|
|
||||||
cache: 'pnpm'
|
|
||||||
cache-dependency-path: 'ComfyUI_frontend/pnpm-lock.yaml'
|
|
||||||
|
|
||||||
- name: Cache tool outputs
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
ComfyUI_frontend/.cache
|
|
||||||
ComfyUI_frontend/tsconfig.tsbuildinfo
|
|
||||||
key: playwright-setup-cache-${{ runner.os }}-${{ hashFiles('ComfyUI_frontend/pnpm-lock.yaml') }}-${{ hashFiles('ComfyUI_frontend/src/**/*.{ts,vue,js}', 'ComfyUI_frontend/*.config.*') }}
|
|
||||||
restore-keys: |
|
|
||||||
playwright-setup-cache-${{ runner.os }}-${{ hashFiles('ComfyUI_frontend/pnpm-lock.yaml') }}-
|
|
||||||
playwright-setup-cache-${{ runner.os }}-
|
|
||||||
playwright-tools-cache-${{ runner.os }}-
|
|
||||||
|
|
||||||
- name: Build ComfyUI_frontend
|
|
||||||
run: |
|
|
||||||
pnpm install --frozen-lockfile
|
|
||||||
pnpm build
|
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
|
|
||||||
|
# Save the entire workspace as cache for later test jobs to restore
|
||||||
- name: Generate cache key
|
- name: Generate cache key
|
||||||
id: cache-key
|
id: cache-key
|
||||||
run: echo "key=$(date +%s)" >> $GITHUB_OUTPUT
|
run: echo "key=$(date +%s)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
|
||||||
- name: Save cache
|
- name: Save cache
|
||||||
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684
|
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684
|
||||||
with:
|
with:
|
||||||
path: |
|
path: .
|
||||||
ComfyUI
|
|
||||||
ComfyUI_frontend
|
|
||||||
key: comfyui-setup-${{ steps.cache-key.outputs.key }}
|
key: comfyui-setup-${{ steps.cache-key.outputs.key }}
|
||||||
|
|
||||||
# Sharded chromium tests
|
# Sharded chromium tests
|
||||||
@@ -84,54 +48,35 @@ jobs:
|
|||||||
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8]
|
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8]
|
||||||
shardTotal: [8]
|
shardTotal: [8]
|
||||||
steps:
|
steps:
|
||||||
|
# download built frontend repo from setup job
|
||||||
- name: Wait for cache propagation
|
- name: Wait for cache propagation
|
||||||
run: sleep 10
|
run: sleep 10
|
||||||
|
|
||||||
- name: Restore cached setup
|
- name: Restore cached setup
|
||||||
uses: actions/cache/restore@v4
|
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684
|
||||||
with:
|
with:
|
||||||
fail-on-cache-miss: true
|
fail-on-cache-miss: true
|
||||||
path: |
|
path: .
|
||||||
ComfyUI
|
|
||||||
ComfyUI_frontend
|
|
||||||
key: comfyui-setup-${{ needs.setup.outputs.cache-key }}
|
key: comfyui-setup-${{ needs.setup.outputs.cache-key }}
|
||||||
|
|
||||||
- name: Install pnpm
|
# Setup Test Environment for this runner, start server, use cached built frontend ./dist from 'setup' job
|
||||||
uses: pnpm/action-setup@v4
|
- name: Setup ComfyUI server
|
||||||
|
uses: ./.github/actions/setup-comfyui-server
|
||||||
with:
|
with:
|
||||||
version: 10
|
launch_server: true
|
||||||
|
- name: Setup nodejs, pnpm, reuse built frontend
|
||||||
- uses: actions/setup-python@v4
|
uses: ./.github/actions/setup-frontend
|
||||||
with:
|
|
||||||
python-version: '3.10'
|
|
||||||
cache: 'pip'
|
|
||||||
|
|
||||||
- name: Install requirements
|
|
||||||
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
|
|
||||||
working-directory: ComfyUI
|
|
||||||
|
|
||||||
|
|
||||||
- name: Setup Playwright
|
- name: Setup Playwright
|
||||||
uses: ./ComfyUI_frontend/.github/actions/setup-playwright
|
uses: ./.github/actions/setup-playwright
|
||||||
|
|
||||||
- name: Start ComfyUI server
|
|
||||||
run: |
|
|
||||||
python main.py --cpu --multi-user --front-end-root ../ComfyUI_frontend/dist &
|
|
||||||
wait-for-it --service 127.0.0.1:8188 -t 600
|
|
||||||
working-directory: ComfyUI
|
|
||||||
|
|
||||||
|
# Run sharded tests and upload sharded reports
|
||||||
- name: Run Playwright tests (Shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }})
|
- name: Run Playwright tests (Shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }})
|
||||||
id: playwright
|
id: playwright
|
||||||
run: pnpm exec playwright test --project=chromium --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --reporter=blob
|
run: pnpm exec playwright test --project=chromium --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --reporter=blob
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
env:
|
env:
|
||||||
PLAYWRIGHT_BLOB_OUTPUT_DIR: ../blob-report
|
PLAYWRIGHT_BLOB_OUTPUT_DIR: ./blob-report
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- name: Upload blob report
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
if: ${{ !cancelled() }}
|
if: ${{ !cancelled() }}
|
||||||
with:
|
with:
|
||||||
name: blob-report-chromium-${{ matrix.shardIndex }}
|
name: blob-report-chromium-${{ matrix.shardIndex }}
|
||||||
@@ -150,45 +95,27 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
browser: [chromium-2x, chromium-0.5x, mobile-chrome]
|
browser: [chromium-2x, chromium-0.5x, mobile-chrome]
|
||||||
steps:
|
steps:
|
||||||
|
# download built frontend repo from setup job
|
||||||
- name: Wait for cache propagation
|
- name: Wait for cache propagation
|
||||||
run: sleep 10
|
run: sleep 10
|
||||||
|
|
||||||
- name: Restore cached setup
|
- name: Restore cached setup
|
||||||
uses: actions/cache/restore@v4
|
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684
|
||||||
with:
|
with:
|
||||||
fail-on-cache-miss: true
|
fail-on-cache-miss: true
|
||||||
path: |
|
path: .
|
||||||
ComfyUI
|
|
||||||
ComfyUI_frontend
|
|
||||||
key: comfyui-setup-${{ needs.setup.outputs.cache-key }}
|
key: comfyui-setup-${{ needs.setup.outputs.cache-key }}
|
||||||
|
|
||||||
- name: Install pnpm
|
# Setup Test Environment for this runner, start server, use cached built frontend ./dist from 'setup' job
|
||||||
uses: pnpm/action-setup@v4
|
- name: Setup ComfyUI server
|
||||||
|
uses: ./.github/actions/setup-comfyui-server
|
||||||
with:
|
with:
|
||||||
version: 10
|
launch_server: true
|
||||||
|
- name: Setup nodejs, pnpm, reuse built frontend
|
||||||
- uses: actions/setup-python@v4
|
uses: ./.github/actions/setup-frontend
|
||||||
with:
|
|
||||||
python-version: '3.10'
|
|
||||||
cache: 'pip'
|
|
||||||
|
|
||||||
- name: Install requirements
|
|
||||||
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
|
|
||||||
working-directory: ComfyUI
|
|
||||||
|
|
||||||
- name: Setup Playwright
|
- name: Setup Playwright
|
||||||
uses: ./ComfyUI_frontend/.github/actions/setup-playwright
|
uses: ./.github/actions/setup-playwright
|
||||||
|
|
||||||
- name: Start ComfyUI server
|
|
||||||
run: |
|
|
||||||
python main.py --cpu --multi-user --front-end-root ../ComfyUI_frontend/dist &
|
|
||||||
wait-for-it --service 127.0.0.1:8188 -t 600
|
|
||||||
working-directory: ComfyUI
|
|
||||||
|
|
||||||
|
# Run tests and upload reports
|
||||||
- name: Run Playwright tests (${{ matrix.browser }})
|
- name: Run Playwright tests (${{ matrix.browser }})
|
||||||
id: playwright
|
id: playwright
|
||||||
run: |
|
run: |
|
||||||
@@ -198,13 +125,13 @@ jobs:
|
|||||||
--reporter=list \
|
--reporter=list \
|
||||||
--reporter=html \
|
--reporter=html \
|
||||||
--reporter=json
|
--reporter=json
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- name: Upload Playwright report
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
if: always()
|
if: always()
|
||||||
with:
|
with:
|
||||||
name: playwright-report-${{ matrix.browser }}
|
name: playwright-report-${{ matrix.browser }}
|
||||||
path: ComfyUI_frontend/playwright-report/
|
path: ./playwright-report/
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
# Merge sharded test reports
|
# Merge sharded test reports
|
||||||
@@ -213,31 +140,19 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ !cancelled() }}
|
if: ${{ !cancelled() }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout ComfyUI_frontend
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
with:
|
|
||||||
path: 'ComfyUI_frontend'
|
|
||||||
|
|
||||||
- name: Install pnpm
|
# Setup Test Environment, we only need playwright to merge reports
|
||||||
uses: pnpm/action-setup@v4
|
- name: Setup frontend
|
||||||
with:
|
uses: ./.github/actions/setup-frontend
|
||||||
version: 10
|
- name: Setup Playwright
|
||||||
|
uses: ./.github/actions/setup-playwright
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: lts/*
|
|
||||||
cache: 'pnpm'
|
|
||||||
cache-dependency-path: 'ComfyUI_frontend/pnpm-lock.yaml'
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
pnpm install --frozen-lockfile
|
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
|
|
||||||
- name: Download blob reports
|
- name: Download blob reports
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: ComfyUI_frontend/all-blob-reports
|
path: ./all-blob-reports
|
||||||
pattern: blob-report-chromium-*
|
pattern: blob-report-chromium-*
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|
||||||
@@ -248,13 +163,12 @@ jobs:
|
|||||||
# Generate JSON report separately with explicit output path
|
# Generate JSON report separately with explicit output path
|
||||||
PLAYWRIGHT_JSON_OUTPUT_NAME=playwright-report/report.json \
|
PLAYWRIGHT_JSON_OUTPUT_NAME=playwright-report/report.json \
|
||||||
pnpm exec playwright merge-reports --reporter=json ./all-blob-reports
|
pnpm exec playwright merge-reports --reporter=json ./all-blob-reports
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
|
|
||||||
- name: Upload HTML report
|
- name: Upload HTML report
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: playwright-report-chromium
|
name: playwright-report-chromium
|
||||||
path: ComfyUI_frontend/playwright-report/
|
path: ./playwright-report/
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
#### BEGIN Deployment and commenting (non-forked PRs only)
|
#### BEGIN Deployment and commenting (non-forked PRs only)
|
||||||
@@ -270,11 +184,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Get start time
|
- name: Get start time
|
||||||
id: start-time
|
id: start-time
|
||||||
run: echo "time=$(date -u '+%m/%d/%Y, %I:%M:%S %p')" >> $GITHUB_OUTPUT
|
run: echo "time=$(date -u '+%m/%d/%Y, %I:%M:%S %p')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Post starting comment
|
- name: Post starting comment
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
@@ -285,7 +199,7 @@ jobs:
|
|||||||
"${{ github.head_ref }}" \
|
"${{ github.head_ref }}" \
|
||||||
"starting" \
|
"starting" \
|
||||||
"${{ steps.start-time.outputs.time }}"
|
"${{ steps.start-time.outputs.time }}"
|
||||||
|
|
||||||
# Deploy and comment for non-forked PRs only
|
# Deploy and comment for non-forked PRs only
|
||||||
deploy-and-comment:
|
deploy-and-comment:
|
||||||
needs: [playwright-tests, merge-reports]
|
needs: [playwright-tests, merge-reports]
|
||||||
@@ -297,23 +211,20 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Download all playwright reports
|
- name: Download all playwright reports
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
pattern: playwright-report-*
|
pattern: playwright-report-*
|
||||||
path: reports
|
path: reports
|
||||||
|
|
||||||
- name: Make deployment script executable
|
|
||||||
run: chmod +x scripts/cicd/pr-playwright-deploy-and-comment.sh
|
|
||||||
|
|
||||||
- name: Deploy reports and comment on PR
|
- name: Deploy reports and comment on PR
|
||||||
env:
|
env:
|
||||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
run: |
|
run: |
|
||||||
./scripts/cicd/pr-playwright-deploy-and-comment.sh \
|
bash ./scripts/cicd/pr-playwright-deploy-and-comment.sh \
|
||||||
"${{ github.event.pull_request.number }}" \
|
"${{ github.event.pull_request.number }}" \
|
||||||
"${{ github.head_ref }}" \
|
"${{ github.head_ref }}" \
|
||||||
"completed"
|
"completed"
|
||||||
|
|||||||
@@ -21,90 +21,64 @@ jobs:
|
|||||||
update-locales:
|
update-locales:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout ComfyUI
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
|
# Setup playwright environment with custom node repository
|
||||||
|
- name: Setup ComfyUI Server (without launching)
|
||||||
|
uses: ./.github/actions/setup-comfyui-server
|
||||||
|
- name: Setup frontend
|
||||||
|
uses: ./.github/actions/setup-frontend
|
||||||
with:
|
with:
|
||||||
repository: comfyanonymous/ComfyUI
|
include_build_step: 'true'
|
||||||
path: ComfyUI
|
- name: Setup Playwright
|
||||||
ref: master
|
uses: ./.github/actions/setup-playwright
|
||||||
- name: Checkout ComfyUI_frontend
|
|
||||||
uses: actions/checkout@v5
|
# Install the custom node repository
|
||||||
with:
|
|
||||||
repository: Comfy-Org/ComfyUI_frontend
|
|
||||||
path: ComfyUI_frontend
|
|
||||||
- name: Copy ComfyUI_devtools from frontend repo
|
|
||||||
run: |
|
|
||||||
mkdir -p ComfyUI/custom_nodes/ComfyUI_devtools
|
|
||||||
cp -r ComfyUI_frontend/tools/devtools/* ComfyUI/custom_nodes/ComfyUI_devtools/
|
|
||||||
- name: Checkout custom node repository
|
- name: Checkout custom node repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
repository: ${{ inputs.owner }}/${{ inputs.repository }}
|
repository: ${{ inputs.owner }}/${{ inputs.repository }}
|
||||||
path: 'ComfyUI/custom_nodes/${{ inputs.repository }}'
|
path: 'ComfyUI/custom_nodes/${{ inputs.repository }}'
|
||||||
- name: Install pnpm
|
- name: Install custom node Python requirements
|
||||||
uses: pnpm/action-setup@v4
|
working-directory: ComfyUI/custom_nodes/${{ inputs.repository }}
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 'lts/*'
|
|
||||||
cache: 'pnpm'
|
|
||||||
- uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: '3.10'
|
|
||||||
- name: Install ComfyUI requirements
|
|
||||||
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
|
|
||||||
working-directory: ComfyUI
|
|
||||||
- name: Install custom node requirements
|
|
||||||
run: |
|
run: |
|
||||||
if [ -f "requirements.txt" ]; then
|
if [ -f "requirements.txt" ]; then
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
fi
|
fi
|
||||||
working-directory: ComfyUI/custom_nodes/${{ inputs.repository }}
|
|
||||||
- name: Build & Install ComfyUI_frontend
|
# Start ComfyUI Server
|
||||||
run: |
|
- name: Start ComfyUI Server
|
||||||
pnpm install --frozen-lockfile
|
shell: bash
|
||||||
pnpm build
|
|
||||||
rm -rf ../ComfyUI/web/*
|
|
||||||
mv dist/* ../ComfyUI/web/
|
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Start ComfyUI server
|
|
||||||
run: |
|
|
||||||
python main.py --cpu --multi-user &
|
|
||||||
wait-for-it --service 127.0.0.1:8188 -t 600
|
|
||||||
working-directory: ComfyUI
|
working-directory: ComfyUI
|
||||||
- name: Setup Playwright
|
run: |
|
||||||
uses: ./ComfyUI_frontend/.github/actions/setup-playwright
|
python main.py --cpu --multi-user --front-end-root ../dist --custom-node-path ../ComfyUI/custom_nodes/${{ inputs.repository }} &
|
||||||
|
wait-for-it --service
|
||||||
|
|
||||||
- name: Start dev server
|
- name: Start dev server
|
||||||
# Run electron dev server as it is a superset of the web dev server
|
# Run electron dev server as it is a superset of the web dev server
|
||||||
# We do want electron specific UIs to be translated.
|
# We do want electron specific UIs to be translated.
|
||||||
run: pnpm dev:electron &
|
run: pnpm dev:electron &
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Capture base i18n
|
- name: Capture base i18n
|
||||||
run: pnpm exec tsx scripts/diff-i18n capture
|
run: pnpm exec tsx scripts/diff-i18n capture
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Update en.json
|
- name: Update en.json
|
||||||
run: pnpm collect-i18n
|
run: pnpm collect-i18n
|
||||||
env:
|
env:
|
||||||
PLAYWRIGHT_TEST_URL: http://localhost:5173
|
PLAYWRIGHT_TEST_URL: http://localhost:5173
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Update translations
|
- name: Update translations
|
||||||
run: pnpm locale
|
run: pnpm locale
|
||||||
env:
|
env:
|
||||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Diff base vs updated i18n
|
- name: Diff base vs updated i18n
|
||||||
run: pnpm exec tsx scripts/diff-i18n diff
|
run: pnpm exec tsx scripts/diff-i18n diff
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Update i18n in custom node repository
|
- name: Update i18n in custom node repository
|
||||||
run: |
|
run: |
|
||||||
LOCALE_DIR=ComfyUI/custom_nodes/${{ inputs.repository }}/locales/
|
LOCALE_DIR=ComfyUI/custom_nodes/${{ inputs.repository }}/locales/
|
||||||
install -d "$LOCALE_DIR"
|
install -d "$LOCALE_DIR"
|
||||||
cp -rf ComfyUI_frontend/temp/diff/* "$LOCALE_DIR"
|
cp -rf ComfyUI_frontend/temp/diff/* "$LOCALE_DIR"
|
||||||
|
|
||||||
|
# Git ops for pushing changes and creating PR
|
||||||
- name: Check and create fork of custom node repository
|
- name: Check and create fork of custom node repository
|
||||||
run: |
|
run: |
|
||||||
# Try to fork the repository
|
# Try to fork the repository
|
||||||
|
|||||||
28
.github/workflows/update-locales.yaml
vendored
28
.github/workflows/update-locales.yaml
vendored
@@ -16,36 +16,33 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Setup Frontend
|
# Setup playwright environment
|
||||||
uses: ./.github/actions/setup-frontend
|
- name: Setup ComfyUI Server
|
||||||
|
uses: ./.github/actions/setup-comfyui-server
|
||||||
- name: Cache tool outputs
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
with:
|
||||||
path: |
|
launch_server: true
|
||||||
ComfyUI_frontend/.cache
|
- name: Setup ComfyUI Frontend
|
||||||
ComfyUI_frontend/.cache
|
uses: ./.github/actions/setup-frontend
|
||||||
key: i18n-tools-cache-${{ runner.os }}-${{ hashFiles('ComfyUI_frontend/pnpm-lock.yaml') }}
|
with:
|
||||||
restore-keys: |
|
include_build_step: true
|
||||||
i18n-tools-cache-${{ runner.os }}-
|
|
||||||
- name: Setup Playwright
|
- name: Setup Playwright
|
||||||
uses: ./.github/actions/setup-playwright
|
uses: ./.github/actions/setup-playwright
|
||||||
|
|
||||||
- name: Start dev server
|
- name: Start dev server
|
||||||
# Run electron dev server as it is a superset of the web dev server
|
# Run electron dev server as it is a superset of the web dev server
|
||||||
# We do want electron specific UIs to be translated.
|
# We do want electron specific UIs to be translated.
|
||||||
run: pnpm dev:electron &
|
run: pnpm dev:electron &
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
|
# Update locales, collect new strings and update translations using OpenAI, then commit changes
|
||||||
- name: Update en.json
|
- name: Update en.json
|
||||||
run: pnpm collect-i18n
|
run: pnpm collect-i18n
|
||||||
env:
|
env:
|
||||||
PLAYWRIGHT_TEST_URL: http://localhost:5173
|
PLAYWRIGHT_TEST_URL: http://localhost:5173
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Update translations
|
- name: Update translations
|
||||||
run: pnpm locale
|
run: pnpm locale
|
||||||
env:
|
env:
|
||||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Commit updated locales
|
- name: Commit updated locales
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name 'github-actions'
|
git config --global user.name 'github-actions'
|
||||||
@@ -59,4 +56,3 @@ jobs:
|
|||||||
git add src/locales/
|
git add src/locales/
|
||||||
git diff --staged --quiet || git commit -m "Update locales [skip ci]"
|
git diff --staged --quiet || git commit -m "Update locales [skip ci]"
|
||||||
git push origin HEAD:${{ github.head_ref }}
|
git push origin HEAD:${{ github.head_ref }}
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
|
|||||||
@@ -13,24 +13,32 @@ jobs:
|
|||||||
update-locales:
|
update-locales:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: Comfy-Org/ComfyUI_frontend_setup_action@v3
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
# Setup playwright environment
|
||||||
|
- name: Setup ComfyUI Server (and start)
|
||||||
|
uses: ./.github/actions/setup-comfyui-server
|
||||||
|
with:
|
||||||
|
launch_server: true
|
||||||
|
- name: Setup frontend
|
||||||
|
uses: ./.github/actions/setup-frontend
|
||||||
|
with:
|
||||||
|
include_build_step: true
|
||||||
- name: Setup Playwright
|
- name: Setup Playwright
|
||||||
uses: ./.github/actions/setup-playwright
|
uses: ./.github/actions/setup-playwright
|
||||||
|
|
||||||
- name: Start dev server
|
- name: Start dev server
|
||||||
# Run electron dev server as it is a superset of the web dev server
|
# Run electron dev server as it is a superset of the web dev server
|
||||||
# We do want electron specific UIs to be translated.
|
# We do want electron specific UIs to be translated.
|
||||||
run: pnpm dev:electron &
|
run: pnpm dev:electron &
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Update en.json
|
- name: Update en.json
|
||||||
run: pnpm collect-i18n -- scripts/collect-i18n-node-defs.ts
|
run: pnpm collect-i18n -- scripts/collect-i18n-node-defs.ts
|
||||||
env:
|
env:
|
||||||
PLAYWRIGHT_TEST_URL: http://localhost:5173
|
PLAYWRIGHT_TEST_URL: http://localhost:5173
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Update translations
|
- name: Update translations
|
||||||
run: pnpm locale
|
run: pnpm locale
|
||||||
env:
|
env:
|
||||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
|
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
|
||||||
with:
|
with:
|
||||||
@@ -44,4 +52,3 @@ jobs:
|
|||||||
branch: update-locales-node-defs-${{ github.event.inputs.trigger_type }}-${{ github.run_id }}
|
branch: update-locales-node-defs-${{ github.event.inputs.trigger_type }}-${{ github.run_id }}
|
||||||
base: main
|
base: main
|
||||||
labels: dependencies
|
labels: dependencies
|
||||||
path: ComfyUI_frontend
|
|
||||||
@@ -54,27 +54,27 @@ jobs:
|
|||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
ref: ${{ steps.get-branch.outputs.branch }}
|
ref: ${{ steps.get-branch.outputs.branch }}
|
||||||
- name: Setup Frontend
|
- name: Setup ComfyUI Server
|
||||||
uses: ./.github/actions/setup-frontend
|
uses: ./.github/actions/setup-comfyui-server
|
||||||
|
with:
|
||||||
|
launch_server: true
|
||||||
- name: Setup Playwright
|
- name: Setup Playwright
|
||||||
uses: ./.github/actions/setup-playwright
|
uses: ./.github/actions/setup-playwright
|
||||||
- name: Run Playwright tests and update snapshots
|
- name: Run Playwright tests and update snapshots
|
||||||
id: playwright-tests
|
id: playwright-tests
|
||||||
run: pnpm exec playwright test --update-snapshots
|
run: pnpm exec playwright test --update-snapshots
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: always()
|
if: always()
|
||||||
with:
|
with:
|
||||||
name: playwright-report
|
name: playwright-report
|
||||||
path: ComfyUI_frontend/playwright-report/
|
path: ./playwright-report/
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
- name: Debugging info
|
- name: Debugging info
|
||||||
run: |
|
run: |
|
||||||
echo "PR: ${{ github.event.issue.number }}"
|
echo "PR: ${{ github.event.issue.number }}"
|
||||||
echo "Branch: ${{ steps.get-branch.outputs.branch }}"
|
echo "Branch: ${{ steps.get-branch.outputs.branch }}"
|
||||||
git status
|
git status
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Commit updated expectations
|
- name: Commit updated expectations
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name 'github-actions'
|
git config --global user.name 'github-actions'
|
||||||
@@ -86,7 +86,6 @@ jobs:
|
|||||||
git commit -m "[automated] Update test expectations"
|
git commit -m "[automated] Update test expectations"
|
||||||
git push origin ${{ steps.get-branch.outputs.branch }}
|
git push origin ${{ steps.get-branch.outputs.branch }}
|
||||||
fi
|
fi
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
|
|
||||||
- name: Add Done Reaction
|
- name: Add Done Reaction
|
||||||
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9
|
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9
|
||||||
|
|||||||
Reference in New Issue
Block a user