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:
Alfi Maulana
2024-03-22 16:06:56 +07:00
committed by GitHub
parent b1c63dc900
commit ebf367c0a0
7 changed files with 6 additions and 79 deletions

View File

@@ -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));

View File

@@ -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",
],
});
});
});

View File

@@ -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"),
};
}