mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-07 20:35:33 -04:00
fix
This commit is contained in:
parent
8ca921403e
commit
5d52c1d356
BIN
dist/index.js
generated
vendored
BIN
dist/index.js
generated
vendored
Binary file not shown.
BIN
dist/index.js.map
generated
vendored
BIN
dist/index.js.map
generated
vendored
Binary file not shown.
48
src/model/cloud-runner/tests/cloud-runner-image.test.ts
Normal file
48
src/model/cloud-runner/tests/cloud-runner-image.test.ts
Normal file
@ -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);
|
||||||
|
});
|
@ -261,7 +261,7 @@ class Input {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static get containerRegistryRepository(): string {
|
static get containerRegistryRepository(): string {
|
||||||
return Input.getInput('containerRegistryRepository')!;
|
return Input.getInput('containerRegistryRepository') || 'unityci/editor';
|
||||||
}
|
}
|
||||||
|
|
||||||
static get containerRegistryImageVersion(): string {
|
static get containerRegistryImageVersion(): string {
|
||||||
|
Loading…
Reference in New Issue
Block a user