Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
26bae4f
[feat] Add Cloudflare Pages deployment for Playwright test reports
snomiao Aug 17, 2025
b91ba23
Fix Cloudflare project name for chromium-0.5x browser
snomiao Aug 17, 2025
c0453b4
Extract project name transformation to variable for consistent URL fo…
snomiao Aug 17, 2025
5016a68
chore(ci): update branch filters for push and pull_request events in …
snomiao Aug 17, 2025
1bdd870
Merge branch 'main' into sno-playwright-link
snomiao Aug 17, 2025
ef942b4
[feat] Improve test-ui deployment with branch isolation and building …
snomiao Aug 17, 2025
24692db
chore(test-ui.yaml): increase sleep duration from 5 to 10 seconds for…
snomiao Aug 17, 2025
00217eb
[refactor] Remove building-page to reduce complexity
snomiao Aug 17, 2025
2c32231
Merge branch 'main' into sno-playwright-link
snomiao Aug 18, 2025
67cb0e9
chore(test-ui.yaml): add a separator in the workflow file for better …
snomiao Aug 18, 2025
e307788
Merge branch 'sno-playwright-link' of github.com:Comfy-Org/ComfyUI_fr…
snomiao Aug 18, 2025
e9b1fec
[feat] Add Cloudflare Pages deployment for Playwright test reports
snomiao Aug 17, 2025
8eea0bd
Fix Cloudflare project name for chromium-0.5x browser
snomiao Aug 17, 2025
f1012cb
Extract project name transformation to variable for consistent URL fo…
snomiao Aug 17, 2025
8e88ca3
chore(ci): update branch filters for push and pull_request events in …
snomiao Aug 17, 2025
b26d088
[feat] Improve test-ui deployment with branch isolation and building …
snomiao Aug 17, 2025
ee12bae
chore(test-ui.yaml): increase sleep duration from 5 to 10 seconds for…
snomiao Aug 17, 2025
fbfaa14
[refactor] Remove building-page to reduce complexity
snomiao Aug 17, 2025
4abc8a0
chore(test-ui.yaml): add a separator in the workflow file for better …
snomiao Aug 18, 2025
f329656
Merge branch 'main' into sno-playwright-link
snomiao Aug 19, 2025
1c27316
Merge branch 'sno-playwright-link' of github.com:Comfy-Org/ComfyUI_fr…
snomiao Aug 19, 2025
abf92e0
[fix] Address PR review feedback - improve workflow architecture and …
snomiao Aug 19, 2025
9ada643
chore(test-ui.yaml): replace loading emoji with an image for better v…
snomiao Aug 19, 2025
c9167a8
style(test-ui.yaml): format message to combine two lines into one for…
snomiao Aug 19, 2025
bcd85b4
chore(test-ui.yaml): add a blank line for better readability in the w…
snomiao Aug 19, 2025
957587b
Merge branch 'main' into sno-playwright-link
snomiao Aug 19, 2025
f7280ef
style(test-ui.yaml): update loading image alt text and format message…
snomiao Aug 19, 2025
31d32a1
[architecture] Separate test execution from deployment - clean CI design
snomiao Aug 19, 2025
24a5362
[refactor] Simplify deployment architecture - remove over-engineering
snomiao Aug 19, 2025
cb2eda5
fix(workflow): reorder condition in PR comment step for clarity and c…
snomiao Aug 19, 2025
042cb5c
chore(test-ui.yaml): update deployment command to remove compatibilit…
snomiao Aug 19, 2025
8171063
Merge branch 'main' into sno-playwright-link
snomiao Aug 19, 2025
7724f96
[performance] Remove redundant branch sanitization - 75% processing r…
snomiao Aug 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[refactor] Simplify deployment architecture - remove over-engineering
**Reverted to clean, simple approach based on feedback:**

1. ✅ **Faster deployment** - Deploy immediately after each test (no waiting for matrix completion)
2. ✅ **Remove unnecessary GITHUB_OUTPUT** - Don't save exit codes, use step.conclusion instead
3. ✅ **Single job approach** - Use `if: always()` instead of separate deploy-reports job

**Key Changes:**
- Removed separate `deploy-reports` job (86 lines deleted!)
- Deploy in same job with `if: always()` - much faster
- Use `steps.playwright.conclusion` instead of captured exit codes
- Cleaner, simpler architecture with same functionality

**Benefits:**
- 🚀 **Much faster** - Reports deploy immediately per browser, not waiting for all tests
- 🧹 **Simpler** - One job handles test + deploy, easier to understand
- ✅ **Still maintains CI integrity** - Tests fail properly when they should
- 📊 **Reports always deploy** - Available for debugging regardless of test outcome

The previous approach was over-engineered. This is much cleaner and faster.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
  • Loading branch information
snomiao and claude committed Aug 19, 2025
commit 24a536205779fe82653a020dd12230c96a1f33cc
106 changes: 20 additions & 86 deletions .github/workflows/test-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,7 @@ jobs:

- name: Run Playwright tests (${{ matrix.browser }})
id: playwright
run: |
set +e # Don't exit on failure
npx playwright test --project=${{ matrix.browser }} --reporter=html
EXIT_CODE=$?
echo "exit_code=${EXIT_CODE}" >> $GITHUB_OUTPUT

