|
| 1 | +{% metadata_file .yamato/project.metafile %} |
| 2 | +--- |
| 3 | + |
| 4 | +# Builds a player on mobile standalone platform and executes PlayMode tests of the NGO package in the Standalone build |
| 5 | +# Only Package tests are being executed in the context of the default project |
| 6 | +# For mobile devices it's necessary to split build and run phases |
| 7 | +{% for project in projects.default -%} |
| 8 | +{% for editor in validation_editors.all -%} |
| 9 | +{% for platform in test_platforms.mobile_build -%} |
| 10 | +build_{{ project.name }}_{{ editor }}_{{ platform.name }}: |
| 11 | + name: Build {{ project.name }} - [{{ editor }}, {{ platform.name }}] |
| 12 | + agent: |
| 13 | + type: {{ platform.type }} |
| 14 | + image: {{ platform.image }} |
| 15 | + flavor: {{ platform.flavor }} |
| 16 | + commands: |
| 17 | + # Installing tools |
| 18 | + - pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple |
| 19 | + - unity-downloader-cli -u {{ editor }} -c editor -c {{ platform.name }} -w --fast |
| 20 | + |
| 21 | + # Platform specific Build |
| 22 | +{% if platform.name == "Android" %} |
| 23 | + - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat |
| 24 | + - python .yamato/disable-burst-if-requested.py --project-path {{ project.path }} --platform {{ platform.name }} |
| 25 | + - utr.bat --suite=playmode --platform={{ platform.standalone }} --editor-location=.Editor --testproject={{ project.path }} --player-save-path=build/players --artifacts_path=build/logs --scripting-backend=mono --build-only --timeout=1800 --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --testfilter=Unity.Netcode.RuntimeTests |
| 26 | +{% else %} |
| 27 | + - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr |
| 28 | + - chmod +x ./utr |
| 29 | + - ./utr --artifacts_path=artifacts --timeout=1800 --testproject={{ project.path }} --editor-location=.Editor --suite=playmode --platform={{ platform.standalone }} --build-only --player-save-path=build/players --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --testfilter=Unity.Netcode.RuntimeTests |
| 30 | +{% endif %} |
| 31 | + |
| 32 | + artifacts: |
| 33 | + logs: |
| 34 | + paths: |
| 35 | + - '*.log' |
| 36 | + - '*.xml' |
| 37 | + - artifacts/**/* |
| 38 | + - testproject/Logs/** |
| 39 | + - testproject/Library/*.log |
| 40 | + - testproject/*.log |
| 41 | + - testproject/Builds/*.log |
| 42 | + - build/test-results/** |
| 43 | + - artifacts/** |
| 44 | + - build/players/** |
| 45 | + variables: |
| 46 | + CI: true |
| 47 | + ENABLE_BURST_COMPILATION: False |
| 48 | +{% endif -%} |
| 49 | +{% endfor -%} |
| 50 | +{% endfor -%} |
| 51 | +{% endfor -%} |
| 52 | + |
| 53 | + |
| 54 | +{% for project in projects.default -%} |
| 55 | +{% for editor in validation_editors.all -%} |
| 56 | +{% for platform in test_platforms.mobile_test -%} |
| 57 | +{% if platform.name == "android" -%} |
| 58 | +run_{{ project.name }}_tests_{{ editor }}_android: |
| 59 | + name: Run {{ project.name }} Tests - [{{ editor }}, Android] |
| 60 | + agent: |
| 61 | + type: {{ platform.type }} |
| 62 | + image: {{ platform.image }} |
| 63 | + flavor: {{ platform.flavor }} |
| 64 | + # Skip repository cloning |
| 65 | + skip_checkout: true |
| 66 | + commands: |
| 67 | + - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat |
| 68 | + - | |
| 69 | + set ANDROID_DEVICE_CONNECTION=%BOKKEN_DEVICE_IP% |
| 70 | + start %ANDROID_SDK_ROOT%\platform-tools\adb.exe connect %BOKKEN_DEVICE_IP% |
| 71 | + start %ANDROID_SDK_ROOT%\platform-tools\adb.exe devices |
| 72 | + set UTR_VERSION=1.35.1 |
| 73 | + ./utr --suite=playmode --platform=Android --editor-location=.Editor --testproject={{ project.name }} --player-load-path=build/players --artifacts_path=build/logs --scripting-backend=mono --reruncount=1 --player-connection-ip=%BOKKEN_HOST_IP% --testfilter=Unity.Netcode.RuntimeTests |
| 74 | + artifacts: |
| 75 | + logs: |
| 76 | + paths: |
| 77 | + - '*.log' |
| 78 | + - '*.xml' |
| 79 | + - artifacts/**/* |
| 80 | + - testproject/Logs/** |
| 81 | + - testproject/Library/*.log |
| 82 | + - testproject/*.log |
| 83 | + - testproject/Builds/*.log |
| 84 | + - build/test-results/** |
| 85 | + - build/players/** |
| 86 | + dependencies: |
| 87 | + - .yamato/mobile-build-and-test.yml#build_{{ project.name }}_{{ editor }}_android |
| 88 | +{% endif -%} |
| 89 | +{% endfor -%} |
| 90 | +{% endfor -%} |
| 91 | +{% endfor -%} |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | +{% for project in projects.default -%} |
| 100 | +{% for editor in validation_editors.all -%} |
| 101 | +{% for platform in test_platforms.mobile_build -%} |
| 102 | +{% if platform.name == "ios" -%} |
| 103 | +run_{{ project.name }}_tests_{{ editor }}_iOS: |
| 104 | + name: Run {{ project.name }} Tests - [{{ editor }}, iOS] |
| 105 | + agent: |
| 106 | + type: {{ platform.type }} |
| 107 | + image: {{ platform.image }} |
| 108 | + flavor: {{ platform.flavor }} |
| 109 | + commands: |
| 110 | + # Download standalone UnityTestRunner |
| 111 | + - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr |
| 112 | + # Give UTR execution permissions |
| 113 | + - chmod +x ./utr |
| 114 | + # Run the test build on the device |
| 115 | + - export UTR_VERSION=1.35.1 |
| 116 | + - ./utr -artifacts_path=artifacts --testproject={{ project.name }} --editor-location=.Editor --reruncount=1 --suite=playmode --platform=iOS --player-load-path=build/players --testfilter=Unity.Netcode.RuntimeTests |
| 117 | + artifacts: |
| 118 | + logs: |
| 119 | + paths: |
| 120 | + - '*.log' |
| 121 | + - '*.xml' |
| 122 | + - artifacts/**/* |
| 123 | + - testproject/Logs/** |
| 124 | + - testproject/Library/*.log |
| 125 | + - testproject/*.log |
| 126 | + - testproject/Builds/*.log |
| 127 | + - build/test-results/** |
| 128 | + - artifacts/** |
| 129 | + - build/players/** |
| 130 | + # Set a dependency on the build job |
| 131 | + dependencies: |
| 132 | + - .yamato/mobile-build-and-test.yml#build_{{ project.name }}_{{ editor }}_iOS |
| 133 | +{% endif -%} |
| 134 | +{% endfor -%} |
| 135 | +{% endfor -%} |
| 136 | +{% endfor -%} |
0 commit comments