Files
ComfyAssets-ComfyUI-KikoTools/.github/workflows/tests.yml
T
Vito Sansevero a0b132ef7b ci: run pytest on Linux, Windows and macOS with an 85% coverage gate
tests.yml only ran inline smoke scripts on Ubuntu, never the pytest
suite, so broken tests went unnoticed on main. Mirror ComfyUI_PromptManager:

- pytest on ubuntu/windows/macos x Python 3.10-3.13 (fail-fast off)
- separate coverage job enforcing fail_under = 85
- syntax check every web/*.js as an ES module
- CPU-only torch on Linux to avoid the ~2.5 GB CUDA wheel
2026-10-13 07:13:08 -07:00

82 lines
2.3 KiB
YAML

name: Tests
permissions:
contents: read
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
test:
name: py${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: requirements-dev.txt
# The default Linux torch wheel bundles CUDA (~2.5 GB); tests only need CPU.
# Windows and macOS default wheels are already CPU-only.
- name: Install CPU torch (Linux)
if: runner.os == 'Linux'
run: |
python -m pip install --upgrade pip
pip install torch --index-url https://download.pytorch.org/whl/cpu
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt aiohttp
- name: Run tests
run: python -m pytest tests
coverage:
name: coverage gate (85%)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: pip
cache-dependency-path: requirements-dev.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install -r requirements-dev.txt aiohttp
# fail_under = 85 lives in pyproject.toml [tool.coverage.report]
- name: Measure coverage
run: python -m pytest tests --cov=kikotools --cov-report=term-missing
js-check:
name: frontend syntax
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
# No JS unit tests yet; at least make sure every module parses
- name: Check web/*.js parse as ES modules
run: |
for f in web/*.js; do
node --input-type=module --check < "$f" || { echo "Syntax error in $f"; exit 1; }
done