Skip to content

WebGL compile test #4966

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .yamato/standalone-build-webgl-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{% capture editor_version %}2020.2{% endcapture %}
test_webgl_standalone_{{ editor_version }}:
name: Test WebGL Standalone {{ editor_version }}
agent:
type: Unity::VM
image: package-ci/ubuntu:stable
flavor: b1.large
variables:
UNITY_VERSION: {{ editor_version }}
commands:
- |
python3 -m venv venv && source venv/bin/activate
python -m pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
python -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
unity-downloader-cli -u {{ editor_version }} -c editor -c WebGL --wait --fast
python -u -m ml-agents.tests.yamato.standalone_build_tests --build-target=webgl

triggers:
cancel_old_ci: true
recurring:
- branch: master
frequency: weekly
artifacts:
logs:
paths:
- "artifacts/standalone_build.txt"
standalonebuild:
paths:
- "artifacts/testPlayer*/**"
- "artifacts/**/UnityPlayer.so"
4 changes: 3 additions & 1 deletion ml-agents/tests/yamato/standalone_build_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def main(scene_path, build_target):
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--scene", default=None)
parser.add_argument("--build-target", default="mac", choices=["mac", "linux"])
parser.add_argument(
"--build-target", default="mac", choices=["mac", "linux", "ios", "webgl"]
)
args = parser.parse_args()
main(args.scene, args.build_target)
11 changes: 7 additions & 4 deletions ml-agents/tests/yamato/yamato_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import subprocess
import yaml
from sys import platform
from typing import List, Optional
from typing import List, Optional, Mapping


def get_unity_executable_path():
Expand Down Expand Up @@ -46,11 +46,14 @@ def run_standalone_build(
print(f"Running BuildStandalonePlayer via {unity_exe}")

# enum values from https://docs.unity3d.com/2019.4/Documentation/ScriptReference/BuildTarget.html
build_target_to_enum = {
build_target_to_enum: Mapping[Optional[str], str] = {
"mac": "StandaloneOSX",
"osx": "StandaloneOSX",
"linux": "StandaloneLinux64",
}
# Convert the short name to the official enum
# Just pass through if it's not on the list.
build_target_enum = build_target_to_enum.get(build_target, build_target)

test_args = [
unity_exe,
Expand All @@ -75,8 +78,8 @@ def run_standalone_build(
os.makedirs(os.path.dirname(output_path), exist_ok=True)
if scene_path is not None:
test_args += ["--mlagents-build-scene-path", scene_path]
if build_target is not None:
test_args += ["--mlagents-build-target", build_target_to_enum[build_target]]
if build_target_enum is not None:
test_args += ["--mlagents-build-target", build_target_enum]
print(f"{' '.join(test_args)} ...")

timeout = 30 * 60 # 30 minutes, just in case
Expand Down