-
Notifications
You must be signed in to change notification settings - Fork 10
83 lines (71 loc) · 2.3 KB
/
Copy pathci.yml
File metadata and controls
83 lines (71 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: CI
on:
pull_request:
branches: [main, master]
push:
branches: [main, master]
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
# Opt into Node.js 24 for actions to silence the Node 20 deprecation warning.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
jobs:
lint-and-test:
name: Lint & Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install build tooling
run: |
python -m pip install --upgrade pip
pip install ruff pytest tomli pip-audit
- name: Install package (best-effort)
run: |
pip install -e . || pip install -r requirements.txt || true
- name: Validate pyproject.toml
run: |
python - <<'PY'
try:
import tomllib
except ModuleNotFoundError:
import tomli as tomllib
import sys
d = tomllib.load(open("pyproject.toml", "rb"))
assert "project" in d, "missing [project]"
p = d["project"]
assert p.get("name"), "missing name"
assert p.get("version"), "missing version"
assert p.get("description"), "missing description"
tc = d.get("tool", {}).get("comfy", {})
assert tc.get("PublisherId"), "missing [tool.comfy].PublisherId"
assert tc.get("DisplayName"), "missing [tool.comfy].DisplayName"
print(f"OK: {p['name']} v{p['version']} (publisher={tc['PublisherId']})")
PY
- name: Ruff lint
continue-on-error: true
run: ruff check .
- name: Ruff format check
continue-on-error: true
run: ruff format --check .
- name: Pytest
run: |
if [ -d tests ]; then pytest -q || true; else echo "No tests/ dir; skipping."; fi
- name: pip-audit (security)
continue-on-error: true
run: pip-audit --desc --strict || true