mirror of
https://github.com/threeal/cmake-action.git
synced 2025-07-27 00:04:22 +00:00
feat: modify configureProject
function to be sync
This commit is contained in:
parent
ca58db1467
commit
268421c55b
4
dist/index.js
generated
vendored
4
dist/index.js
generated
vendored
@ -24841,7 +24841,7 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
|
|||||||
*
|
*
|
||||||
* @param inputs - The action inputs.
|
* @param inputs - The action inputs.
|
||||||
*/
|
*/
|
||||||
async function configureProject(inputs) {
|
function configureProject(inputs) {
|
||||||
const configureArgs = [];
|
const configureArgs = [];
|
||||||
if (inputs.sourceDir) {
|
if (inputs.sourceDir) {
|
||||||
configureArgs.push(inputs.sourceDir);
|
configureArgs.push(inputs.sourceDir);
|
||||||
@ -24891,7 +24891,7 @@ __nccwpck_require__.a(module, async (__webpack_handle_async_dependencies__, __we
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const inputs = (0,_inputs_js__WEBPACK_IMPORTED_MODULE_2__/* .getInputs */ .G)();
|
const inputs = (0,_inputs_js__WEBPACK_IMPORTED_MODULE_2__/* .getInputs */ .G)();
|
||||||
await (0,_cmake_js__WEBPACK_IMPORTED_MODULE_1__/* .configureProject */ .N)(inputs);
|
(0,_cmake_js__WEBPACK_IMPORTED_MODULE_1__/* .configureProject */ .N)(inputs);
|
||||||
_actions_core__WEBPACK_IMPORTED_MODULE_0__.setOutput("build-dir", inputs.buildDir);
|
_actions_core__WEBPACK_IMPORTED_MODULE_0__.setOutput("build-dir", inputs.buildDir);
|
||||||
if (inputs.runBuild) {
|
if (inputs.runBuild) {
|
||||||
await (0,_cmake_js__WEBPACK_IMPORTED_MODULE_1__/* .buildProject */ ._)(inputs);
|
await (0,_cmake_js__WEBPACK_IMPORTED_MODULE_1__/* .buildProject */ ._)(inputs);
|
||||||
|
@ -119,8 +119,7 @@ describe("configure a CMake project", () => {
|
|||||||
|
|
||||||
jest.mocked(execFileSync).mockReset();
|
jest.mocked(execFileSync).mockReset();
|
||||||
|
|
||||||
const prom = configureProject({ ...defaultInputs, ...testCase.inputs });
|
configureProject({ ...defaultInputs, ...testCase.inputs });
|
||||||
await expect(prom).resolves.toBeUndefined();
|
|
||||||
|
|
||||||
expect(execFileSync).toHaveBeenCalledTimes(1);
|
expect(execFileSync).toHaveBeenCalledTimes(1);
|
||||||
expect(execFileSync).toHaveBeenLastCalledWith(
|
expect(execFileSync).toHaveBeenLastCalledWith(
|
||||||
|
@ -6,7 +6,7 @@ import type { Inputs } from "./inputs.js";
|
|||||||
*
|
*
|
||||||
* @param inputs - The action inputs.
|
* @param inputs - The action inputs.
|
||||||
*/
|
*/
|
||||||
export async function configureProject(inputs: Inputs): Promise<void> {
|
export function configureProject(inputs: Inputs): void {
|
||||||
const configureArgs = [];
|
const configureArgs = [];
|
||||||
|
|
||||||
if (inputs.sourceDir) {
|
if (inputs.sourceDir) {
|
||||||
|
@ -5,7 +5,7 @@ import { getInputs } from "./inputs.js";
|
|||||||
try {
|
try {
|
||||||
const inputs = getInputs();
|
const inputs = getInputs();
|
||||||
|
|
||||||
await configureProject(inputs);
|
configureProject(inputs);
|
||||||
|
|
||||||
core.setOutput("build-dir", inputs.buildDir);
|
core.setOutput("build-dir", inputs.buildDir);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user