From ca6bf7d054b7643c2dc73e9f7e751d15e66a5ab2 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Thu, 12 Sep 2024 10:54:50 +0900 Subject: [PATCH] Split jest unit test and playwright test into different actions (#787) * Split jest unit test and playwright test into different actions * Use composite action * Add tag v1 --- .github/workflows/test-browser-exp.yaml | 43 +--------------- .github/workflows/test-ui.yaml | 66 +++---------------------- 2 files changed, 9 insertions(+), 100 deletions(-) diff --git a/.github/workflows/test-browser-exp.yaml b/.github/workflows/test-browser-exp.yaml index 1f96bc805..ce32876ec 100644 --- a/.github/workflows/test-browser-exp.yaml +++ b/.github/workflows/test-browser-exp.yaml @@ -12,48 +12,7 @@ jobs: runs-on: ubuntu-latest if: github.event.label.name == 'New Browser Test Expectations' steps: - - name: Checkout ComfyUI - uses: actions/checkout@v4 - with: - repository: "comfyanonymous/ComfyUI" - path: "ComfyUI" - ref: master - - name: Checkout ComfyUI_frontend - uses: actions/checkout@v4 - with: - repository: "Comfy-Org/ComfyUI_frontend" - path: "ComfyUI_frontend" - ref: ${{ github.head_ref }} - - name: Checkout ComfyUI_devtools - uses: actions/checkout@v4 - with: - repository: "Comfy-Org/ComfyUI_devtools" - path: "ComfyUI/custom_nodes/ComfyUI_devtools" - - uses: actions/setup-node@v3 - with: - node-version: lts/* - - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Install requirements - run: | - python -m pip install --upgrade pip - pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu - pip install -r requirements.txt - pip install wait-for-it - working-directory: ComfyUI - - name: Build & Install ComfyUI_frontend - run: | - npm ci - npm run build - rm -rf ../ComfyUI/web/* - mv dist/* ../ComfyUI/web/ - working-directory: ComfyUI_frontend - - name: Start ComfyUI server - run: | - python main.py --cpu & - wait-for-it --service 127.0.0.1:8188 -t 600 - working-directory: ComfyUI + - uses: Comfy-Org/ComfyUI_frontend_setup_action@v1 - name: Install Playwright Browsers run: npx playwright install chromium --with-deps working-directory: ComfyUI_frontend diff --git a/.github/workflows/test-ui.yaml b/.github/workflows/test-ui.yaml index 6912a7845..b7bd39158 100644 --- a/.github/workflows/test-ui.yaml +++ b/.github/workflows/test-ui.yaml @@ -12,71 +12,21 @@ on: - 'dev*' jobs: - test: + jest-tests: runs-on: ubuntu-latest steps: - - name: Checkout ComfyUI - uses: actions/checkout@v4 - with: - repository: "comfyanonymous/ComfyUI" - path: "ComfyUI" - ref: master - - name: Checkout ComfyUI_frontend - uses: actions/checkout@v4 - with: - repository: "Comfy-Org/ComfyUI_frontend" - path: "ComfyUI_frontend" - - name: Checkout ComfyUI_devtools - uses: actions/checkout@v4 - with: - repository: "Comfy-Org/ComfyUI_devtools" - path: "ComfyUI/custom_nodes/ComfyUI_devtools" - - name: Get commit message - id: commit-message - run: echo "::set-output name=message::$(git log -1 --pretty=%B)" - working-directory: ComfyUI_frontend - - name: Checkout ComfyUI_examples - uses: actions/checkout@v4 - with: - repository: "comfyanonymous/ComfyUI_examples" - path: "ComfyUI_frontend/tests-ui/ComfyUI_examples" - ref: master - - name: Skip CI - if: contains(steps.commit-message.outputs.message, '[skip ci]') - run: echo "Skipping CI as commit contains '[skip ci]'" - continue-on-error: true - working-directory: ComfyUI_frontend - - uses: actions/setup-node@v3 - with: - node-version: lts/* - - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Install requirements - run: | - python -m pip install --upgrade pip - pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu - pip install -r requirements.txt - pip install wait-for-it - working-directory: ComfyUI - - name: Build & Install ComfyUI_frontend - run: | - npm ci - npm run build - rm -rf ../ComfyUI/web/* - mv dist/* ../ComfyUI/web/ - working-directory: ComfyUI_frontend - - name: Start ComfyUI server - run: | - python main.py --cpu & - wait-for-it --service 127.0.0.1:8188 -t 600 - working-directory: ComfyUI - - name: Run UI tests + - uses: Comfy-Org/ComfyUI_frontend_setup_action@v1 + - name: Run Jest tests run: | npm run test:generate npm run test:generate:examples npm test -- --verbose working-directory: ComfyUI_frontend + + playwright-tests: + runs-on: ubuntu-latest + steps: + - uses: Comfy-Org/ComfyUI_frontend_setup_action@v1 - name: Install Playwright Browsers run: npx playwright install chromium --with-deps working-directory: ComfyUI_frontend