-
Notifications
You must be signed in to change notification settings - Fork 274
109 lines (109 loc) · 3.91 KB
/
Copy pathpr-test.yaml
File metadata and controls
109 lines (109 loc) · 3.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: PR Tests
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- "nunchaku/**"
- "src/**"
- "tests/**"
- "examples/**"
- "scripts/**"
- ".github/workflows/pr-test.yaml"
- "!nunchaku/__version__.py"
workflow_dispatch:
inputs:
ref:
description: 'Branch, tag, or SHA to test (default: main)'
required: false
default: 'main'
concurrency:
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
run-tests:
strategy:
matrix:
gpu: ['5090', '4090']
runs-on:
- self-hosted
- ${{ matrix.gpu }}
- test
# Only run for non-draft PRs, or for workflow_dispatch events
if: |
(github.event_name == 'pull_request' && !github.event.pull_request.draft) ||
(github.event_name == 'workflow_dispatch')
env:
COMFYUI_MODELS_ROOT: "/home/nunchaku/comfyui_models"
NUNCHAKU_TEST_CACHE_ROOT: "/home/nunchaku/nunchaku_test_root"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.ref || '' }}
- name: Show current commit
run: git log -1 --oneline
- name: Set up Python
run: |
which python
echo "Setting up Python with Conda"
conda create -n test_env python=3.13 -y
- name: Install dependencies and build
run: |
source $(conda info --base)/etc/profile.d/conda.sh
conda activate test_env || { echo "Failed to activate conda env"; exit 1; }
which python
echo "Installing dependencies"
conda install -c conda-forge gxx=11 gcc=11 libsndfile -y
pip install torch==2.8 torchvision==0.23 --index-url https://download.pytorch.org/whl/cu128
pip install -e ".[ci]"
- name: Setup ComfyUI
run: |
source $(conda info --base)/etc/profile.d/conda.sh
conda activate test_env || { echo "Failed to activate conda env"; exit 1; }
which python
cd ..
rm -rf ComfyUI
mkdir -p ComfyUI
cd ComfyUI
mkdir -p "${COMFYUI_MODELS_ROOT}"
ln -s "${COMFYUI_MODELS_ROOT}" models
mkdir -p custom_nodes
cd custom_nodes
git clone -b dev https://github.com/mit-han-lab/ComfyUI-nunchaku.git
pip install -r ComfyUI-nunchaku/requirements.txt
git clone https://github.com/Fannovel16/comfyui_controlnet_aux.git
cd comfyui_controlnet_aux
git checkout cc6b232
cd ..
git clone https://github.com/CY-CHENYUE/ComfyUI-InpaintEasy.git
cd ComfyUI-InpaintEasy
pip install -r requirements.txt
git checkout d631a03
cd ..
cd ..
ln -s custom_nodes/ComfyUI-nunchaku/tests tests
pip install -r tests/requirements.txt
python custom_nodes/ComfyUI-nunchaku/scripts/download_models.py
mkdir -p input
python custom_nodes/ComfyUI-nunchaku/scripts/download_inputs.py
- name: Run ComfyUI tests
run: |
source $(conda info --base)/etc/profile.d/conda.sh
conda activate test_env || { echo "Failed to activate conda env"; exit 1; }
pwd
cd ../ComfyUI
pytest tests/test_workflows.py -x -vv --reruns 2 --reruns-delay 0
- name: Run nunchaku tests
run: |
source $(conda info --base)/etc/profile.d/conda.sh
conda activate test_env || { echo "Failed to activate conda env"; exit 1; }
which python
pytest -vv -x tests/flux/test_flux_examples.py
pytest -vv -x tests/v1/test_examples.py
python .github/workflows/run_all_tests.py
- name: clean up
if: always()
run: |
cd ..
rm -rf ComfyUI