浏览代码

WebGL compile test (#4966)

/develop/gail-srl-hack
GitHub 4 年前
当前提交
08b3e7f1
共有 3 个文件被更改,包括 40 次插入5 次删除
  1. 4
      ml-agents/tests/yamato/standalone_build_tests.py
  2. 11
      ml-agents/tests/yamato/yamato_utils.py
  3. 30
      .yamato/standalone-build-webgl-test.yml

4
ml-agents/tests/yamato/standalone_build_tests.py


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
ml-agents/tests/yamato/yamato_utils.py


import subprocess
import yaml
from sys import platform
from typing import List, Optional
from typing import List, Optional, Mapping
def get_unity_executable_path():

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] = {
# 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,

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

30
.yamato/standalone-build-webgl-test.yml


{% 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"
正在加载...
取消
保存