# Save test result for deployment job
mkdir -p test-results
echo "${{ matrix.browser }}|${EXIT_CODE}" > test-results/${{ matrix.browser }}.txt

exit ${EXIT_CODE} # Fail the job if tests failed
run: npx playwright test --project=${{ matrix.browser }} --reporter=html
working-directory: ComfyUI_frontend

- uses: actions/upload-artifact@v4
Expand All @@ -188,72 +178,30 @@ jobs:
path: ComfyUI_frontend/playwright-report/
retention-days: 30

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.browser }}
path: test-results/
retention-days: 1

deploy-reports:
needs: [setup, playwright-tests]
if: always()
runs-on: ubuntu-latest
permissions:
pull-requests: write
issues: write
contents: read
strategy:
fail-fast: false
matrix:
browser: [chromium, chromium-2x, chromium-0.5x, mobile-chrome]
steps:
- name: Download playwright report
uses: actions/download-artifact@v4
with:
name: playwright-report-${{ matrix.browser }}
path: playwright-report

- name: Download test results
uses: actions/download-artifact@v4
with:
name: test-results-${{ matrix.browser }}
path: test-results

- name: Set project name
id: project-name
run: |
if [ "${{ matrix.browser }}" = "chromium-0.5x" ]; then
echo "name=comfyui-playwright-chromium-0-5x" >> $GITHUB_OUTPUT
else
echo "name=comfyui-playwright-${{ matrix.browser }}" >> $GITHUB_OUTPUT
fi
echo "branch=${{ needs.setup.outputs.sanitized-branch }}" >> $GITHUB_OUTPUT

- name: Deploy to Cloudflare Pages (${{ matrix.browser }})
id: cloudflare-deploy
if: always()
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy playwright-report --project-name=${{ steps.project-name.outputs.name }} --branch=${{ steps.project-name.outputs.branch }} --compatibility-date=2023-05-18
command: pages deploy ComfyUI_frontend/playwright-report --project-name=${{ steps.project-name.outputs.name }} --branch=${{ steps.project-name.outputs.branch }} --compatibility-date=2023-05-18

- name: Save deployment info for summary
if: always()
run: |
mkdir -p deployment-info
# Get actual test result from artifact
if [ -f "test-results/${{ matrix.browser }}.txt" ]; then
info=$(cat "test-results/${{ matrix.browser }}.txt")
EXIT_CODE=$(echo "$info" | cut -d'|' -f2)
# Use step conclusion to determine test result
if [ "${{ steps.playwright.conclusion }}" = "success" ]; then
EXIT_CODE="0"
else
EXIT_CODE="1" # Default to failure if no result
EXIT_CODE="1"
fi
# wrangler-action outputs deployment-url instead of url
DEPLOYMENT_URL="${{ steps.cloudflare-deploy.outputs.deployment-url || steps.cloudflare-deploy.outputs.url || format('https://{0}.{1}.pages.dev', steps.project-name.outputs.branch, steps.project-name.outputs.name) }}"
echo "${{ matrix.browser }}|${EXIT_CODE}|${DEPLOYMENT_URL}" > deployment-info/${{ matrix.browser }}.txt

- name: Upload deployment info
if: always()
uses: actions/upload-artifact@v4
with:
name: deployment-info-${{ matrix.browser }}
Expand All @@ -262,36 +210,22 @@ jobs:

- name: Get completion time
id: completion-time
if: always()
run: echo "time=$(date -u '${{ env.DATE_FORMAT }}')" >> $GITHUB_OUTPUT

- name: Comment PR - Browser Test Complete
if: github.event_name == 'pull_request'
run: |
# Get actual test result
if [ -f "test-results/${{ matrix.browser }}.txt" ]; then
info=$(cat "test-results/${{ matrix.browser }}.txt")
EXIT_CODE=$(echo "$info" | cut -d'|' -f2)
else
EXIT_CODE="1"
fi

if [ "$EXIT_CODE" = "0" ]; then
STATUS="✅"
MESSAGE="Tests passed!"
else
STATUS="❌"
MESSAGE="Tests failed!"
fi

DEPLOYMENT_URL="${{ steps.cloudflare-deploy.outputs.deployment-url || format('https://{0}.{1}.pages.dev', steps.project-name.outputs.branch, steps.project-name.outputs.name) }}"

gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
-f body="${STATUS} **${{ matrix.browser }}**: ${MESSAGE} [View Report](${DEPLOYMENT_URL})"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: github.event_name == 'pull_request' && always()
uses: edumserrano/find-create-or-update-comment@v3
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: '<!-- PLAYWRIGHT_TEST_STATUS -->'
comment-author: 'github-actions[bot]'
edit-mode: append
body: |
${{ steps.playwright.conclusion == 'success' && '✅' || '❌' }} **${{ matrix.browser }}**: ${{ steps.playwright.conclusion == 'success' && 'Tests passed!' || 'Tests failed!' }} [View Report](${{ steps.cloudflare-deploy.outputs.deployment-url || format('https://{0}.{1}.pages.dev', steps.project-name.outputs.branch, steps.project-name.outputs.name) }})

comment-summary:
needs: [playwright-tests, deploy-reports]
needs: playwright-tests
runs-on: ubuntu-latest
if: always() && github.event_name == 'pull_request'
permissions:
Expand Down
Loading