mirror of
https://github.com/threeal/cmake-action.git
synced 2026-02-02 03:50:55 +00:00
feat: remove support for testing CMake projects (#256)
* feat: remove `run-test` and `test-args` action inputs * docs: remove description for supporting testing
This commit is contained in:
12
src/index.ts
12
src/index.ts
@@ -48,19 +48,9 @@ async function main() {
|
||||
await exec("cmake", configureArgs);
|
||||
core.setOutput("build-dir", inputs.buildDir);
|
||||
|
||||
if (inputs.runBuild || inputs.runTest) {
|
||||
if (inputs.runBuild) {
|
||||
await exec("cmake", ["--build", inputs.buildDir, ...inputs.buildArgs]);
|
||||
}
|
||||
|
||||
if (inputs.runTest) {
|
||||
await exec("ctest", [
|
||||
"--test-dir",
|
||||
inputs.buildDir,
|
||||
"--output-on-failure",
|
||||
"--no-tests=error",
|
||||
...inputs.testArgs,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
main().catch((err) => core.setFailed(err));
|
||||
|
||||
@@ -35,8 +35,6 @@ describe("get action inputs", () => {
|
||||
args: [],
|
||||
runBuild: false,
|
||||
buildArgs: [],
|
||||
runTest: false,
|
||||
testArgs: [],
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -51,8 +49,6 @@ describe("get action inputs", () => {
|
||||
switch (name) {
|
||||
case "run-build":
|
||||
return true;
|
||||
case "run-test":
|
||||
return true;
|
||||
}
|
||||
throw new Error(`invalid input name: ${name}`);
|
||||
});
|
||||
@@ -88,8 +84,6 @@ describe("get action inputs", () => {
|
||||
"some-build-args another-build-args",
|
||||
"some-other-build-args",
|
||||
];
|
||||
case "test-args":
|
||||
return ["some-test-args another-test-args", "some-other-test-args"];
|
||||
}
|
||||
throw new Error(`invalid input name: ${name}`);
|
||||
});
|
||||
@@ -116,12 +110,6 @@ describe("get action inputs", () => {
|
||||
"another-build-args",
|
||||
"some-other-build-args",
|
||||
],
|
||||
runTest: true,
|
||||
testArgs: [
|
||||
"some-test-args",
|
||||
"another-test-args",
|
||||
"some-other-test-args",
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -12,8 +12,6 @@ export interface Inputs {
|
||||
args: string[];
|
||||
runBuild: boolean;
|
||||
buildArgs: string[];
|
||||
runTest: boolean;
|
||||
testArgs: string[];
|
||||
}
|
||||
|
||||
export function getInputs(): Inputs {
|
||||
@@ -31,7 +29,5 @@ export function getInputs(): Inputs {
|
||||
buildArgs: getMultilineInput("build-args").flatMap((args) =>
|
||||
args.split(" "),
|
||||
),
|
||||
testArgs: getMultilineInput("test-args").flatMap((args) => args.split(" ")),
|
||||
runTest: getBooleanInput("run-test"),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user