-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (90 loc) · 3.49 KB
/
browser_tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Inspired by: https://github.com/Comfy-Org/ComfyUI_frontend/blob/57701f6145f622bf17237410c165966fb4aecc75/.github/workflows/test-ui.yaml
name: Browser Tests
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened]
paths-ignore:
- 'browser_tests/*snapshots'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
browser_tests:
runs-on: ubuntu-latest
steps:
# Ref: https://github.com/orgs/community/discussions/25199#discussioncomment-3246802
- name: Get latest ComfyUI release with tag
id: latestrelease
run: |
echo "comfy_latest_release=$(curl -s https://api.github.com/repos/comfyanonymous/ComfyUI/releases/latest | jq '.tag_name' | sed 's/\"//g')" >> $GITHUB_OUTPUT
- name: Checkout ComfyUI
uses: actions/checkout@v4
with:
repository: comfyanonymous/ComfyUI
ref: ${{ steps.latestrelease.outputs.comfy_latest_release }}
path: ComfyUI
- name: Checkout BizyAir
uses: actions/checkout@v4
with:
repository: siliconflow/BizyAir
ref: master
path: ComfyUI/custom_nodes/BizyAir
- name: Checkout bizyair_frontend
uses: actions/checkout@v4
with:
repository: siliconflow/bizyair_frontend
ref: ${{ env.BRANCH_NAME }}
path: ComfyUI/custom_nodes/BizyAir/bizyair_frontend
- uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: |
ComfyUI/requirements.txt
ComfyUI/custom_nodes/BizyAir/requirements.txt
- uses: actions/setup-node@v4
with:
node-version: '20.9.0'
cache: 'npm'
cache-dependency-path: |
ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests/package-lock.json
ComfyUI/custom_nodes/BizyAir/bizyair_frontend/package-lock.json
- name: Install dependencies
run: |
pip install -r ComfyUI/requirements.txt
pip install -r ComfyUI/custom_nodes/BizyAir/requirements.txt
pip install wait-for-it
- name: Install playwright
run: |
npm install
npx playwright install chromium --with-deps
working-directory: ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests
- name: Install bizyair_frontend dependencies
run: |
npm install
working-directory: ComfyUI/custom_nodes/BizyAir/bizyair_frontend
- name: Set up test environment
run: |
mkdir -p ComfyUI/user/default
cp -r ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests/workflows ComfyUI/user/default
- name: Update bizyair_frontend.js
run: |
npx vue-tsc -b
npx vite build
working-directory: ComfyUI/custom_nodes/BizyAir/bizyair_frontend
- name: Run Tests
env:
BIZYAIR_KEY: ${{ secrets.BIZYAIR_KEY }}
COMFY_PATH: "../../../.."
run: |
npx playwright test --workers=2
working-directory: ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests
- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: playwright-report
path: ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests/playwright-report/
retention-days: 30