-
Notifications
You must be signed in to change notification settings - Fork 461
Expand file tree
/
Copy pathwebgl-build.yml
More file actions
57 lines (50 loc) · 4.23 KB
/
webgl-build.yml
File metadata and controls
57 lines (50 loc) · 4.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{% metadata_file .yamato/project.metafile %} # All configuration that is used to create different configurations (used in for loops) is taken from this file.
---
# DESCRIPTION--------------------------------------------------------------------------
# This job is responsible for validating a successful building of a player on WebGl standalone platform.
# This job WILL NOT execute any tests, we only validate the building process.
# 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.
# CONFIGURATION STRUCTURE--------------------------------------------------------------
# Jobs configurations are generated using nested loops through:
# 1. For the default project (project is used only as a context for the build).
# 2. For all desktop platforms (Windows, Ubuntu, macOS)
# 3. For all supported Unity Editor versions (For NGOv1.X it means 2021.3+)
# TECHNICAL CONSIDERATIONS----------------------------------------------------------------
# WebGL requires IL2CPP scripting backend (Mono is not supported)
# 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)
# We only perform build validation (no runtime testing)
# QUALITY CONSIDERATIONS--------------------------------------------------------------------
# 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
# To see where this job is included (in trigger job definitions) look into _triggers.yml file
#--------------------------------------------------------------------------------------
{% for project in projects.default -%}
{% for platform in test_platforms.desktop -%}
{% if platform.name != "mac" -%} # There is an error about "Light baking could not be started because no valid OpenCL device could be found". Tracked in MTT-11726
{% for editor in validation_editors.all -%}
webgl_build_{{ project.name }}_{{ platform.name }}_{{ editor }}:
name: WebGl Build - {{ project.name }} [{{ platform.name }}, {{ editor }}, il2cpp]
agent:
type: {{ platform.type }}
image: {{ platform.image }}
flavor: {{ platform.flavor }}
{% if platform.model %}
model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile)
{% endif %}
commands:
- unity-downloader-cli --fast --wait -u {{ editor }} -c Editor -c webgl -c il2cpp {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models. Downloading the editor with additional webgl and il2cpp components
# The following step builds the player with defined options such as:
# 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)
# 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)
# Engine is initialized in ‘nographics’ mode since we don't need any graphics for this case (--extra-editor-arg=-nographics)
# In case of failure the job will be rerunned once (--reruncount=1) with clean library (--clean-library-on-rerun)
# This will perform only building phase (--build-only) with a timeout of 3m (--timeout=1800)
- 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
artifacts:
logs:
paths:
- "artifacts/**/*"
- "build/players/**/*"
{% endfor -%}
{% endif -%}
{% endfor -%}
{% endfor -%}