ComfyUI/.github/workflows/test.yml
2025-09-18 13:56:30 -07:00

72 lines
2.2 KiB
YAML

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Backend Tests
#
# This workflow is a test of the python package build.
# Install Python dependencies across different Python versions.
#
on: [ push ]
jobs:
build_and_execute_linux:
environment: "Testing"
name: Installation, Unit and Workflow Tests for Linux
runs-on: ${{ matrix.runner.labels }}
container: ${{ matrix.runner.container }}
strategy:
fail-fast: false
matrix:
runner:
- labels: [self-hosted, Linux, X64, cuda-3090-24gb]
container: "nvcr.io/nvidia/pytorch:25.03-py3"
steps:
- run: |
apt-get update
# required for opencv
apt-get install --no-install-recommends -y ffmpeg libsm6 libxext6
name: Prepare Python
- run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
name: Install uv
- uses: actions/checkout@v4
name: Checkout git repo
- name: Install ComfyUI
run: |
export UV_BREAK_SYSTEM_PACKAGES=true
export UV_SYSTEM_PYTHON=true
uv pip freeze | grep numpy > numpy_override.txt
uv pip install --torch-backend=auto ".[dev]" --inexact --override numpy_override.txt
- name: Lint for errors
run: |
pylint --rcfile=.pylintrc comfy/ comfy_extras/ comfy_api/ comfy_api_nodes/
- name: Run unit tests
run: |
pytest -v tests/unit
- name: Run inference tests
run: |
pytest -v tests/inference
build_and_execute_macos:
environment: "Testing"
name: Installation Test for macOS
runs-on: macos-14
steps:
- uses: actions/checkout@v4
name: Checkout git repo
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install system dependencies
run: brew install ffmpeg
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install ComfyUI
run: |
uv venv --python 3.12
uv pip install --torch-backend=auto '.[mps,dev]' --inexact
# - name: Run tests
# run: |
# export OTEL_METRICS_EXPORTER=none
# uv run pytest -v tests/unit