From 2c73dad9aef0986781eee32c78bab7312e8b74d7 Mon Sep 17 00:00:00 2001 From: Joseph Manley Date: Thu, 11 Feb 2021 19:03:58 -0500 Subject: [PATCH] Allow user to change executable path --- ReadMe.md | 5 +++++ action.yml | 3 +++ dist/index.js | 5 +++-- main.js | 5 +++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 5a17f1d..8f6486e 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -30,6 +30,11 @@ steps: Boolean value of whether or not to run container. Defaults to `true` +#### godotExecutable + + Path of Godot binary to call when running GUT tests. Defaults to `godot` + + ## Configure GUT This action requires you to configure GUT using the `.gutconfig.json` file which would be located in the root directory of your project. diff --git a/action.yml b/action.yml index d0e08bc..1214f69 100644 --- a/action.yml +++ b/action.yml @@ -8,6 +8,9 @@ inputs: useContainer: description: "Boolean value of whether or not to run container." default: true + godotExecutable: + description: "Path of Godot binary to call when running GUT tests." + default: godot directory: description: "The name directory to run tests in." runs: diff --git a/dist/index.js b/dist/index.js index 3c84cd0..61c6688 100644 --- a/dist/index.js +++ b/dist/index.js @@ -12254,6 +12254,7 @@ try { var docker_image = core.getInput('containerImage'); var work_dir = core.getInput('directory'); var use_container = core.getInput('useContainer'); + var godot_executable = core.getInput('godotExecutable'); if(work_dir) { @@ -12274,7 +12275,7 @@ try { function onFinished(err, output) { console.log("Starting image...") - docker.run(docker_image, ['godot', '-d', '-s', '--path', '/project', 'addons/gut/gut_cmdln.gd'], process.stdout, + docker.run(docker_image, [godot_executable, '-d', '-s', '--path', '/project', 'addons/gut/gut_cmdln.gd'], process.stdout, // Mount working directory to `/project` { HostConfig: { Binds: [ process.cwd() + ":/project" ] }}, @@ -12303,7 +12304,7 @@ try { { console.log("Running GUT tests locally"); - var result = spawnSync('godot -d -s --path . addons/gut/gut_cmdln.gd', { + var result = spawnSync(`${godot_executable} -d -s --path . addons/gut/gut_cmdln.gd`, { stdio: 'inherit', shell: true }); diff --git a/main.js b/main.js index 5ff3102..8832cf5 100644 --- a/main.js +++ b/main.js @@ -13,6 +13,7 @@ try { var docker_image = core.getInput('containerImage'); var work_dir = core.getInput('directory'); var use_container = core.getInput('useContainer'); + var godot_executable = core.getInput('godotExecutable'); if(work_dir) { @@ -33,7 +34,7 @@ try { function onFinished(err, output) { console.log("Starting image...") - docker.run(docker_image, ['godot', '-d', '-s', '--path', '/project', 'addons/gut/gut_cmdln.gd'], process.stdout, + docker.run(docker_image, [godot_executable, '-d', '-s', '--path', '/project', 'addons/gut/gut_cmdln.gd'], process.stdout, // Mount working directory to `/project` { HostConfig: { Binds: [ process.cwd() + ":/project" ] }}, @@ -62,7 +63,7 @@ try { { console.log("Running GUT tests locally"); - var result = spawnSync('godot -d -s --path . addons/gut/gut_cmdln.gd', { + var result = spawnSync(`${godot_executable} -d -s --path . addons/gut/gut_cmdln.gd`, { stdio: 'inherit', shell: true });