Files
616bf61d9d ci: adopt the sourceblender CI standard (#26)
- Concurrency: superseded PR runs are cancelled; every merged main
  commit keeps its own run.
- A version matrix runs in full on PRs and once on the push to main.
- Prose files that no test reads skip CI on the push to main, and on
  PRs too where the repo has no required status check.

Same pattern as the 2026-09-27 lumen/atelier/chord/pulse cleanup.

Co-authored-by: Aoi <aoi@harem.world>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 18:12:42 -04:00

107 lines
3.5 KiB
YAML

name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
paths-ignore:
- "README.md"
- "SECURITY.md"
- "docs/**"
# release.yml also calls this as the gate before publishing a release.
workflow_call:
# Superseded PR runs are cancelled; every merged main commit keeps its own run.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.13"
cache: pip
cache-dependency-path: pyproject.toml
# The dev extra is the single source of truth for tool versions; listing
# them here again is a copy that silently drifts.
- name: Install project and dev tools
run: pip install -e ".[dev]"
- name: Ruff lint
run: ruff check .
- name: Ruff format check
run: ruff format --check .
- name: Mypy
run: mypy
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ${{ fromJSON(github.event_name == 'push' && '["3.12"]' || '["3.10","3.11","3.12","3.13"]') }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- name: Install project and dev tools
run: pip install -e ".[dev]"
- name: Run tests
run: pytest -q
# Build the exact archive `comfy node publish` uploads and inspect it, so a
# .comfyignore mistake fails the PR instead of shipping to every install.
package:
name: Package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Check Registry package contents
run: |
python -m pip install "comfy-cli==1.21.0"
comfy --skip-prompt --no-enable-telemetry node pack
python - <<'PY2'
import zipfile
archive = zipfile.ZipFile("node.zip")
names = archive.namelist()
banned = ("evals/", "tests/", ".github/", ".claude/", "__pycache__/")
leaked = [
n for n in names
if n.startswith(banned) or n.rsplit("/", 1)[-1] == ".env" or n.endswith(".pyc")
]
required = {"__init__.py", "pyproject.toml", "LICENSE", "README.md", "web/immich_status.js", "web/immich_settings.js"}
missing = sorted(required - set(names))
size = sum(i.file_size for i in archive.infolist())
print(f"{len(names)} files, {size} bytes uncompressed")
assert not leaked, f"must not ship: {leaked}"
assert not missing, f"missing from package: {missing}"
assert any(n.startswith("immich_nodes/") for n in names), "immich_nodes/ missing"
assert size < 5_000_000, f"package unexpectedly large: {size} bytes"
PY2