ComfyUI/.github/workflows/test.yml
2025-07-16 15:14:15 -07:00

55 lines
1.8 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
apt-get install --no-install-recommends -y ffmpeg libsm6 libxext6
pip install uv && uv --version
apt-get purge -y
rm -rf /var/lib/apt/lists/*
uv pip uninstall --system $(pip list --format=freeze | grep opencv)
rm -rf /usr/local/lib/python3.12/dist-packages/cv2/
uv pip install --no-build-isolation opencv-python-headless
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
pip freeze | grep numpy > numpy_override.txt
uv pip install . --inexact --group dev --override numpy_override.txt
- name: Run tests
run: |
nvidia-smi
export OTEL_METRICS_EXPORTER=none
pytest -v tests/unit
- name: Lint for errors
run: |
pylint --rcfile=.pylintrc comfy/
pylint --rcfile=.pylintrc comfy_extras/