Skip to content

ci: add mirror-osp-to-ooc.yaml [auto] #480

ci: add mirror-osp-to-ooc.yaml [auto]

ci: add mirror-osp-to-ooc.yaml [auto] #480

Workflow file for this run

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