mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-04 07:00:23 +00:00
54 lines
1.5 KiB
YAML
54 lines
1.5 KiB
YAML
name: "CI: Tests Unit"
|
|
description: "Unit and component testing with Vitest"
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master, dev*, core/*, desktop/*, sno-deploy-ghpage]
|
|
pull_request:
|
|
branches-ignore: [wip/*, draft/*, temp/*]
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "lts/*"
|
|
cache: "pnpm"
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Run Vitest tests
|
|
run: pnpm test:unit
|
|
|
|
- name: Generate test reports (on main or debug branch)
|
|
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/sno-deploy-ghpage'
|
|
run: |
|
|
mkdir -p ./vitest-reports
|
|
pnpm exec vitest \
|
|
--reporter=json --outputFile.json="./vitest-reports/results.json" \
|
|
--reporter=html --outputFile.html="./vitest-reports/index.html" \
|
|
--run
|
|
|
|
- name: Upload Vitest reports artifact (on main or debug branch)
|
|
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/sno-deploy-ghpage'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: vitest-reports
|
|
path: vitest-reports/
|
|
retention-days: 7
|