"vscode:/vscode.git/clone" did not exist on "7dca70049566b5b1c55cbd67e1cb191729a98152"
Unverified Commit c7bc61bf authored by Muyang Li's avatar Muyang Li Committed by GitHub
Browse files

chore: better pr-test (#570)

* chore: better pr-test

* update the paths
parent 6b2e7c41
...@@ -8,8 +8,13 @@ on: ...@@ -8,8 +8,13 @@ on:
- "tests/**" - "tests/**"
- "examples/**" - "examples/**"
- "scripts/**" - "scripts/**"
repository_dispatch: - ".github/workflows/**"
types: [pr-test] workflow_dispatch:
inputs:
ref:
description: 'Branch, tag, or SHA to test (default: main)'
required: false
default: 'main'
concurrency: concurrency:
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} group: ${{ github.repository }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true cancel-in-progress: true
...@@ -21,10 +26,10 @@ jobs: ...@@ -21,10 +26,10 @@ jobs:
runs-on: runs-on:
- self-hosted - self-hosted
- ${{ matrix.gpu }} - ${{ matrix.gpu }}
# Only run for non-draft PRs, or for repository_dispatch events # Only run for non-draft PRs, or for workflow_dispatch events
if: | if: |
(github.event_name == 'pull_request' && !github.event.pull_request.draft) || (github.event_name == 'pull_request' && !github.event.pull_request.draft) ||
(github.event_name == 'repository_dispatch') (github.event_name == 'workflow_dispatch')
steps: steps:
- name: Determine ref - name: Determine ref
id: set-ref id: set-ref
...@@ -32,10 +37,10 @@ jobs: ...@@ -32,10 +37,10 @@ jobs:
if [[ "${{ github.event_name }}" == "pull_request" ]]; then if [[ "${{ github.event_name }}" == "pull_request" ]]; then
# Use the merged commit SHA for PRs # Use the merged commit SHA for PRs
echo "ref=${{ github.event.pull_request.merge_commit_sha }}" >> $GITHUB_OUTPUT echo "ref=${{ github.event.pull_request.merge_commit_sha }}" >> $GITHUB_OUTPUT
elif [[ "${{ github.event_name }}" == "repository_dispatch" ]]; then elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
# Use github.event.client_payload.ref if provided, else default to main # Use github.event.inputs.ref if provided, else default to main
if [[ -n "${{ github.event.client_payload.ref }}" ]]; then if [[ -n "${{ github.event.inputs.ref }}" ]]; then
echo "ref=${{ github.event.client_payload.ref }}" >> $GITHUB_OUTPUT echo "ref=${{ github.event.inputs.ref }}" >> $GITHUB_OUTPUT
else else
echo "ref=main" >> $GITHUB_OUTPUT echo "ref=main" >> $GITHUB_OUTPUT
fi fi
...@@ -80,8 +85,8 @@ jobs: ...@@ -80,8 +85,8 @@ jobs:
yes | comfy --here install --nvidia --skip-torch-or-directml --version 0.3.44 yes | comfy --here install --nvidia --skip-torch-or-directml --version 0.3.44
cd ComfyUI cd ComfyUI
rm -r models rm -r models
mkdir -p ${{ secrets.COMFYUI_MODELS_ROOT_AMPERE }} mkdir -p ${{ secrets.COMFYUI_MODELS_ROOT }}
ln -s ${{ secrets.COMFYUI_MODELS_ROOT_AMPERE }} models ln -s ${{ secrets.COMFYUI_MODELS_ROOT }} models
cd custom_nodes cd custom_nodes
git clone -b dev https://github.com/mit-han-lab/ComfyUI-nunchaku.git git clone -b dev https://github.com/mit-han-lab/ComfyUI-nunchaku.git
cd .. cd ..
...@@ -105,8 +110,8 @@ jobs: ...@@ -105,8 +110,8 @@ jobs:
source $(conda info --base)/etc/profile.d/conda.sh source $(conda info --base)/etc/profile.d/conda.sh
conda activate test_env || { echo "Failed to activate conda env"; exit 1; } conda activate test_env || { echo "Failed to activate conda env"; exit 1; }
which python which python
NUNCHAKU_TEST_CACHE_ROOT=${{ secrets.NUNCHAKU_TEST_CACHE_ROOT_AMPERE }} HF_TOKEN=${{ secrets.HF_TOKEN }} pytest -v tests/flux/test_flux_examples.py NUNCHAKU_TEST_CACHE_ROOT=${{ secrets.NUNCHAKU_TEST_CACHE_ROOT }} HF_TOKEN=${{ secrets.HF_TOKEN }} pytest -v tests/flux/test_flux_examples.py
NUNCHAKU_TEST_CACHE_ROOT=${{ secrets.NUNCHAKU_TEST_CACHE_ROOT_AMPERE }} HF_TOKEN=${{ secrets.HF_TOKEN }} python .github/workflows/run_all_tests.py NUNCHAKU_TEST_CACHE_ROOT=${{ secrets.NUNCHAKU_TEST_CACHE_ROOT }} HF_TOKEN=${{ secrets.HF_TOKEN }} python .github/workflows/run_all_tests.py
- name: clean up - name: clean up
if: always() if: always()
run: | run: |
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment