Skip to content

Commit 1f49ee4

Browse files
authored
Merge branch 'Comfy-Org:main' into update-zh
2 parents 8360b08 + 8d1f8ed commit 1f49ee4

File tree

219 files changed

+2897
-2261
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

219 files changed

+2897
-2261
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Start ComfyUI Server
2+
description: 'Start ComfyUI server in a container environment (assumes ComfyUI is pre-installed)'
3+
4+
inputs:
5+
front_end_root:
6+
description: 'Path to frontend dist directory'
7+
required: false
8+
default: '$GITHUB_WORKSPACE/dist'
9+
timeout:
10+
description: 'Timeout in seconds for server startup'
11+
required: false
12+
default: '600'
13+
14+
runs:
15+
using: 'composite'
16+
steps:
17+
- name: Copy devtools and start server
18+
shell: bash
19+
run: |
20+
set -euo pipefail
21+
cp -r ./tools/devtools/* /ComfyUI/custom_nodes/ComfyUI_devtools/
22+
cd /ComfyUI && python3 main.py --cpu --multi-user --front-end-root "${{ inputs.front_end_root }}" &
23+
wait-for-it --service 127.0.0.1:8188 -t ${{ inputs.timeout }}

.github/workflows/ci-tests-e2e.yaml

Lines changed: 46 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -15,66 +15,56 @@ concurrency:
1515
jobs:
1616
setup:
1717
runs-on: ubuntu-latest
18-
outputs:
19-
cache-key: ${{ steps.cache-key.outputs.key }}
2018
steps:
2119
- name: Checkout repository
2220
uses: actions/checkout@v5
23-
24-
# Setup Test Environment, build frontend but do not start server yet
25-
- name: Setup ComfyUI server
26-
uses: ./.github/actions/setup-comfyui-server
2721
- name: Setup frontend
2822
uses: ./.github/actions/setup-frontend
2923
with:
3024
include_build_step: true
31-
- name: Setup Playwright
32-
uses: ./.github/actions/setup-playwright # Setup Playwright and cache browsers
33-
34-
# Save the entire workspace as cache for later test jobs to restore
35-
- name: Generate cache key
36-
id: cache-key
37-
run: echo "key=$(date +%s)" >> $GITHUB_OUTPUT
38-
- name: Save cache
39-
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684
25+
26+
# Upload only built dist/ (containerized test jobs will pnpm install without cache)
27+
- name: Upload built frontend
28+
uses: actions/upload-artifact@v4
4029
with:
41-
path: .
42-
key: comfyui-setup-${{ steps.cache-key.outputs.key }}
30+
name: frontend-dist
31+
path: dist/
32+
retention-days: 1
4333

4434
# Sharded chromium tests
4535
playwright-tests-chromium-sharded:
4636
needs: setup
4737
runs-on: ubuntu-latest
4838
timeout-minutes: 60
39+
container:
40+
image: ghcr.io/comfy-org/comfyui-ci-container:0.0.8
41+
credentials:
42+
username: ${{ github.actor }}
43+
password: ${{ secrets.GITHUB_TOKEN }}
4944
permissions:
5045
contents: read
46+
packages: read
5147
strategy:
5248
fail-fast: false
5349
matrix:
5450
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8]
5551
shardTotal: [8]
5652
steps:
57-
# download built frontend repo from setup job
58-
- name: Wait for cache propagation
59-
run: sleep 10
60-
- name: Restore cached setup
61-
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684
53+
- name: Checkout repository
54+
uses: actions/checkout@v5
55+
- name: Download built frontend
56+
uses: actions/download-artifact@v4
6257
with:
63-
fail-on-cache-miss: true
64-
path: .
65-
key: comfyui-setup-${{ needs.setup.outputs.cache-key }}
58+
name: frontend-dist
59+
path: dist/
6660

67-
# Setup Test Environment for this runner, start server, use cached built frontend ./dist from 'setup' job
68-
- name: Setup ComfyUI server
69-
uses: ./.github/actions/setup-comfyui-server
70-
with:
71-
launch_server: true
72-
- name: Setup nodejs, pnpm, reuse built frontend
73-
uses: ./.github/actions/setup-frontend
74-
- name: Setup Playwright
75-
uses: ./.github/actions/setup-playwright
61+
- name: Start ComfyUI server
62+
uses: ./.github/actions/start-comfyui-server
7663

77-
# Run sharded tests and upload sharded reports
64+
- name: Install frontend deps
65+
run: pnpm install --frozen-lockfile
66+
67+
# Run sharded tests (browsers pre-installed in container)
7868
- name: Run Playwright tests (Shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }})
7969
id: playwright
8070
run: pnpm exec playwright test --project=chromium --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --reporter=blob
@@ -94,39 +84,37 @@ jobs:
9484
timeout-minutes: 15
9585
needs: setup
9686
runs-on: ubuntu-latest
87+
container:
88+
image: ghcr.io/comfy-org/comfyui-ci-container:0.0.8
89+
credentials:
90+
username: ${{ github.actor }}
91+
password: ${{ secrets.GITHUB_TOKEN }}
9792
permissions:
9893
contents: read
94+
packages: read
9995
strategy:
10096
fail-fast: false
10197
matrix:
10298
browser: [chromium-2x, chromium-0.5x, mobile-chrome]
10399
steps:
104-
# download built frontend repo from setup job
105-
- name: Wait for cache propagation
106-
run: sleep 10
107-
- name: Restore cached setup
108-
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684
100+
- name: Checkout repository
101+
uses: actions/checkout@v5
102+
- name: Download built frontend
103+
uses: actions/download-artifact@v4
109104
with:
110-
fail-on-cache-miss: true
111-
path: .
112-
key: comfyui-setup-${{ needs.setup.outputs.cache-key }}
105+
name: frontend-dist
106+
path: dist/
113107

114-
# Setup Test Environment for this runner, start server, use cached built frontend ./dist from 'setup' job
115-
- name: Setup ComfyUI server
116-
uses: ./.github/actions/setup-comfyui-server
117-
with:
118-
launch_server: true
119-
- name: Setup nodejs, pnpm, reuse built frontend
120-
uses: ./.github/actions/setup-frontend
121-
- name: Setup Playwright
122-
uses: ./.github/actions/setup-playwright
108+
- name: Start ComfyUI server
109+
uses: ./.github/actions/start-comfyui-server
123110

124-
# Run tests and upload reports
111+
- name: Install frontend deps
112+
run: pnpm install --frozen-lockfile
113+
114+
# Run tests (browsers pre-installed in container)
125115
- name: Run Playwright tests (${{ matrix.browser }})
126116
id: playwright
127-
run: |
128-
# Run tests with blob reporter first
129-
pnpm exec playwright test --project=${{ matrix.browser }} --reporter=blob
117+
run: pnpm exec playwright test --project=${{ matrix.browser }} --reporter=blob
130118
env:
131119
PLAYWRIGHT_BLOB_OUTPUT_DIR: ./blob-report
132120

@@ -147,7 +135,7 @@ jobs:
147135
path: ./playwright-report/
148136
retention-days: 30
149137

150-
# Merge sharded test reports
138+
# Merge sharded test reports (no container needed - only runs CLI)
151139
merge-reports:
152140
needs: [playwright-tests-chromium-sharded]
153141
runs-on: ubuntu-latest
@@ -156,11 +144,9 @@ jobs:
156144
- name: Checkout repository
157145
uses: actions/checkout@v5
158146

159-
# Setup Test Environment, we only need playwright to merge reports
147+
# Setup pnpm/node to run playwright merge-reports (no browsers needed)
160148
- name: Setup frontend
161149
uses: ./.github/actions/setup-frontend
162-
- name: Setup Playwright
163-
uses: ./.github/actions/setup-playwright
164150

165151
- name: Download blob reports
166152
uses: actions/download-artifact@v4

.github/workflows/pr-update-playwright-expectations.yaml

Lines changed: 52 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ jobs:
2525
) &&
2626
startsWith(github.event.comment.body, '/update-playwright') )
2727
outputs:
28-
cache-key: ${{ steps.cache-key.outputs.key }}
2928
pr-number: ${{ steps.pr-info.outputs.pr-number }}
3029
branch: ${{ steps.pr-info.outputs.branch }}
3130
comment-id: ${{ steps.find-update-comment.outputs.comment-id }}
@@ -64,70 +63,63 @@ jobs:
6463
uses: ./.github/actions/setup-frontend
6564
with:
6665
include_build_step: true
67-
# Save expensive build artifacts (Python env, built frontend, node_modules)
68-
# Source code will be checked out fresh in sharded jobs
69-
- name: Generate cache key
70-
id: cache-key
71-
run: echo "key=$(date +%s)" >> $GITHUB_OUTPUT
72-
- name: Save cache
73-
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684
66+
67+
# Upload built dist/ (containerized test jobs will pnpm install without cache)
68+
- name: Upload built frontend
69+
uses: actions/upload-artifact@v4
7470
with:
75-
path: |
76-
ComfyUI
77-
dist
78-
key: comfyui-setup-${{ steps.cache-key.outputs.key }}
71+
name: frontend-dist
72+
path: dist/
73+
retention-days: 1
7974

8075
# Sharded snapshot updates
8176
update-snapshots-sharded:
8277
needs: setup
8378
runs-on: ubuntu-latest
79+
container:
80+
image: ghcr.io/comfy-org/comfyui-ci-container:0.0.8
81+
credentials:
82+
username: ${{ github.actor }}
83+
password: ${{ secrets.GITHUB_TOKEN }}
84+
permissions:
85+
contents: read
86+
packages: read
8487
strategy:
8588
fail-fast: false
8689
matrix:
8790
shardIndex: [1, 2, 3, 4]
8891
shardTotal: [4]
8992
steps:
90-
# Checkout source code fresh (not cached)
9193
- name: Checkout repository
9294
uses: actions/checkout@v5
9395
with:
9496
ref: ${{ needs.setup.outputs.branch }}
95-
96-
# Restore expensive build artifacts from setup job
97-
- name: Restore cached artifacts
98-
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684
99-
with:
100-
fail-on-cache-miss: true
101-
path: |
102-
ComfyUI
103-
dist
104-
key: comfyui-setup-${{ needs.setup.outputs.cache-key }}
105-
106-
- name: Setup ComfyUI server (from cache)
107-
uses: ./.github/actions/setup-comfyui-server
97+
- name: Download built frontend
98+
uses: actions/download-artifact@v4
10899
with:
109-
launch_server: true
100+
name: frontend-dist
101+
path: dist/
110102

111-
- name: Setup nodejs, pnpm, reuse built frontend
112-
uses: ./.github/actions/setup-frontend
103+
- name: Start ComfyUI server
104+
uses: ./.github/actions/start-comfyui-server
113105

114-
- name: Setup Playwright
115-
uses: ./.github/actions/setup-playwright
106+
- name: Install frontend deps
107+
run: pnpm install --frozen-lockfile
116108

117-
# Run sharded tests with snapshot updates
109+
# Run sharded tests with snapshot updates (browsers pre-installed in container)
118110
- name: Update snapshots (Shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }})
119111
id: playwright-tests
120112
run: pnpm exec playwright test --update-snapshots --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
121113
continue-on-error: true
122114

123-
# Identify and stage only changed snapshot files
124115
- name: Stage changed snapshot files
125116
id: changed-snapshots
117+
shell: bash
126118
run: |
127119
set -euo pipefail
128-
echo "=========================================="
129-
echo "STAGING CHANGED SNAPSHOTS (Shard ${{ matrix.shardIndex }})"
130-
echo "=========================================="
120+
121+
# Configure git safe.directory for container environment
122+
git config --global --add safe.directory "$(pwd)"
131123
132124
# Get list of changed snapshot files (including untracked/new files)
133125
changed_files=$( (
@@ -136,43 +128,25 @@ jobs:
136128
) | sort -u | grep -E '\-snapshots/' || true )
137129
138130
if [ -z "$changed_files" ]; then
139-
echo "No snapshot changes in this shard"
131+
echo "No snapshot changes in shard ${{ matrix.shardIndex }}"
140132
echo "has-changes=false" >> $GITHUB_OUTPUT
141133
exit 0
142134
fi
143135
144-
echo "✓ Found changed files:"
145-
echo "$changed_files"
146136
file_count=$(echo "$changed_files" | wc -l)
147-
echo "Count: $file_count"
137+
echo "Shard ${{ matrix.shardIndex }}: $file_count changed snapshot(s):"
138+
echo "$changed_files"
148139
echo "has-changes=true" >> $GITHUB_OUTPUT
149-
echo ""
150140
151-
# Create staging directory
141+
# Copy changed files to staging directory
152142
mkdir -p /tmp/changed_snapshots_shard
153-
154-
# Copy only changed files, preserving directory structure
155-
# Strip 'browser_tests/' prefix to avoid double nesting
156-
echo "Copying changed files to staging directory..."
157143
while IFS= read -r file; do
158-
# Skip paths that no longer exist (e.g. deletions)
159-
if [ ! -f "$file" ]; then
160-
echo " → (skipped; not a file) $file"
161-
continue
162-
fi
163-
# Remove 'browser_tests/' prefix
144+
[ -f "$file" ] || continue
164145
file_without_prefix="${file#browser_tests/}"
165-
# Create parent directories
166146
mkdir -p "/tmp/changed_snapshots_shard/$(dirname "$file_without_prefix")"
167-
# Copy file
168147
cp "$file" "/tmp/changed_snapshots_shard/$file_without_prefix"
169-
echo " → $file_without_prefix"
170148
done <<< "$changed_files"
171149
172-
echo ""
173-
echo "Staged files for upload:"
174-
find /tmp/changed_snapshots_shard -type f
175-
176150
# Upload ONLY the changed files from this shard
177151
- name: Upload changed snapshots
178152
uses: actions/upload-artifact@v4
@@ -213,9 +187,15 @@ jobs:
213187
echo "=========================================="
214188
echo "DOWNLOADED SNAPSHOT FILES"
215189
echo "=========================================="
216-
find ./downloaded-snapshots -type f
217-
echo ""
218-
echo "Total files: $(find ./downloaded-snapshots -type f | wc -l)"
190+
if [ -d "./downloaded-snapshots" ]; then
191+
find ./downloaded-snapshots -type f
192+
echo ""
193+
echo "Total files: $(find ./downloaded-snapshots -type f | wc -l)"
194+
else
195+
echo "No snapshot artifacts downloaded (no changes in any shard)"
196+
echo ""
197+
echo "Total files: 0"
198+
fi
219199
220200
# Merge only the changed files into browser_tests
221201
- name: Merge changed snapshots
@@ -226,6 +206,16 @@ jobs:
226206
echo "MERGING CHANGED SNAPSHOTS"
227207
echo "=========================================="
228208
209+
# Check if any artifacts were downloaded
210+
if [ ! -d "./downloaded-snapshots" ]; then
211+
echo "No snapshot artifacts to merge"
212+
echo "=========================================="
213+
echo "MERGE COMPLETE"
214+
echo "=========================================="
215+
echo "Shards merged: 0"
216+
exit 0
217+
fi
218+
229219
# Verify target directory exists
230220
if [ ! -d "browser_tests" ]; then
231221
echo "::error::Target directory 'browser_tests' does not exist"

THIRD_PARTY_NOTICES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AMD and the AMD Arrow logo are trademarks of Advanced Micro Devices, Inc.
13.4 KB
Loading

0 commit comments

Comments
 (0)