Skip to content

Commit

Permalink
Allow action to work without specifying a test directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Pikachu920 authored Jun 8, 2024
1 parent 2a3dc69 commit a82b257
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ class EnvironmentResource(TypedDict):


github_workspace_directory = Path("/github/workspace")
test_script_directory = github_workspace_directory / os.environ['INPUT_TEST_SCRIPT_DIRECTORY']
test_script_directory = None
test_script_directory_input = os.environ.get("INPUT_TEST_SCRIPT_DIRECTORY", None)
if test_script_directory_input is not None:
test_script_directory = github_workspace_directory / test_script_directory_input
skript_repo_ref = os.environ.get("INPUT_SKRIPT_REPO_REF", None)
run_vanilla_tests = os.environ.get("INPUT_RUN_VANILLA_TESTS", None) == "true"
skript_repo_git_url = "https://github.com/SkriptLang/Skript.git"
Expand Down Expand Up @@ -61,6 +64,7 @@ class EnvironmentResource(TypedDict):
with open(environment_file_path, "w") as environment_file:
json.dump(environment, environment_file)
shutil.rmtree(custom_test_directory, ignore_errors=True)
shutil.copytree(test_script_directory, custom_test_directory)
if test_script_directory is not None:
shutil.copytree(test_script_directory, custom_test_directory)
gradle_test_process = subprocess.run(("./gradlew", "quickTest"))
exit(gradle_test_process.returncode)

0 comments on commit a82b257

Please sign in to comment.