Skip to content

fix: make local AI providers model-agnostic #264

fix: make local AI providers model-agnostic

fix: make local AI providers model-agnostic #264

Workflow file for this run

name: Code Quality
on:
pull_request:
branches: [main, develop]
push:
branches: [develop]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Ruff Linting
run: ruff check . --select=E,F,W --ignore=E501,E402,F401 --output-format=github
continue-on-error: true
- name: Syntax Check (Critical Files)
run: |
python -m py_compile app.py
python -m py_compile library_manager/pipeline/layer_audio_id.py
python -m py_compile library_manager/pipeline/layer_ai_queue.py
python -m py_compile library_manager/pipeline/layer_api.py
python -m py_compile library_manager/utils/validation.py
echo "✓ All critical files compile successfully"
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Tests
run: |
python test-env/test-naming-issues.py
python test-env/test-ai-providers.py
python test-env/test-ai-provider-integration.py
version-check:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check Version Bump
run: |
# Get the base branch
BASE_SHA=${{ github.event.pull_request.base.sha }}
HEAD_SHA=${{ github.event.pull_request.head.sha }}
# Get changed files
CHANGED=$(git diff --name-only $BASE_SHA...$HEAD_SHA)
echo "Changed files:"
echo "$CHANGED"
# Check if significant code changed (not just docs/README/tests)
CODE_CHANGED=$(echo "$CHANGED" | grep -E '^(app\.py|library_manager/.*\.py|templates/.*\.html|static/.*\.(js|css))$' | grep -v '^test' || true)
if [ -n "$CODE_CHANGED" ]; then
echo "Code files changed:"
echo "$CODE_CHANGED"
# Check if APP_VERSION was actually modified (not just mentioned in diff context)
if ! git diff $BASE_SHA...$HEAD_SHA -- app.py | grep -qE '^[+-].*APP_VERSION'; then
echo ""
echo "::error::Code changed but APP_VERSION not bumped!"
echo "::error::Update APP_VERSION in app.py before merging."
echo ""
echo "Changed code files that require version bump:"
echo "$CODE_CHANGED"
exit 1
else
echo "✓ APP_VERSION was updated"
fi
else
echo "✓ No significant code changes - version bump not required"
fi
echo "✓ Version check passed"