Allow user to change executable path

This commit is contained in:
Layla 2021-02-11 19:03:58 -05:00
parent 5af87a011e
commit 2c73dad9ae
4 changed files with 14 additions and 4 deletions

View File

@ -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.

View File

@ -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:

5
dist/index.js vendored
View File

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

View File

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