mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-05 15:40:10 +00:00
This PR introduces a reusable composite action for Playwright setup to reduce duplication across workflows. ## Changes - Created `.github/actions/setup-playwright/action.yml` composite action that: - Detects or uses provided Playwright version - Caches Playwright browsers with intelligent cache keys - Installs browsers only when cache miss occurs - Installs OS dependencies when cache hit occurs ## Technical Details - **Important:** The composite action requires `shell: bash` for all `run` steps as per [GitHub Actions requirements for composite actions](https://docs.github.com/en/actions/creating-actions/creating-a-composite-action#creating-an-action-metadata-file). This is a mandatory field for composite actions, unlike regular workflow steps. - Updated workflow paths to account for repository checkout locations (some workflows checkout to subdirectories like `ComfyUI_frontend/`) - Uses conditional caching to avoid redundant browser installations ## Benefits - Reduces code duplication across 6 workflow files - Centralizes Playwright caching logic - Consistent browser setup across all workflows - Easier maintenance and updates - Faster CI runs through intelligent caching ## Affected Workflows - `.github/workflows/test-ui.yaml` (2 uses) - `.github/workflows/i18n-custom-nodes.yaml` - `.github/workflows/i18n-node-defs.yaml` - `.github/workflows/i18n.yaml` - `.github/workflows/test-browser-exp.yaml` --------- Co-authored-by: GitHub Action <action@github.com>
47 lines
1.6 KiB
YAML
47 lines
1.6 KiB
YAML
name: Update Node Definitions Locales
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
trigger_type:
|
|
description: 'Type of trigger (manual or automatic)'
|
|
required: false
|
|
type: string
|
|
default: 'manual'
|
|
|
|
jobs:
|
|
update-locales:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: Comfy-Org/ComfyUI_frontend_setup_action@v3
|
|
- name: Setup Playwright
|
|
uses: ./.github/actions/setup-playwright
|
|
- name: Start 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.
|
|
run: pnpm dev:electron &
|
|
working-directory: ComfyUI_frontend
|
|
- name: Update en.json
|
|
run: pnpm collect-i18n -- scripts/collect-i18n-node-defs.ts
|
|
env:
|
|
PLAYWRIGHT_TEST_URL: http://localhost:5173
|
|
working-directory: ComfyUI_frontend
|
|
- name: Update translations
|
|
run: pnpm locale
|
|
env:
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
working-directory: ComfyUI_frontend
|
|
- name: Create Pull Request
|
|
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
|
|
with:
|
|
token: ${{ secrets.PR_GH_TOKEN }}
|
|
commit-message: "Update locales for node definitions"
|
|
title: "Update locales for node definitions"
|
|
body: |
|
|
Automated PR to update locales for node definitions
|
|
|
|
This PR was created automatically by the frontend update workflow.
|
|
branch: update-locales-node-defs-${{ github.event.inputs.trigger_type }}-${{ github.run_id }}
|
|
base: main
|
|
labels: dependencies
|
|
path: ComfyUI_frontend |