#!/usr/bin/env python3 import subprocess import sys from pathlib import Path script_dir = Path(__file__).resolve().parent root_dir = script_dir.parent.parent steps = [ ("cargo check --workspace", [ "cargo", "check", "--workspace", ]), ("cargo clippy --workspace -- -D warnings", [ "cargo", "clippy", "--workspace", "--", "-D", "warnings", ]), ("cargo build --workspace --release", [ "cargo", "build", "--workspace", "--release", ]), ("dotnet restore", [ "dotnet", "restore", "rola-desktop.sln", ]), ("dotnet build", [ "dotnet", "build", "rola-desktop.sln", "--nologo", ]), ] ok = True for label, cmd in steps: print(f"\nSTEP - \"{label}\": ", flush=True) result = subprocess.run(cmd, cwd=root_dir) if result.returncode != 0: print(f" [FAILED] Failed (exit code {result.returncode})", flush=True) ok = False break print(f" [SUCCESS] Passed", flush=True) sys.exit(0 if ok else 1)