better named tests and log local-docker params
parent
b7aa8561f1
commit
481a514e8f
|
|
@ -4726,7 +4726,7 @@ const base_64_1 = __importDefault(__nccwpck_require__(85848));
|
||||||
const core = __importStar(__nccwpck_require__(42186));
|
const core = __importStar(__nccwpck_require__(42186));
|
||||||
class TaskParameterSerializer {
|
class TaskParameterSerializer {
|
||||||
static readBuildEnvironmentVariables(buildParameters) {
|
static readBuildEnvironmentVariables(buildParameters) {
|
||||||
return [
|
return this.uniqBy([
|
||||||
{
|
{
|
||||||
name: 'ContainerMemory',
|
name: 'ContainerMemory',
|
||||||
value: buildParameters.cloudRunnerMemory,
|
value: buildParameters.cloudRunnerMemory,
|
||||||
|
|
@ -4762,6 +4762,13 @@ class TaskParameterSerializer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return x;
|
return x;
|
||||||
|
}), (item) => item.name);
|
||||||
|
}
|
||||||
|
static uniqBy(a, key) {
|
||||||
|
const seen = {};
|
||||||
|
return a.filter(function (item) {
|
||||||
|
const k = key(item);
|
||||||
|
return seen.hasOwnProperty(k) ? false : (seen[k] = true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
static readBuildParameterFromEnvironment() {
|
static readBuildParameterFromEnvironment() {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -15,46 +15,59 @@ import * as core from '@actions/core';
|
||||||
export class TaskParameterSerializer {
|
export class TaskParameterSerializer {
|
||||||
static readonly blocked = new Set(['0', 'length', 'prototype', '', 'unityVersion']);
|
static readonly blocked = new Set(['0', 'length', 'prototype', '', 'unityVersion']);
|
||||||
public static readBuildEnvironmentVariables(buildParameters: BuildParameters): CloudRunnerEnvironmentVariable[] {
|
public static readBuildEnvironmentVariables(buildParameters: BuildParameters): CloudRunnerEnvironmentVariable[] {
|
||||||
return [
|
return this.uniqBy(
|
||||||
{
|
[
|
||||||
name: 'ContainerMemory',
|
{
|
||||||
value: buildParameters.cloudRunnerMemory,
|
name: 'ContainerMemory',
|
||||||
},
|
value: buildParameters.cloudRunnerMemory,
|
||||||
{
|
},
|
||||||
name: 'ContainerCpu',
|
{
|
||||||
value: buildParameters.cloudRunnerCpu,
|
name: 'ContainerCpu',
|
||||||
},
|
value: buildParameters.cloudRunnerCpu,
|
||||||
{
|
},
|
||||||
name: 'BUILD_TARGET',
|
{
|
||||||
value: buildParameters.targetPlatform,
|
name: 'BUILD_TARGET',
|
||||||
},
|
value: buildParameters.targetPlatform,
|
||||||
...TaskParameterSerializer.serializeFromObject(buildParameters),
|
},
|
||||||
...TaskParameterSerializer.readInput(),
|
...TaskParameterSerializer.serializeFromObject(buildParameters),
|
||||||
...CloudRunnerCustomHooks.getSecrets(CloudRunnerCustomHooks.getHooks(buildParameters.customJobHooks)),
|
...TaskParameterSerializer.readInput(),
|
||||||
]
|
...CloudRunnerCustomHooks.getSecrets(CloudRunnerCustomHooks.getHooks(buildParameters.customJobHooks)),
|
||||||
.filter(
|
]
|
||||||
(x) =>
|
.filter(
|
||||||
!TaskParameterSerializer.blocked.has(x.name) &&
|
(x) =>
|
||||||
x.value !== '' &&
|
!TaskParameterSerializer.blocked.has(x.name) &&
|
||||||
x.value !== undefined &&
|
x.value !== '' &&
|
||||||
x.value !== `undefined`,
|
x.value !== undefined &&
|
||||||
)
|
x.value !== `undefined`,
|
||||||
.map((x) => {
|
)
|
||||||
x.name = TaskParameterSerializer.ToEnvVarFormat(x.name);
|
.map((x) => {
|
||||||
x.value = `${x.value}`;
|
x.name = TaskParameterSerializer.ToEnvVarFormat(x.name);
|
||||||
if (x.name === `CUSTOM_JOB` || x.name === `GAMECI-CUSTOM_JOB`) {
|
x.value = `${x.value}`;
|
||||||
x.value = base64.encode(x.value);
|
if (x.name === `CUSTOM_JOB` || x.name === `GAMECI-CUSTOM_JOB`) {
|
||||||
}
|
x.value = base64.encode(x.value);
|
||||||
if (buildParameters.cloudRunnerIntegrationTests) {
|
}
|
||||||
if (Number(x.name) === Number.NaN) {
|
if (buildParameters.cloudRunnerIntegrationTests) {
|
||||||
core.info(`[ERROR] found a number in task param serializer ${JSON.stringify(x)}`);
|
if (Number(x.name) === Number.NaN) {
|
||||||
} else {
|
core.info(`[ERROR] found a number in task param serializer ${JSON.stringify(x)}`);
|
||||||
core.info(`${JSON.stringify(x)}`);
|
} else {
|
||||||
|
core.info(`${JSON.stringify(x)}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return x;
|
return x;
|
||||||
});
|
}),
|
||||||
|
(item) => item.name,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static uniqBy(a, key) {
|
||||||
|
const seen = {};
|
||||||
|
|
||||||
|
return a.filter(function (item) {
|
||||||
|
const k = key(item);
|
||||||
|
|
||||||
|
return seen.hasOwnProperty(k) ? false : (seen[k] = true);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static readBuildParameterFromEnvironment(): BuildParameters {
|
public static readBuildParameterFromEnvironment(): BuildParameters {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue