-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b78bba
commit 938977d
Showing
5 changed files
with
56 additions
and
28 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
FROM alpine:3.19.1 | ||
FROM python:3.12-alpine3.18 | ||
LABEL authors="SkriptLang" | ||
|
||
RUN apk add --no-cache git openjdk17 | ||
COPY run-tests.sh /run-tests.sh | ||
RUN chmod +x /run-tests.sh | ||
COPY run-tests.py /run-tests.py | ||
|
||
ENTRYPOINT ["/run-tests.sh"] | ||
CMD ["python", "/run-tests.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import os | ||
import shutil | ||
import subprocess | ||
from pathlib import Path | ||
|
||
test_script_directory = Path(f"/github/workspace/{os.environ['INPUT_TEST_SCRIPT_DIRECTORY']}") | ||
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" | ||
skript_repo_path = Path("/skript") | ||
skript_test_directory = skript_repo_path / "src/test/skript/tests" | ||
custom_test_directory = skript_test_directory / "custom" | ||
extra_plugins_directory = None | ||
if "INPUT_EXTRA_PLUGINS_DIRECTORY" in os.environ: | ||
extra_plugins_directory = Path(os.environ["INPUT_EXTRA_PLUGINS_DIRECTORY"]) | ||
|
||
|
||
def delete_contents_of_directory(directory: Path) -> None: | ||
for path in directory.iterdir(): | ||
if path.is_file(): | ||
path.unlink() | ||
elif path.is_dir(): | ||
shutil.rmtree(path) | ||
|
||
|
||
print("Configuration:") | ||
print(f" Test script directory: {test_script_directory}") | ||
print(f" Skript repo ref: {skript_repo_ref}") | ||
print(f" Run vanilla tests: {run_vanilla_tests}") | ||
print(f" Extra plugins directory: {extra_plugins_directory}") | ||
|
||
subprocess.run(("git", "clone", "--recurse-submodules", skript_repo_git_url, str(skript_repo_path))) | ||
os.chdir(skript_repo_path) | ||
if skript_repo_ref is not None: | ||
subprocess.run(("git", "checkout", "-f", skript_repo_ref)) | ||
if not run_vanilla_tests: | ||
print("Deleting vanilla tests") | ||
delete_contents_of_directory(skript_test_directory) | ||
custom_test_directory.mkdir(parents=True, exist_ok=True) | ||
shutil.copytree(test_script_directory, custom_test_directory) | ||
gradle_test_process = subprocess.run(("./gradlew", "quickTest")) | ||
exit(gradle_test_process.returncode) |
This file was deleted.
Oops, something went wrong.