diff --git a/dist/index.js b/dist/index.js index 386a8107..9024d9b3 100644 Binary files a/dist/index.js and b/dist/index.js differ diff --git a/dist/index.js.map b/dist/index.js.map index 07404dbd..81e90c9d 100644 Binary files a/dist/index.js.map and b/dist/index.js.map differ diff --git a/src/model/cloud-runner/tests/cloud-runner-image.test.ts b/src/model/cloud-runner/tests/cloud-runner-image.test.ts new file mode 100644 index 00000000..158f7c1f --- /dev/null +++ b/src/model/cloud-runner/tests/cloud-runner-image.test.ts @@ -0,0 +1,48 @@ +import { BuildParameters, ImageTag } from '../..'; +import UnityVersioning from '../../unity-versioning'; +import { Cli } from '../../cli/cli'; +import GitHub from '../../github'; +import setups from './cloud-runner-suite.test'; + +async function CreateParameters(overrides: any) { + if (overrides) { + Cli.options = overrides; + } + const originalValue = GitHub.githubInputEnabled; + GitHub.githubInputEnabled = false; + const results = await BuildParameters.create(); + GitHub.githubInputEnabled = originalValue; + delete Cli.options; + + return results; +} + +describe('Cloud Runner Image', () => { + setups(); + const testSecretName = 'testSecretName'; + const testSecretValue = 'testSecretValue'; + it('Can create valid image from normal config', async () => { + // Setup parameters + const buildParameter = await CreateParameters({ + versioning: 'None', + projectPath: 'test-project', + unityVersion: UnityVersioning.read('test-project'), + targetPlatform: 'StandaloneWindows64', + customJob: ` + - name: 'step 1' + image: 'ubuntu' + commands: 'printenv' + secrets: + - name: '${testSecretName}' + value: '${testSecretValue}' + `, + }); + const baseImage = new ImageTag(buildParameter); + if (buildParameter.targetPlatform === undefined) { + throw new Error(`target platform includes undefined`); + } + if (baseImage.toString().includes('undefined')) { + throw new Error(`Base image ${baseImage.toString()} includes undefined`); + } + }, 1_000_000_000); +}); diff --git a/src/model/input.ts b/src/model/input.ts index c12abe00..c5ca4274 100644 --- a/src/model/input.ts +++ b/src/model/input.ts @@ -261,7 +261,7 @@ class Input { } static get containerRegistryRepository(): string { - return Input.getInput('containerRegistryRepository')!; + return Input.getInput('containerRegistryRepository') || 'unityci/editor'; } static get containerRegistryImageVersion(): string {