feat: run CTest if run-test is true

This commit is contained in:
Alfi Maulana 2023-11-20 20:58:09 +07:00
parent 421f12e1db
commit e57f0f2848
No known key found for this signature in database
GPG Key ID: 2242A64C2A8DF5A4
2 changed files with 26 additions and 0 deletions

12
main/index.mjs generated
View File

@ -27251,6 +27251,18 @@ async function main() {
.flatMap((args) => args.split(" "));
await _actions_exec__WEBPACK_IMPORTED_MODULE_1__.exec("cmake", ["--build", buildDir || "build", ...buildArgs]);
}
const runTest = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getBooleanInput("run-test");
if (runTest) {
const testArgs = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getMultilineInput("test-args")
.flatMap((args) => args.split(" "));
await _actions_exec__WEBPACK_IMPORTED_MODULE_1__.exec("ctest", [
"--test-dir",
buildDir || "build",
"--output-on-failure",
"--no-tests=error",
...testArgs,
]);
}
}
main();
//# sourceMappingURL=main.mjs.map

View File

@ -14,6 +14,20 @@ async function main() {
.flatMap((args) => args.split(" "));
await exec.exec("cmake", ["--build", buildDir || "build", ...buildArgs]);
}
const runTest = core.getBooleanInput("run-test");
if (runTest) {
const testArgs = core
.getMultilineInput("test-args")
.flatMap((args) => args.split(" "));
await exec.exec("ctest", [
"--test-dir",
buildDir || "build",
"--output-on-failure",
"--no-tests=error",
...testArgs,
]);
}
}
main();