From 74ad7d84980e97973f3af199dd4fec79c5f143e6 Mon Sep 17 00:00:00 2001 From: Frostebite Date: Fri, 19 Jan 2024 19:13:17 +0000 Subject: [PATCH] fix --- dist/index.js | Bin 22194817 -> 22194726 bytes dist/index.js.map | Bin 14669232 -> 14669149 bytes .../options/cloud-runner-options.ts | 4 ++-- .../tests/e2e/cloud-runner-kubernetes.test.ts | 7 ++++++- src/model/image-tag.ts | 15 +++++++-------- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/dist/index.js b/dist/index.js index ffc84538e092a043bebf586b8d4640026d2c61e0..2b01188d4c2a5df7092b891ea754779ea212f75f 100644 GIT binary patch delta 1644 zcmXxkcU0A79LMoW|m^dCqgr_nhxvPiaG)bNiV(XU)|He={M$ z%=M)ncUNt;2l=iyl=+%N9oE8qn;cero#860ZY-~Ew85{oy3xLOm;apN+`PH9(@KpH zKPzsLvHQP=pv6X@Jt8;9Oo}PUn_ZMMzi^&eQeyspw=T!pT-J#u!(p8}xi#2#Ff7dH z4t84CF1Q?4!BQj2%5O3ve6yMZt<1GGj@s!-Cz6MTN!LiL7oVFE>1v=a4;Iqg9oLe|dd{0i6K|gabivA{Z?Yf>5+XE3`%!+Mq4k zp*>s(M+7>+jYveHBcfp<2AvR#IK(3XiAX|cbU{}nqZ?At9jWL64|<{(dZQ2eq96KW z00v?Zycmoj7>Z#Sjx>xwI!0m?Mk51bFcz5@hw+$zEKI}=n1sogf*UavH{oVX!!5WK z(=h`xF$=RX2e)A^vXO(^aR+j7C+G=KI-uSPT~|!;|vf8bC2g}-qf|17JouvJ3wQ|yYN z_$vWQpyE)16sHobv`|8nP^G2PN@=ZxDQ%RtN;{>!;!?tu2&IGKRw9)srK1w9m`aS& zNr_eBlz1gUNmP=Q&Po@htCFmAQ&N=fN~+RB@hCl&UP^DJkJ4A^r}S3_Cqx79S;7qh;;l=$3bo@0J)x?CYlzGz3`ubx`Vyk7YicYYSGs5iFvPPpd z_b9^(%<3ASyTb3!s{ZHqbB}Up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FZ4zq1fehbp+5#-AO=B?U<`%5~DC0VHkt42*)^##{`%#5fPY#$(Vwvh{QBRVLE0Y8Z!}tS(uGj%t0LD zk$^T*ehBC_yQ%;u@~w25#aOZsQK_;vVkf0UqKJ9^(m~;u*^D9OZa{ e3RI#BFHwzGsKINz!CSn;dwf8xl3n+)`onLMxT$9V diff --git a/src/model/cloud-runner/options/cloud-runner-options.ts b/src/model/cloud-runner/options/cloud-runner-options.ts index 830deb68..814d104c 100644 --- a/src/model/cloud-runner/options/cloud-runner-options.ts +++ b/src/model/cloud-runner/options/cloud-runner-options.ts @@ -103,14 +103,14 @@ class CloudRunnerOptions { static get buildPlatform(): string { const input = CloudRunnerOptions.getInput('buildPlatform'); - if (input) { + if (input && input !== '') { return input; } if (CloudRunnerOptions.providerStrategy !== 'local') { return 'linux'; } - return ``; + return process.platform; } static get cloudRunnerBranch(): string { diff --git a/src/model/cloud-runner/tests/e2e/cloud-runner-kubernetes.test.ts b/src/model/cloud-runner/tests/e2e/cloud-runner-kubernetes.test.ts index a649160d..eb028c46 100644 --- a/src/model/cloud-runner/tests/e2e/cloud-runner-kubernetes.test.ts +++ b/src/model/cloud-runner/tests/e2e/cloud-runner-kubernetes.test.ts @@ -19,23 +19,28 @@ async function CreateParameters(overrides: any) { describe('Cloud Runner Kubernetes', () => { it('Responds', () => {}); setups(); + if (CloudRunnerOptions.cloudRunnerDebug) { it('Run one build it using K8s without error', async () => { if (CloudRunnerOptions.providerStrategy !== `k8s`) { return; } + process.env.USE_IL2CPP = 'false'; const overrides = { versioning: 'None', projectPath: 'test-project', unityVersion: UnityVersioning.determineUnityVersion('test-project', UnityVersioning.read('test-project')), targetPlatform: 'StandaloneLinux64', cacheKey: `test-case-${uuidv4()}`, + providerStrategy: 'k8s', + buildPlatform: 'linux', }; const buildParameter = await CreateParameters(overrides); expect(buildParameter.projectPath).toEqual(overrides.projectPath); const baseImage = new ImageTag(buildParameter); - const results = await CloudRunner.run(buildParameter, baseImage.toString()); + const resultsObject = await CloudRunner.run(buildParameter, baseImage.toString()); + const results = resultsObject.BuildResults; const libraryString = 'Rebuilding Library because the asset database could not be found!'; const cachePushFail = 'Did not push source folder to cache because it was empty Library'; const buildSucceededString = 'Build succeeded'; diff --git a/src/model/image-tag.ts b/src/model/image-tag.ts index cf484708..81145b6e 100644 --- a/src/model/image-tag.ts +++ b/src/model/image-tag.ts @@ -2,7 +2,6 @@ import Platform from './platform'; class ImageTag { public repository: string; - public cloudRunnerBuilderPlatform!: string; public editorVersion: string; public targetPlatform: string; public builderPlatform: string; @@ -15,7 +14,7 @@ class ImageTag { editorVersion, targetPlatform, customImage, - cloudRunnerBuilderPlatform, + buildPlatform, containerRegistryRepository, containerRegistryImageVersion, } = imageProperties; @@ -32,12 +31,8 @@ class ImageTag { this.repository = containerRegistryRepository; this.editorVersion = editorVersion; this.targetPlatform = targetPlatform; - this.cloudRunnerBuilderPlatform = cloudRunnerBuilderPlatform; - const isCloudRunnerLocal = cloudRunnerBuilderPlatform === 'local' || cloudRunnerBuilderPlatform === undefined; this.builderPlatform = ImageTag.getTargetPlatformToTargetPlatformSuffixMap(targetPlatform, editorVersion); - this.imagePlatformPrefix = ImageTag.getImagePlatformPrefixes( - isCloudRunnerLocal ? process.platform : cloudRunnerBuilderPlatform, - ); + this.imagePlatformPrefix = ImageTag.getImagePlatformPrefixes(buildPlatform); this.imageRollingVersion = Number(containerRegistryImageVersion); // Will automatically roll to the latest non-breaking version. } @@ -63,6 +58,10 @@ class ImageTag { } static getImagePlatformPrefixes(platform: string): string { + if (!platform || platform === '') { + platform = process.platform; + } + switch (platform) { case 'win32': return 'windows'; @@ -101,7 +100,7 @@ class ImageTag { return windows; case Platform.types.StandaloneLinux64: { // Unity versions before 2019.3 do not support il2cpp - if (major >= 2020 || (major === 2019 && minor >= 3)) { + if (process.env.USE_IL2CPP === 'true' && (major >= 2020 || (major === 2019 && minor >= 3))) { return linuxIl2cpp; }