better named tests and log local-docker params

pull/461/head
Frostebite 2022-09-21 03:47:35 +01:00
parent 7c332a36fb
commit f47566e286
4 changed files with 14 additions and 390817 deletions

390787
dist/index.js vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -34,7 +34,10 @@ export class CloudRunnerCustomHooks {
}
public static getSecrets(hooks) {
return hooks.map((x) => x.secrets).filter((x) => x !== undefined && x.length > 0);
const secrets = hooks.map((x) => x.secrets).filter((x) => x !== undefined && x.length > 0);
// eslint-disable-next-line unicorn/no-array-reduce
return secrets.length > 0 ? secrets.reduce((x, y) => [...x, ...y]) : [];
}
}
export class Hook {

View File

@ -6,12 +6,12 @@ import CloudRunnerQueryOverride from './cloud-runner-query-override';
import CloudRunnerOptionsReader from './cloud-runner-options-reader';
import BuildParameters from '../../build-parameters';
import CloudRunnerOptions from '../cloud-runner-options';
import * as core from '@actions/core';
// import CloudRunner from '../cloud-runner';
// import ImageEnvironmentFactory from '../../image-environment-factory';
export class TaskParameterSerializer {
static readonly blocked = new Set(['0', 'length', 'prototype', '', 'unityVersion']);
public static readBuildEnvironmentVariables(buildParameters: BuildParameters): CloudRunnerEnvironmentVariable[] {
return [
{
@ -26,36 +26,17 @@ export class TaskParameterSerializer {
name: 'BUILD_TARGET',
value: buildParameters.targetPlatform,
},
...TaskParameterSerializer.serializeBuildParamsAndInput(buildParameters),
];
}
private static serializeBuildParamsAndInput(buildParameters: BuildParameters) {
core.info(`Serializing ${JSON.stringify(buildParameters, undefined, 4)}`);
let array = [
...TaskParameterSerializer.serializeFromObject(buildParameters),
...TaskParameterSerializer.readInput(),
];
core.info(`Array with object serialized build params and input ${JSON.stringify(array, undefined, 4)}`);
const secrets = CloudRunnerCustomHooks.getSecrets(CloudRunnerCustomHooks.getHooks(buildParameters.customJobHooks));
if (secrets.length > 0) {
// eslint-disable-next-line unicorn/no-array-reduce
array.push(secrets.reduce((x, y) => [...x, ...y]));
}
core.info(`Array with secrets added ${JSON.stringify(array, undefined, 4)}`);
...CloudRunnerCustomHooks.getSecrets(CloudRunnerCustomHooks.getHooks(buildParameters.customJobHooks)),
]
.filter((x) => !TaskParameterSerializer.blocked.has(x.name))
.map((x) => {
x.name = Input.ToEnvVarFormat(x.name);
x.value = `${x.value}`;
const blocked = new Set(['0', 'length', 'prototype', '', 'unityVersion']);
array = array.filter((x) => !blocked.has(x.name));
core.info(`Array after blocking removed added ${JSON.stringify(array, undefined, 4)}`);
array = array.map((x) => {
x.name = Input.ToEnvVarFormat(x.name);
x.value = `${x.value}`;
return x;
});
core.info(`Array after env var formatting ${JSON.stringify(array, undefined, 4)}`);
return array;
return x;
});
}
public static readBuildParameterFromEnvironment(): BuildParameters {