-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (119 loc) · 4.2 KB
/
ci.yml
File metadata and controls
147 lines (119 loc) · 4.2 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: CI
on:
push:
branches: [main, "feat/**"]
pull_request:
branches: [main]
jobs:
# ── Python daemon + CLI ──────────────────────────────────────────────────────
python:
name: Python (daemon + CLI)
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
component: [daemon, cli]
defaults:
run:
working-directory: kapsule-incus-manager/${{ matrix.component }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install system dependencies (daemon only)
if: matrix.component == 'daemon'
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
libcairo2-dev \
libgirepository-2.0-dev \
libgirepository1.0-dev \
gir1.2-glib-2.0 \
libdbus-1-dev \
libglib2.0-dev \
pkg-config \
python3-dev
- name: Install
run: pip install -e ".[dev]"
- name: Lint (ruff)
run: ruff check kim
- name: Type-check (mypy)
run: mypy kim
- name: Test (pytest)
run: pytest --tb=short -q --asyncio-mode=auto
# ── Profile YAML validation ───────────────────────────────────────────────────
profiles:
name: Validate profile presets
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install pyyaml
run: pip install pyyaml
- name: Validate all profile YAML files
run: |
python3 - <<'EOF'
import pathlib, sys, yaml
root = pathlib.Path("kapsule-incus-manager/profiles")
errors = []
for f in sorted(root.rglob("*.yaml")):
try:
data = yaml.safe_load(f.read_text())
if not isinstance(data, dict):
errors.append(f"{f}: root must be a mapping")
except yaml.YAMLError as e:
errors.append(f"{f}: {e}")
if errors:
for e in errors:
print("ERROR:", e, file=sys.stderr)
sys.exit(1)
print(f"OK: {sum(1 for _ in root.rglob('*.yaml'))} profile files validated")
EOF
# ── Web UI ───────────────────────────────────────────────────────────────────
web:
name: Web UI (TypeScript)
runs-on: ubuntu-24.04
defaults:
run:
working-directory: kapsule-incus-manager/ui-web
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install
run: npm install
- name: Type-check
run: npm run typecheck
- name: Lint
run: npm run lint
- name: Test
run: npm test
- name: Build
run: npm run build
# ── QML / C++ ────────────────────────────────────────────────────────────────
qml:
name: QML / C++ (CMake configure)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install Qt6 + build tools
run: |
sudo apt-get update -q
sudo apt-get install -y -q \
cmake ninja-build \
qt6-base-dev qt6-declarative-dev \
qt6-websockets-dev libdbus-1-dev
- name: CMake configure
run: |
cmake -B kapsule-incus-manager/ui-qml/build \
-S kapsule-incus-manager/ui-qml \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTS=OFF
- name: CMake build
run: cmake --build kapsule-incus-manager/ui-qml/build --parallel