ComfyUI/.github/workflows/test.yml
Benjamin Berman c9598ec26d include curl
2025-04-24 10:23:34 -07:00

86 lines
2.9 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_macos:
environment: "Testing"
if: false
name: Installation, Unit and Workflow Tests for macOS
runs-on: ${{ matrix.runner.labels }}
strategy:
fail-fast: false
matrix:
runner:
- labels: [ self-hosted, m1-8gb ]
steps:
- uses: actions/checkout@v4
- run: |
python3 -m venv
source venv/bin/activate
python -m pip install setuptools pip --upgrade
pip install --no-build-isolation .[dev]
- name: Run unit tests
run: |
source venv/bin/activate
pytest -v tests/unit
- name: Run all other supported tests
run: |
source venv/bin/activate
pytest -v tests/inference
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
- name: Lint for errors
run: |
source venv/bin/activate
pylint -j 8 --rcfile=.pylintrc comfy/
pylint -j 8 --rcfile=.pylintrc comfy_extras/
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, cpu]
container: "ubuntu:22.04"
- labels: [self-hosted, Linux, X64, cuda-3090-24gb]
container: "nvcr.io/nvidia/pytorch:24.06-py3-igpu"
steps:
- run: |
apt update || true
apt install -y curl nodejs python3 python3-pip git build-essential ffmpeg libsm6 libxext6 || true
pip uninstall -y $(pip list --format=freeze | grep opencv) || true
rm -rf /usr/local/lib/python3.10/dist-packages/cv2/ || rm -rf /usr/local/lib/python3.11/dist-packages/cv2/ || rm -rf /usr/local/lib/python3.12/dist-packages/cv2/ || true
ln -s `which python3` /usr/bin/python || true
ln -s `which pip3` /usr/bin/pip || true
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_TORCH_BACKEND=auto uv pip install "comfyui[dev] @ git+https://github.com/hiddenswitch/comfyui"
- name: Run tests
run: |
export HSA_OVERRIDE_GFX_VERSION=11.0.0
export HIP_VISIBLE_DEVICES=0
nvidia-smi || rocminfo || true
pytest -v tests/unit
- name: Lint for errors
run: |
pylint --rcfile=.pylintrc comfy/
pylint --rcfile=.pylintrc comfy_extras/