mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2025-12-16 18:02:58 +08:00
[fix] Update CI to only check changed files
- Add tj-actions/changed-files to detect modified files in PR - Only run OpenAPI validation if openapi.yaml was changed - Only run Python linting on changed Python files (excluding legacy/) - Remove incorrect "pip install ast" dependency - Remove non-standard AST parsing and import checks - Makes CI more efficient and prevents unrelated failures
This commit is contained in:
parent
a96e7b114e
commit
7a73f5db73
61
.github/workflows/ci.yml
vendored
61
.github/workflows/ci.yml
vendored
@ -13,16 +13,25 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Check if OpenAPI changed
|
||||||
|
id: openapi-changed
|
||||||
|
uses: tj-actions/changed-files@v44
|
||||||
|
with:
|
||||||
|
files: openapi.yaml
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
|
if: steps.openapi-changed.outputs.any_changed == 'true'
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '18'
|
node-version: '18'
|
||||||
|
|
||||||
- name: Install Redoc CLI
|
- name: Install Redoc CLI
|
||||||
|
if: steps.openapi-changed.outputs.any_changed == 'true'
|
||||||
run: |
|
run: |
|
||||||
npm install -g @redocly/cli
|
npm install -g @redocly/cli
|
||||||
|
|
||||||
- name: Validate OpenAPI specification
|
- name: Validate OpenAPI specification
|
||||||
|
if: steps.openapi-changed.outputs.any_changed == 'true'
|
||||||
run: |
|
run: |
|
||||||
redocly lint openapi.yaml
|
redocly lint openapi.yaml
|
||||||
|
|
||||||
@ -31,47 +40,31 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # Fetch all history for proper diff
|
||||||
|
|
||||||
|
- name: Get changed Python files
|
||||||
|
id: changed-py-files
|
||||||
|
uses: tj-actions/changed-files@v44
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
**/*.py
|
||||||
|
files_ignore: |
|
||||||
|
comfyui_manager/legacy/**
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
|
if: steps.changed-py-files.outputs.any_changed == 'true'
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.9'
|
python-version: '3.9'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
if: steps.changed-py-files.outputs.any_changed == 'true'
|
||||||
run: |
|
run: |
|
||||||
pip install ruff ast
|
pip install ruff
|
||||||
|
|
||||||
- name: Run ruff linting
|
- name: Run ruff linting on changed files
|
||||||
|
if: steps.changed-py-files.outputs.any_changed == 'true'
|
||||||
run: |
|
run: |
|
||||||
ruff check comfyui_manager/glob/manager_server.py
|
echo "Changed files: ${{ steps.changed-py-files.outputs.all_changed_files }}"
|
||||||
|
echo "${{ steps.changed-py-files.outputs.all_changed_files }}" | xargs -r ruff check
|
||||||
- name: Check Python syntax (AST parsing)
|
|
||||||
run: |
|
|
||||||
python -c "
|
|
||||||
import ast
|
|
||||||
import sys
|
|
||||||
try:
|
|
||||||
with open('comfyui_manager/glob/manager_server.py', 'r') as f:
|
|
||||||
ast.parse(f.read())
|
|
||||||
print('Python syntax is valid')
|
|
||||||
except SyntaxError as e:
|
|
||||||
print(f'Syntax error: {e}')
|
|
||||||
sys.exit(1)
|
|
||||||
"
|
|
||||||
|
|
||||||
- name: Check imports and basic compilation
|
|
||||||
run: |
|
|
||||||
cd comfyui_manager/glob && python -c "
|
|
||||||
import sys
|
|
||||||
sys.path.insert(0, '../..')
|
|
||||||
try:
|
|
||||||
import manager_server
|
|
||||||
print('Module imports successfully')
|
|
||||||
except ImportError as e:
|
|
||||||
print(f'Import warning: {e}')
|
|
||||||
# Don't fail on import errors since dependencies may not be available
|
|
||||||
except SyntaxError as e:
|
|
||||||
print(f'Syntax error: {e}')
|
|
||||||
sys.exit(1)
|
|
||||||
"
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user