76 lines
1.7 KiB
YAML
76 lines
1.7 KiB
YAML
# CI Workflow for ComfyUI-Lora-Visualizer
|
|
#
|
|
# This workflow runs the same checks as the local `pdm ci` command:
|
|
# - Code formatting check with black (fails if not formatted)
|
|
# - Unit tests with pytest
|
|
# - Code quality checks with pylint
|
|
#
|
|
# Triggers:
|
|
# - Push to main branch
|
|
# - Pull requests to main branch
|
|
# - Manual dispatch via GitHub Actions UI
|
|
#
|
|
# To run the same checks locally before pushing:
|
|
# pdm ci
|
|
#
|
|
# To fix formatting issues locally:
|
|
# pdm format
|
|
|
|
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch: # Allow manual triggering
|
|
|
|
jobs:
|
|
ci:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.10'
|
|
|
|
- name: Install PDM
|
|
uses: pdm-project/setup-pdm@v4
|
|
with:
|
|
python-version: '3.10'
|
|
|
|
- name: Cache PDM dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cache/pdm
|
|
.venv
|
|
key: ${{ runner.os }}-pdm-${{ hashFiles('pdm.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pdm-
|
|
|
|
- name: Install system dependencies for Pillow
|
|
run: sudo apt-get update && sudo apt-get install -y libjpeg-dev zlib1g-dev
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
pdm sync --dev
|
|
|
|
- name: Run CI checks (format-check, test, lint)
|
|
run: |
|
|
pdm ci
|
|
|
|
- name: Upload test results
|
|
uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: test-results-${{ github.run_number }}
|
|
path: |
|
|
.coverage
|
|
htmlcov/
|
|
retention-days: 30
|