From ddad5c3f1c54ade17c87eefeb0bdf6b9ed6992b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Penavaire?= Date: Mon, 26 Jul 2021 10:36:38 +0200 Subject: [PATCH 1/3] Backport #5198 --- .yamato/_templates.yml | 60 +++++++++++++++++----- .yamato/script/gfx_sdet_tools_revision.txt | 2 +- 2 files changed, 49 insertions(+), 13 deletions(-) diff --git a/.yamato/_templates.yml b/.yamato/_templates.yml index 50921e38850..c235c0bb01d 100644 --- a/.yamato/_templates.yml +++ b/.yamato/_templates.yml @@ -15,7 +15,7 @@ pre_pack_hdrp_template_Win_2019.4: commands: - choco install unity-downloader-cli -y -s https://artifactory.prd.it.unity3d.com/artifactory/api/nuget/unity-choco-local - unity-downloader-cli --source-file unity_revision.txt -c editor --wait --published-only - - .Editor\Unity.exe -projectPath com.unity.template-hd -batchmode -quit + - .Editor\Unity.exe -projectPath com.unity.template-hd -batchmode -quit -logFile ./Editor.log dependencies: - .yamato/_editor_priming.yml#editor:priming:2019.4:Win artifacts: @@ -24,6 +24,9 @@ pre_pack_hdrp_template_Win_2019.4: - "com.unity.template-hd/Library/Artifacts/**" - "com.unity.template-hd/Library/ArtifactDB" - "com.unity.template-hd/Library/SourceAssetDB" + logs: + paths: + - "Editor.log" pack_hdrp_template_Win_2019.4: name: Pack HDRP Template Win 2019.4 agent: @@ -66,7 +69,7 @@ pre_pack_hdrp_template_OSX_2019.4: flavor: m1.mac commands: - unity-downloader-cli --source-file unity_revision.txt -c editor --wait --published-only - - .Editor/Unity.app/Contents/MacOS/Unity -projectPath com.unity.template-hd -batchmode -quit + - .Editor/Unity.app/Contents/MacOS/Unity -projectPath com.unity.template-hd -batchmode -quit -logFile ./Editor.log dependencies: - .yamato/_editor_priming.yml#editor:priming:2019.4:OSX artifacts: @@ -75,6 +78,9 @@ pre_pack_hdrp_template_OSX_2019.4: - "com.unity.template-hd/Library/Artifacts/**" - "com.unity.template-hd/Library/ArtifactDB" - "com.unity.template-hd/Library/SourceAssetDB" + logs: + paths: + - "Editor.log" pack_hdrp_template_OSX_2019.4: name: Pack HDRP Template OSX 2019.4 agent: @@ -155,7 +161,7 @@ pre_pack_hdrp_template_Win_fast-2019.4: commands: - choco install unity-downloader-cli -y -s https://artifactory.prd.it.unity3d.com/artifactory/api/nuget/unity-choco-local - unity-downloader-cli --source-file unity_revision.txt -c editor --wait --published-only - - .Editor\Unity.exe -projectPath com.unity.template-hd -batchmode -quit + - .Editor\Unity.exe -projectPath com.unity.template-hd -batchmode -quit -logFile ./Editor.log dependencies: - .yamato/_editor_priming.yml#editor:priming:fast-2019.4:Win artifacts: @@ -164,6 +170,9 @@ pre_pack_hdrp_template_Win_fast-2019.4: - "com.unity.template-hd/Library/Artifacts/**" - "com.unity.template-hd/Library/ArtifactDB" - "com.unity.template-hd/Library/SourceAssetDB" + logs: + paths: + - "Editor.log" pack_hdrp_template_Win_fast-2019.4: name: Pack HDRP Template Win fast-2019.4 agent: @@ -206,7 +215,7 @@ pre_pack_hdrp_template_OSX_fast-2019.4: flavor: m1.mac commands: - unity-downloader-cli --source-file unity_revision.txt -c editor --wait --published-only - - .Editor/Unity.app/Contents/MacOS/Unity -projectPath com.unity.template-hd -batchmode -quit + - .Editor/Unity.app/Contents/MacOS/Unity -projectPath com.unity.template-hd -batchmode -quit -logFile ./Editor.log dependencies: - .yamato/_editor_priming.yml#editor:priming:fast-2019.4:OSX artifacts: @@ -215,6 +224,9 @@ pre_pack_hdrp_template_OSX_fast-2019.4: - "com.unity.template-hd/Library/Artifacts/**" - "com.unity.template-hd/Library/ArtifactDB" - "com.unity.template-hd/Library/SourceAssetDB" + logs: + paths: + - "Editor.log" pack_hdrp_template_OSX_fast-2019.4: name: Pack HDRP Template OSX fast-2019.4 agent: @@ -295,7 +307,7 @@ pre_pack_hdrp_template_Win_CUSTOM-REVISION: commands: - choco install unity-downloader-cli -y -s https://artifactory.prd.it.unity3d.com/artifactory/api/nuget/unity-choco-local - unity-downloader-cli --source-file unity_revision.txt -c editor --wait --published-only - - .Editor\Unity.exe -projectPath com.unity.template-hd -batchmode -quit + - .Editor\Unity.exe -projectPath com.unity.template-hd -batchmode -quit -logFile ./Editor.log dependencies: - .yamato/_editor_priming.yml#editor:priming:CUSTOM-REVISION:Win artifacts: @@ -304,6 +316,9 @@ pre_pack_hdrp_template_Win_CUSTOM-REVISION: - "com.unity.template-hd/Library/Artifacts/**" - "com.unity.template-hd/Library/ArtifactDB" - "com.unity.template-hd/Library/SourceAssetDB" + logs: + paths: + - "Editor.log" pack_hdrp_template_Win_CUSTOM-REVISION: name: Pack HDRP Template Win CUSTOM-REVISION agent: @@ -346,7 +361,7 @@ pre_pack_hdrp_template_OSX_CUSTOM-REVISION: flavor: m1.mac commands: - unity-downloader-cli --source-file unity_revision.txt -c editor --wait --published-only - - .Editor/Unity.app/Contents/MacOS/Unity -projectPath com.unity.template-hd -batchmode -quit + - .Editor/Unity.app/Contents/MacOS/Unity -projectPath com.unity.template-hd -batchmode -quit -logFile ./Editor.log dependencies: - .yamato/_editor_priming.yml#editor:priming:CUSTOM-REVISION:OSX artifacts: @@ -355,6 +370,9 @@ pre_pack_hdrp_template_OSX_CUSTOM-REVISION: - "com.unity.template-hd/Library/Artifacts/**" - "com.unity.template-hd/Library/ArtifactDB" - "com.unity.template-hd/Library/SourceAssetDB" + logs: + paths: + - "Editor.log" pack_hdrp_template_OSX_CUSTOM-REVISION: name: Pack HDRP Template OSX CUSTOM-REVISION agent: @@ -435,7 +453,7 @@ pre_pack_universal_template_Win_2019.4: commands: - choco install unity-downloader-cli -y -s https://artifactory.prd.it.unity3d.com/artifactory/api/nuget/unity-choco-local - unity-downloader-cli --source-file unity_revision.txt -c editor --wait --published-only - - .Editor\Unity.exe -projectPath com.unity.template-universal -batchmode -quit + - .Editor\Unity.exe -projectPath com.unity.template-universal -batchmode -quit -logFile ./Editor.log dependencies: - .yamato/_editor_priming.yml#editor:priming:2019.4:Win artifacts: @@ -444,6 +462,9 @@ pre_pack_universal_template_Win_2019.4: - "com.unity.template-universal/Library/Artifacts/**" - "com.unity.template-universal/Library/ArtifactDB" - "com.unity.template-universal/Library/SourceAssetDB" + logs: + paths: + - "Editor.log" pack_universal_template_Win_2019.4: name: Pack Universal Template Win 2019.4 agent: @@ -486,7 +507,7 @@ pre_pack_universal_template_OSX_2019.4: flavor: m1.mac commands: - unity-downloader-cli --source-file unity_revision.txt -c editor --wait --published-only - - .Editor/Unity.app/Contents/MacOS/Unity -projectPath com.unity.template-universal -batchmode -quit + - .Editor/Unity.app/Contents/MacOS/Unity -projectPath com.unity.template-universal -batchmode -quit -logFile ./Editor.log dependencies: - .yamato/_editor_priming.yml#editor:priming:2019.4:OSX artifacts: @@ -495,6 +516,9 @@ pre_pack_universal_template_OSX_2019.4: - "com.unity.template-universal/Library/Artifacts/**" - "com.unity.template-universal/Library/ArtifactDB" - "com.unity.template-universal/Library/SourceAssetDB" + logs: + paths: + - "Editor.log" pack_universal_template_OSX_2019.4: name: Pack Universal Template OSX 2019.4 agent: @@ -575,7 +599,7 @@ pre_pack_universal_template_Win_fast-2019.4: commands: - choco install unity-downloader-cli -y -s https://artifactory.prd.it.unity3d.com/artifactory/api/nuget/unity-choco-local - unity-downloader-cli --source-file unity_revision.txt -c editor --wait --published-only - - .Editor\Unity.exe -projectPath com.unity.template-universal -batchmode -quit + - .Editor\Unity.exe -projectPath com.unity.template-universal -batchmode -quit -logFile ./Editor.log dependencies: - .yamato/_editor_priming.yml#editor:priming:fast-2019.4:Win artifacts: @@ -584,6 +608,9 @@ pre_pack_universal_template_Win_fast-2019.4: - "com.unity.template-universal/Library/Artifacts/**" - "com.unity.template-universal/Library/ArtifactDB" - "com.unity.template-universal/Library/SourceAssetDB" + logs: + paths: + - "Editor.log" pack_universal_template_Win_fast-2019.4: name: Pack Universal Template Win fast-2019.4 agent: @@ -626,7 +653,7 @@ pre_pack_universal_template_OSX_fast-2019.4: flavor: m1.mac commands: - unity-downloader-cli --source-file unity_revision.txt -c editor --wait --published-only - - .Editor/Unity.app/Contents/MacOS/Unity -projectPath com.unity.template-universal -batchmode -quit + - .Editor/Unity.app/Contents/MacOS/Unity -projectPath com.unity.template-universal -batchmode -quit -logFile ./Editor.log dependencies: - .yamato/_editor_priming.yml#editor:priming:fast-2019.4:OSX artifacts: @@ -635,6 +662,9 @@ pre_pack_universal_template_OSX_fast-2019.4: - "com.unity.template-universal/Library/Artifacts/**" - "com.unity.template-universal/Library/ArtifactDB" - "com.unity.template-universal/Library/SourceAssetDB" + logs: + paths: + - "Editor.log" pack_universal_template_OSX_fast-2019.4: name: Pack Universal Template OSX fast-2019.4 agent: @@ -715,7 +745,7 @@ pre_pack_universal_template_Win_CUSTOM-REVISION: commands: - choco install unity-downloader-cli -y -s https://artifactory.prd.it.unity3d.com/artifactory/api/nuget/unity-choco-local - unity-downloader-cli --source-file unity_revision.txt -c editor --wait --published-only - - .Editor\Unity.exe -projectPath com.unity.template-universal -batchmode -quit + - .Editor\Unity.exe -projectPath com.unity.template-universal -batchmode -quit -logFile ./Editor.log dependencies: - .yamato/_editor_priming.yml#editor:priming:CUSTOM-REVISION:Win artifacts: @@ -724,6 +754,9 @@ pre_pack_universal_template_Win_CUSTOM-REVISION: - "com.unity.template-universal/Library/Artifacts/**" - "com.unity.template-universal/Library/ArtifactDB" - "com.unity.template-universal/Library/SourceAssetDB" + logs: + paths: + - "Editor.log" pack_universal_template_Win_CUSTOM-REVISION: name: Pack Universal Template Win CUSTOM-REVISION agent: @@ -766,7 +799,7 @@ pre_pack_universal_template_OSX_CUSTOM-REVISION: flavor: m1.mac commands: - unity-downloader-cli --source-file unity_revision.txt -c editor --wait --published-only - - .Editor/Unity.app/Contents/MacOS/Unity -projectPath com.unity.template-universal -batchmode -quit + - .Editor/Unity.app/Contents/MacOS/Unity -projectPath com.unity.template-universal -batchmode -quit -logFile ./Editor.log dependencies: - .yamato/_editor_priming.yml#editor:priming:CUSTOM-REVISION:OSX artifacts: @@ -775,6 +808,9 @@ pre_pack_universal_template_OSX_CUSTOM-REVISION: - "com.unity.template-universal/Library/Artifacts/**" - "com.unity.template-universal/Library/ArtifactDB" - "com.unity.template-universal/Library/SourceAssetDB" + logs: + paths: + - "Editor.log" pack_universal_template_OSX_CUSTOM-REVISION: name: Pack Universal Template OSX CUSTOM-REVISION agent: diff --git a/.yamato/script/gfx_sdet_tools_revision.txt b/.yamato/script/gfx_sdet_tools_revision.txt index 94ab7e7b13a..ba34966e111 100644 --- a/.yamato/script/gfx_sdet_tools_revision.txt +++ b/.yamato/script/gfx_sdet_tools_revision.txt @@ -1 +1 @@ -8297e86052494248679cd1fa8f7f33a242781837 +7400a05da0e28a1212a70b4e15a6f752f4f7bb09 From 28fcf8e5965827aa9b057316cca346d302514ab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Penavaire?= Date: Mon, 26 Jul 2021 10:38:00 +0200 Subject: [PATCH 2/3] Backport #5186 --- .yamato/script/generate_ymls.py | 38 +++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/.yamato/script/generate_ymls.py b/.yamato/script/generate_ymls.py index b4ae92d8805..07bdf8f47a8 100644 --- a/.yamato/script/generate_ymls.py +++ b/.yamato/script/generate_ymls.py @@ -1,14 +1,15 @@ import os import subprocess import ruamel.yaml as yml +import sys # This script calls the ruamel build.py script, with an argument pointing to current GIT repo -# i.e. when this is called within Graphics repo, then build.py will edit the files in Graphics repo +# i.e. when this is called within Graphics repo, then build.py will edit the files in Graphics repo # # 1) create path.config file (yml format) in the same directory with this script, with the following content (this file is ignored by git) # gfx_sdet_tools_path: "[your path to repo checkout using forward slashes]/gfx-sdet-tools" -# -# 2) call +# +# 2) call # python generate_ymls.py # # 3) new .ymls should be now present in your repo @@ -16,31 +17,36 @@ # !! REMEMBER to keep the gfx-sdet-tools repo up-to-date -root_dir = os.path.dirname(os.path.dirname(os.path.abspath(os.path.dirname(__file__)))) +root_dir = os.path.dirname(os.path.dirname( + os.path.abspath(os.path.dirname(__file__)))) -if __name__== "__main__": +if __name__ == "__main__": yaml = yml.YAML() - + current_yamato_dir = os.path.join(root_dir, '.yamato') config_file = os.path.join(current_yamato_dir, 'script', 'path.config') - gfx_sdet_tools_rev_file = os.path.join(current_yamato_dir, 'script', 'gfx_sdet_tools_revision.txt') - + gfx_sdet_tools_rev_file = os.path.join( + current_yamato_dir, 'script', 'gfx_sdet_tools_revision.txt') + with open(config_file) as f: config = yaml.load(f) gfx_sdet_tools_dir = config["gfx_sdet_tools_path"] - build_py = os.path.join(gfx_sdet_tools_dir,'yml-generator','ruamel','build.py') + build_py = os.path.join( + gfx_sdet_tools_dir, 'yml-generator', 'ruamel', 'build.py') - cmd = f'python "{build_py}" --yamato-dir "{current_yamato_dir}"' - print(f'Calling [{cmd}]') - - process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True) + cmd = [sys.executable, build_py, '--yamato-dir', current_yamato_dir] + print(f'Calling {cmd}') + + process = subprocess.Popen( + cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True) for stdout_line in iter(process.stdout.readline, ""): print(stdout_line.strip()) process.stdout.close() process.wait() - gfx_sdet_tools_rev = subprocess.check_output('git rev-parse HEAD', stderr=subprocess.STDOUT, universal_newlines=True, cwd=gfx_sdet_tools_dir) + gfx_sdet_tools_rev = subprocess.check_output( + ['git', 'rev-parse', 'HEAD'], stderr=subprocess.STDOUT, universal_newlines=True, cwd=gfx_sdet_tools_dir) with open(gfx_sdet_tools_rev_file, 'w') as f: f.write(gfx_sdet_tools_rev) - - print(f'Used gfx-sdet-tools at revision {gfx_sdet_tools_rev}') \ No newline at end of file + + print(f'Used gfx-sdet-tools at revision {gfx_sdet_tools_rev}') From 13e1ee52ffeed8fd9c38169a45bf129866a843ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Penavaire?= Date: Mon, 26 Jul 2021 15:54:29 +0200 Subject: [PATCH 3/3] Remove dependency on pre-pack step for templates --- .yamato/_templates.yml | 24 ------------------------ .yamato/config/_templates.metafile | 4 ++-- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/.yamato/_templates.yml b/.yamato/_templates.yml index c235c0bb01d..338ac2d6c3d 100644 --- a/.yamato/_templates.yml +++ b/.yamato/_templates.yml @@ -36,8 +36,6 @@ pack_hdrp_template_Win_2019.4: commands: - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm - upm-ci template pack --project-path com.unity.template-hd - dependencies: - - .yamato/_templates.yml#pre_pack_hdrp_template_Win_2019.4 artifacts: packages: paths: @@ -90,8 +88,6 @@ pack_hdrp_template_OSX_2019.4: commands: - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm - upm-ci template pack --project-path com.unity.template-hd - dependencies: - - .yamato/_templates.yml#pre_pack_hdrp_template_OSX_2019.4 artifacts: packages: paths: @@ -182,8 +178,6 @@ pack_hdrp_template_Win_fast-2019.4: commands: - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm - upm-ci template pack --project-path com.unity.template-hd - dependencies: - - .yamato/_templates.yml#pre_pack_hdrp_template_Win_fast-2019.4 artifacts: packages: paths: @@ -236,8 +230,6 @@ pack_hdrp_template_OSX_fast-2019.4: commands: - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm - upm-ci template pack --project-path com.unity.template-hd - dependencies: - - .yamato/_templates.yml#pre_pack_hdrp_template_OSX_fast-2019.4 artifacts: packages: paths: @@ -328,8 +320,6 @@ pack_hdrp_template_Win_CUSTOM-REVISION: commands: - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm - upm-ci template pack --project-path com.unity.template-hd - dependencies: - - .yamato/_templates.yml#pre_pack_hdrp_template_Win_CUSTOM-REVISION artifacts: packages: paths: @@ -382,8 +372,6 @@ pack_hdrp_template_OSX_CUSTOM-REVISION: commands: - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm - upm-ci template pack --project-path com.unity.template-hd - dependencies: - - .yamato/_templates.yml#pre_pack_hdrp_template_OSX_CUSTOM-REVISION artifacts: packages: paths: @@ -474,8 +462,6 @@ pack_universal_template_Win_2019.4: commands: - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm - upm-ci template pack --project-path com.unity.template-universal - dependencies: - - .yamato/_templates.yml#pre_pack_universal_template_Win_2019.4 artifacts: packages: paths: @@ -528,8 +514,6 @@ pack_universal_template_OSX_2019.4: commands: - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm - upm-ci template pack --project-path com.unity.template-universal - dependencies: - - .yamato/_templates.yml#pre_pack_universal_template_OSX_2019.4 artifacts: packages: paths: @@ -620,8 +604,6 @@ pack_universal_template_Win_fast-2019.4: commands: - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm - upm-ci template pack --project-path com.unity.template-universal - dependencies: - - .yamato/_templates.yml#pre_pack_universal_template_Win_fast-2019.4 artifacts: packages: paths: @@ -674,8 +656,6 @@ pack_universal_template_OSX_fast-2019.4: commands: - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm - upm-ci template pack --project-path com.unity.template-universal - dependencies: - - .yamato/_templates.yml#pre_pack_universal_template_OSX_fast-2019.4 artifacts: packages: paths: @@ -766,8 +746,6 @@ pack_universal_template_Win_CUSTOM-REVISION: commands: - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm - upm-ci template pack --project-path com.unity.template-universal - dependencies: - - .yamato/_templates.yml#pre_pack_universal_template_Win_CUSTOM-REVISION artifacts: packages: paths: @@ -820,8 +798,6 @@ pack_universal_template_OSX_CUSTOM-REVISION: commands: - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm - upm-ci template pack --project-path com.unity.template-universal - dependencies: - - .yamato/_templates.yml#pre_pack_universal_template_OSX_CUSTOM-REVISION artifacts: packages: paths: diff --git a/.yamato/config/_templates.metafile b/.yamato/config/_templates.metafile index 43b5deb20c5..a3cd200deba 100644 --- a/.yamato/config/_templates.metafile +++ b/.yamato/config/_templates.metafile @@ -8,7 +8,7 @@ templates: - vfx - config - hdrp - hascodependencies: 1 + include_prepack_step: False - name: Universal Template id: universal_template packagename: com.unity.template-universal @@ -16,7 +16,7 @@ templates: - core - shadergraph - universal - hascodependencies: 1 + include_prepack_step: False platforms: - name: Win - name: OSX