Files

46 lines
1.6 KiB
YAML

name: Validate plugin
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
cpu-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.1
- uses: actions/setup-python@v7.0.0
with:
python-version: '3.12'
- uses: actions/setup-node@v7.1.0
with:
node-version: '22'
- name: Install CPU test dependencies
run: |
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
python -m pip install numpy Pillow
- name: Run backend regression tests
run: python -m unittest discover -s tests -v
- name: Check frontend syntax and metadata
run: |
python - <<'PY'
import pathlib, subprocess, tomllib
config = tomllib.loads(pathlib.Path('pyproject.toml').read_text(encoding='utf-8'))
assert config['project']['name'] == 'adachi-inpaint-workbench'
assert config['tool']['comfy']['DisplayName'] == 'Adachi-Inpaint-Workbench'
for source in pathlib.Path('web').glob('*.js'):
subprocess.run(['node', '--input-type=module', '--check'], input=source.read_bytes(), check=True)
PY
- name: Run all frontend regression tests
run: |
python - <<'PY'
import pathlib, subprocess
for test in sorted(pathlib.Path('tests').glob('test_*.mjs')):
print(f'Running {test}', flush=True)
subprocess.run(['node', '--experimental-default-type=module', str(test)], check=True)
PY