|
1 | | -{% metadata_file .yamato/project.metafile %} |
| 1 | +{% metadata_file .yamato/project.metafile %} # All configuration that is used to create different configurations (used in for loops) is taken from this file. |
2 | 2 | --- |
3 | 3 |
|
4 | | -# Builds a player on WebGl standalone platform without executing any tests. |
5 | | -# This setup performs build-only validation since WebGL runs in browser and for tests to be executed we would need to |
6 | | -# consider having a web server, browser automation and overall complex test setup. |
7 | | -# Default project (testptoject) in this case is used as a context. |
8 | | -# WebGL requires Il2cpp scripting backend so mono is not considered |
9 | | -# ARM64 architectures are not considered since Windows_arm64 is recommended to use only after builds and when it comes to macOS_arm64 there is problem with OpenCL not being available |
10 | | -# Builds are made on each desktop platform as in project.metafile declaration |
| 4 | +# DESCRIPTION-------------------------------------------------------------------------- |
| 5 | + # This job is responsible for validating a successful building of a player on WebGl standalone platform. |
| 6 | + # This job WILL NOT execute any tests, we only validate the building process. |
| 7 | + # This is because WebGL runs in browser and for tests to be executed we would need to consider having a web server, browser automation and overall complex test setup which currently we don't have. |
| 8 | + |
| 9 | +# CONFIGURATION STRUCTURE-------------------------------------------------------------- |
| 10 | + # Jobs configurations are generated using nested loops through: |
| 11 | + # 1. For the default project (project is used only as a context for the build). |
| 12 | + # 2. For all desktop platforms (Windows, Ubuntu, macOS) |
| 13 | + # 3. For all supported Unity Editor versions (For NGOv1.X it means 2021.3+) |
| 14 | + |
| 15 | +# TECHNICAL CONSIDERATIONS---------------------------------------------------------------- |
| 16 | + # WebGL requires IL2CPP scripting backend (Mono is not supported) |
| 17 | + # We are not using ARM64 architectures since we only perform a build action. x64 architectures are preferred for build phase (in order to optimize available resource usage) |
| 18 | + # We only perform build validation (no runtime testing) |
| 19 | + |
| 20 | +# QUALITY CONSIDERATIONS-------------------------------------------------------------------- |
| 21 | + # In the future we could try to implement an infrastructure to run test in webgl context but this could be quite complicated and would need to be evaluated if it's worth it |
| 22 | + # To see where this job is included (in trigger job definitions) look into _triggers.yml file |
| 23 | + |
| 24 | +#-------------------------------------------------------------------------------------- |
| 25 | + |
11 | 26 | {% for project in projects.default -%} |
12 | 27 | {% for platform in test_platforms.desktop -%} |
13 | 28 | {% for editor in validation_editors.all -%} |
14 | 29 | webgl_build_{{ project.name }}_{{ platform.name }}_{{ editor }}: |
15 | 30 | name: WebGl Build - {{ project.name }} [{{ platform.name }}, {{ editor }}, il2cpp] |
16 | 31 | agent: |
17 | | - type: {% if platform.name == "mac" %} {{ platform.type }} {% else %} {{ platform.type }}::GPU {% endif %} |
| 32 | + type: {{ platform.type }} |
18 | 33 | image: {{ platform.image }} |
19 | 34 | flavor: {{ platform.flavor }} |
20 | 35 | commands: |
21 | | - # Installing tools |
22 | | - - pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple |
23 | | - |
24 | | - # Installing editor |
25 | | - - unity-downloader-cli -u {{ editor }} -c Editor -c webgl -c il2cpp -w --fast |
26 | | - |
27 | | - # Build Player |
28 | | - - UnifiedTestRunner --suite=playmode --platform=WebGL --scripting-backend=il2cpp --testproject={{ project.path }} --editor-location=.Editor --artifacts_path=artifacts --player-save-path=build/players --extra-editor-arg=-batchmode --extra-editor-arg="-cloudEnvironment staging" --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun --build-only --timeout=1800 |
29 | | - |
| 36 | + - unity-downloader-cli -u {{ editor }} -c Editor -c webgl -c il2cpp # Downloading the editor with additional webgl and il2cpp components |
| 37 | + |
| 38 | + # The following step builds the player with defined options such as: |
| 39 | + # Suite parameter if defined since it's a mandatory field to define which test suite should be used, but it doesn't matter in this case since we won't run any tests (--suite) |
| 40 | + # Editor is run in batchmode, which means that Unity runs command line arguments without the need for human interaction. It also suppresses pop-up windows that require human interaction (such as the Save Scene window). We should always run Unity in batch mode when using command line arguments, because it allows automation to run without interruption. (--extra-editor-arg=-batchmode) |
| 41 | + # Engine is initialized in ‘nographics’ mode since we don't need any graphics for this case (--extra-editor-arg=-nographics) |
| 42 | + # In case of failure the job will be rerunned once (--reruncount=1) with clean library (--clean-library-on-rerun) |
| 43 | + # This will perform only building phase (--build-only) with a timeout of 3m (--timeout=1800) |
| 44 | + - UnifiedTestRunner --suite=playmode --platform=WebGL --scripting-backend=il2cpp --testproject={{ project.path }} --editor-location=.Editor --artifacts_path=artifacts --player-save-path=build/players --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun --build-only --timeout=1800 |
30 | 45 | artifacts: |
31 | 46 | logs: |
32 | 47 | paths: |
33 | 48 | - "artifacts/**/*" |
34 | 49 | - "build/players/**/*" |
35 | | - variables: |
36 | | - CI: true |
37 | | - ENABLE_BURST_COMPILATION: False |
38 | 50 | {% endfor -%} |
39 | 51 | {% endfor -%} |
40 | 52 | {% endfor -%} |
0 commit comments