mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 10:59:53 +00:00
## Summary This PR implements a systematic naming convention for all GitHub workflows to improve organization and discoverability. All 22 workflows have been renamed and grouped by logical categories with consistent prefixes. ## Changes ### Naming Convention - **`ci-*`**: Continuous Integration workflows (testing, linting, validation) - **`pr-*`**: PR-specific automation triggered by labels - **`release-*`**: Release management workflows - **`types-*`**: TypeScript type generation workflows - **`i18n-*`**: Internationalization workflows ### Key Renames - `tests-ci.yaml` → `ci-tests-e2e.yaml` - `vitest-tests.yaml` → `ci-tests-unit.yaml` - `storybook-and-chromatic-ci.yaml` → `ci-tests-storybook.yaml` - `auto-backport.yaml` → `pr-backport.yaml` - `claude-pr-review.yml` → `pr-claude-review.yaml` - `version-bump.yaml` → `release-version-bump.yaml` - `publish-frontend-types.yaml` → `release-npm-types.yaml` - `create-dev-pypi-package.yaml` → `release-pypi-dev.yaml` ### Test Workflow Improvements - Grouped all test workflows under `ci-tests-*` pattern - Fork-safe deployment workflows: `ci-tests-e2e-forks.yaml`, `ci-tests-storybook-forks.yaml` - Added comments explaining fork deployment security workarounds ### Documentation - Added comprehensive `.github/workflows/README.md` - Documents naming conventions, best practices, and workflow organization - Includes trigger patterns and external dependencies ## Benefits 1. **Better Organization**: Workflows are now grouped logically by prefix 2. **Improved Discoverability**: Easy to find related workflows 3. **Consistent Naming**: All workflows follow the same pattern 4. **Clear Purpose**: Workflow names immediately indicate their function 5. **Maintainable**: README provides guidelines for future workflows ## Test Plan - [x] All workflow cross-references updated - [x] Display names match new file names - [x] Fork deployment workflows properly reference main workflows - [x] Release workflows reference correct npm types workflow - [x] All workflows retain original functionality 🤖 Generated with [Claude Code](https://claude.ai/code) ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5891-refactor-reorganize-GitHub-workflows-with-consistent-naming-convention-2806d73d365081febe47c7511bf0507e) by [Unito](https://www.unito.io) --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Alexander Brown <drjkl@comfy.org>
93 lines
3.7 KiB
YAML
93 lines
3.7 KiB
YAML
name: "CI: Tests E2E (Deploy for Forks)"
|
|
description: "Deploys test results from forked PRs (forks can't access deployment secrets)"
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: ["CI: Tests E2E"]
|
|
types: [requested, completed]
|
|
|
|
env:
|
|
DATE_FORMAT: '+%m/%d/%Y, %I:%M:%S %p'
|
|
|
|
jobs:
|
|
deploy-and-comment-forked-pr:
|
|
runs-on: ubuntu-latest
|
|
if: |
|
|
github.repository == 'Comfy-Org/ComfyUI_frontend' &&
|
|
github.event.workflow_run.event == 'pull_request' &&
|
|
github.event.workflow_run.head_repository != null &&
|
|
github.event.workflow_run.repository != null &&
|
|
github.event.workflow_run.head_repository.full_name != github.event.workflow_run.repository.full_name
|
|
permissions:
|
|
pull-requests: write
|
|
actions: read
|
|
steps:
|
|
- name: Log workflow trigger info
|
|
run: |
|
|
echo "Repository: ${{ github.repository }}"
|
|
echo "Event: ${{ github.event.workflow_run.event }}"
|
|
echo "Head repo: ${{ github.event.workflow_run.head_repository.full_name || 'null' }}"
|
|
echo "Base repo: ${{ github.event.workflow_run.repository.full_name || 'null' }}"
|
|
echo "Is forked: ${{ github.event.workflow_run.head_repository.full_name != github.event.workflow_run.repository.full_name }}"
|
|
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Get PR Number
|
|
id: pr
|
|
uses: actions/github-script@v7
|
|
with:
|
|
script: |
|
|
const { data: prs } = await github.rest.pulls.list({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
state: 'open',
|
|
});
|
|
|
|
const pr = prs.find(p => p.head.sha === context.payload.workflow_run.head_sha);
|
|
|
|
if (!pr) {
|
|
console.log('No PR found for SHA:', context.payload.workflow_run.head_sha);
|
|
return null;
|
|
}
|
|
|
|
console.log(`Found PR #${pr.number} from fork: ${context.payload.workflow_run.head_repository.full_name}`);
|
|
return pr.number;
|
|
|
|
- name: Handle Test Start
|
|
if: steps.pr.outputs.result != 'null' && github.event.action == 'requested'
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
run: |
|
|
chmod +x scripts/cicd/pr-playwright-deploy-and-comment.sh
|
|
./scripts/cicd/pr-playwright-deploy-and-comment.sh \
|
|
"${{ steps.pr.outputs.result }}" \
|
|
"${{ github.event.workflow_run.head_branch }}" \
|
|
"starting" \
|
|
"$(date -u '${{ env.DATE_FORMAT }}')"
|
|
|
|
- name: Download and Deploy Reports
|
|
if: steps.pr.outputs.result != 'null' && github.event.action == 'completed'
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
run-id: ${{ github.event.workflow_run.id }}
|
|
pattern: playwright-report-*
|
|
path: reports
|
|
|
|
- name: Handle Test Completion
|
|
if: steps.pr.outputs.result != 'null' && github.event.action == 'completed'
|
|
env:
|
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
run: |
|
|
# Rename merged report if exists
|
|
[ -d "reports/playwright-report-chromium-merged" ] && \
|
|
mv reports/playwright-report-chromium-merged reports/playwright-report-chromium
|
|
|
|
chmod +x scripts/cicd/pr-playwright-deploy-and-comment.sh
|
|
./scripts/cicd/pr-playwright-deploy-and-comment.sh \
|
|
"${{ steps.pr.outputs.result }}" \
|
|
"${{ github.event.workflow_run.head_branch }}" \
|
|
"completed" |