The crop_height and crop_width variables were assigned in both branches but never used - the actual cropping uses global_min/max values directly. Removed to eliminate dead code. Co-authored-by: Cursor Agent <cursoragent@cursor.com>
59 lines
1.6 KiB
YAML
59 lines
1.6 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.10'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install flake8
|
|
|
|
- name: Lint with flake8
|
|
run: |
|
|
# Stop the build if there are Python syntax errors or undefined names
|
|
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: ['3.9', '3.10', '3.11']
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install pytest pytest-cov
|
|
pip install -r requirements.txt
|
|
|
|
- name: Test import without DiffSynth-Studio
|
|
run: |
|
|
python -c "import sys; sys.path.insert(0, '.'); import __init__; print('Import successful')"
|
|
python -c "import sys; sys.path.insert(0, '.'); import zimage_i2l; print('zimage_i2l import successful')"
|
|
python -c "import sys; sys.path.insert(0, '.'); import image_selector; print('image_selector import successful')"
|
|
|
|
- name: Run tests
|
|
run: |
|
|
pytest tests/ --cov=. --cov-report=term-missing -v
|