From d10e54d842620e467117f1b4c69d23a8fedcf8a0 Mon Sep 17 00:00:00 2001 From: Masterluke77 <163446896+Masterluke77@users.noreply.github.com> Date: Tue, 14 Jul 2026 14:45:19 +0200 Subject: [PATCH] ci(ux): add cross-platform UX gate runner with diagnostics --- tools/run-ux-platform-gates.mjs | 47 +++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 tools/run-ux-platform-gates.mjs diff --git a/tools/run-ux-platform-gates.mjs b/tools/run-ux-platform-gates.mjs new file mode 100644 index 0000000..8c267fd --- /dev/null +++ b/tools/run-ux-platform-gates.mjs @@ -0,0 +1,47 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import { spawnSync } from 'node:child_process'; + +const root = process.cwd(); +const outputDir = path.join(root, 'artifacts'); +const outputFile = path.join(outputDir, 'ux-platform-gates.log'); +const node = process.execPath; +const gates = [ + ['Navigation API', 'tools/verify-navigation-api-1.44.0.mjs'], + ['Safe Action Adapters', 'tools/verify-safe-action-adapters-1.44.0.mjs'], +]; + +fs.mkdirSync(outputDir, { recursive: true }); +const lines = [ + 'Vendoo UX Platform Gates', + `Platform: ${process.platform}`, + `Node: ${process.version}`, + `Working directory: ${root}`, + '', +]; +let failed = false; + +for (const [name, relativeScript] of gates) { + const script = path.join(root, relativeScript); + lines.push(`=== ${name} ===`); + const result = spawnSync(node, [script], { + cwd: root, + encoding: 'utf8', + env: process.env, + windowsHide: true, + }); + if (result.stdout) lines.push(result.stdout.trimEnd()); + if (result.stderr) lines.push(result.stderr.trimEnd()); + const exitCode = Number.isInteger(result.status) ? result.status : 1; + lines.push(`Exit code: ${exitCode}`, ''); + if (exitCode !== 0 || result.error) { + failed = true; + if (result.error) lines.push(`Runner error: ${result.error.message}`, ''); + } +} + +lines.push(failed ? 'RESULT: FAILED' : 'RESULT: PASSED'); +const report = `${lines.join('\n')}\n`; +fs.writeFileSync(outputFile, report, 'utf8'); +process.stdout.write(report); +process.exitCode = failed ? 1 : 0;