|
|
|
@@ -1,7 +1,7 @@
|
|
|
|
|
import { execFileSync } from "node:child_process";
|
|
|
|
|
import { appendFileSync } from "node:fs";
|
|
|
|
|
|
|
|
|
|
/** @typedef {{ runNode: boolean; runMacos: boolean; runAndroid: boolean; runWindows: boolean; runSkillsPython: boolean; runChangedSmoke: boolean }} ChangedScope */
|
|
|
|
|
/** @typedef {{ runNode: boolean; runMacos: boolean; runAndroid: boolean; runWindows: boolean; runSkillsPython: boolean; runChangedSmoke: boolean; runControlUiI18n: boolean }} ChangedScope */
|
|
|
|
|
|
|
|
|
|
const DOCS_PATH_RE = /^(docs\/|.*\.mdx?$)/;
|
|
|
|
|
const SKILLS_PYTHON_SCOPE_RE = /^(skills\/|pyproject\.toml$)/;
|
|
|
|
@@ -15,6 +15,8 @@ const NODE_SCOPE_RE =
|
|
|
|
|
/^(src\/|test\/|extensions\/|packages\/|scripts\/|ui\/|\.github\/|openclaw\.mjs$|package\.json$|pnpm-lock\.yaml$|pnpm-workspace\.yaml$|tsconfig.*\.json$|vitest.*\.ts$|tsdown\.config\.ts$|\.oxlintrc\.json$|\.oxfmtrc\.jsonc$)/;
|
|
|
|
|
const WINDOWS_SCOPE_RE =
|
|
|
|
|
/^(src\/|test\/|extensions\/|packages\/|scripts\/|ui\/|openclaw\.mjs$|package\.json$|pnpm-lock\.yaml$|pnpm-workspace\.yaml$|tsconfig.*\.json$|vitest.*\.ts$|tsdown\.config\.ts$|\.github\/workflows\/ci\.yml$|\.github\/actions\/setup-node-env\/action\.yml$|\.github\/actions\/setup-pnpm-store-cache\/action\.yml$)/;
|
|
|
|
|
const CONTROL_UI_I18N_SCOPE_RE =
|
|
|
|
|
/^(ui\/src\/i18n\/|scripts\/control-ui-i18n\.ts$|\.github\/workflows\/control-ui-locale-refresh\.yml$)/;
|
|
|
|
|
const NATIVE_ONLY_RE =
|
|
|
|
|
/^(apps\/android\/|apps\/ios\/|apps\/macos\/|apps\/shared\/|Swabble\/|appcast\.xml$)/;
|
|
|
|
|
const CHANGED_SMOKE_SCOPE_RE =
|
|
|
|
@@ -33,6 +35,7 @@ export function detectChangedScope(changedPaths) {
|
|
|
|
|
runWindows: true,
|
|
|
|
|
runSkillsPython: true,
|
|
|
|
|
runChangedSmoke: true,
|
|
|
|
|
runControlUiI18n: true,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -42,6 +45,7 @@ export function detectChangedScope(changedPaths) {
|
|
|
|
|
let runWindows = false;
|
|
|
|
|
let runSkillsPython = false;
|
|
|
|
|
let runChangedSmoke = false;
|
|
|
|
|
let runControlUiI18n = false;
|
|
|
|
|
let hasNonDocs = false;
|
|
|
|
|
let hasNonNativeNonDocs = false;
|
|
|
|
|
|
|
|
|
@@ -91,6 +95,10 @@ export function detectChangedScope(changedPaths) {
|
|
|
|
|
runChangedSmoke = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CONTROL_UI_I18N_SCOPE_RE.test(path)) {
|
|
|
|
|
runControlUiI18n = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!NATIVE_ONLY_RE.test(path)) {
|
|
|
|
|
hasNonNativeNonDocs = true;
|
|
|
|
|
}
|
|
|
|
@@ -100,7 +108,15 @@ export function detectChangedScope(changedPaths) {
|
|
|
|
|
runNode = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return { runNode, runMacos, runAndroid, runWindows, runSkillsPython, runChangedSmoke };
|
|
|
|
|
return {
|
|
|
|
|
runNode,
|
|
|
|
|
runMacos,
|
|
|
|
|
runAndroid,
|
|
|
|
|
runWindows,
|
|
|
|
|
runSkillsPython,
|
|
|
|
|
runChangedSmoke,
|
|
|
|
|
runControlUiI18n,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@@ -136,6 +152,7 @@ export function writeGitHubOutput(scope, outputPath = process.env.GITHUB_OUTPUT)
|
|
|
|
|
appendFileSync(outputPath, `run_windows=${scope.runWindows}\n`, "utf8");
|
|
|
|
|
appendFileSync(outputPath, `run_skills_python=${scope.runSkillsPython}\n`, "utf8");
|
|
|
|
|
appendFileSync(outputPath, `run_changed_smoke=${scope.runChangedSmoke}\n`, "utf8");
|
|
|
|
|
appendFileSync(outputPath, `run_control_ui_i18n=${scope.runControlUiI18n}\n`, "utf8");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function isDirectRun() {
|
|
|
|
@@ -172,6 +189,7 @@ if (isDirectRun()) {
|
|
|
|
|
runWindows: true,
|
|
|
|
|
runSkillsPython: true,
|
|
|
|
|
runChangedSmoke: true,
|
|
|
|
|
runControlUiI18n: true,
|
|
|
|
|
});
|
|
|
|
|
process.exit(0);
|
|
|
|
|
}
|
|
|
|
@@ -184,6 +202,7 @@ if (isDirectRun()) {
|
|
|
|
|
runWindows: true,
|
|
|
|
|
runSkillsPython: true,
|
|
|
|
|
runChangedSmoke: true,
|
|
|
|
|
runControlUiI18n: true,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|