Files
HappyOnigiri-ComfyUI-Meld/.github/workflows/ci.yml
T

117 lines
2.9 KiB
YAML

name: CI
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
python:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
# pyright requires Node.js (runs via npx)
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install numpy Pillow ruff mypy aiohttp
- name: Ruff format
run: python -m ruff format .
- name: Ruff check
run: python -m ruff check . --fix
- name: Mypy
run: python -m mypy py tests
- name: Pyright
run: npx pyright
- name: Fix newlines
run: python scripts/fix_newlines.py
- name: Check non-ASCII
run: python scripts/check_non_ascii.py
- name: Check TS rules
run: python scripts/check_ts_rules.py
- name: Check scripts
run: make --no-print-directory check-scripts
- name: Python tests
run: python -m unittest discover tests
- name: Check for diff
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Error: Working directory is dirty after Python CI."
echo "Please run 'make ci' locally and commit the changes."
git status --porcelain
exit 1
fi
ui:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: ui/package-lock.json
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: ui/node_modules
key: node-modules-${{ hashFiles('ui/package-lock.json') }}
- name: Install UI dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
working-directory: ui
run: npm ci
- name: Biome check
working-directory: ui
run: npx biome check --write src --error-on-warnings
- name: TypeScript check
working-directory: ui
run: npx tsc --noEmit
- name: UI tests
working-directory: ui
run: npm run test
- name: Build UI
working-directory: ui
run: npm run build
- name: Check for diff
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Error: Working directory is dirty after UI CI."
echo "Please run 'make ci' locally and commit the changes."
git status --porcelain
exit 1
fi