Streamline code styles (#384)

* feat: streamline code styles

* feat: spacing for comments and return statements

* chore: enforce camelcase

* fix: remove npm lock file

* fix: add integrity test

* fix: remove logfile

* chore: update node in test workflow
This commit is contained in:
Webber Takken
2022-04-12 00:43:41 +02:00
committed by GitHub
parent 4be5d2ddf4
commit 5ae03dfef6
57 changed files with 198 additions and 7028 deletions

22
dist/index.js generated vendored
View File

@@ -232,7 +232,7 @@ class BuildParameters {
// ---
let unitySerial = '';
if (!process.env.UNITY_SERIAL && input_1.default.githubInputEnabled && cli_1.Cli.options === undefined) {
//No serial was present so it is a personal license that we need to convert
// No serial was present, so it is a personal license that we need to convert
if (!process.env.UNITY_LICENSE) {
throw new Error(`Missing Unity License File and no Serial was found. If this
is a personal license, make sure to follow the activation
@@ -1672,14 +1672,14 @@ class Kubernetes {
runTask(buildGuid, image, commands, mountdir, workingdir, environment, secrets) {
return __awaiter(this, void 0, void 0, function* () {
try {
// setup
// Setup
this.buildGuid = buildGuid;
this.secretName = `build-credentials-${buildGuid}`;
this.jobName = `unity-builder-job-${buildGuid}`;
this.containerName = `main`;
yield kubernetes_secret_1.default.createSecret(secrets, this.secretName, this.namespace, this.kubeClient);
const jobSpec = kubernetes_job_spec_factory_1.default.getJobSpec(commands, image, mountdir, workingdir, environment, secrets, this.buildGuid, this.buildParameters, this.secretName, this.pvcName, this.jobName, k8s);
//run
// Run
const jobResult = yield this.kubeClientBatch.createNamespacedJob(this.namespace, jobSpec);
cloud_runner_logger_1.default.log(`Creating build job ${JSON.stringify(jobResult.body.metadata, undefined, 4)}`);
yield new Promise((promise) => setTimeout(promise, 5000));
@@ -2891,7 +2891,7 @@ exports.CloudRunnerFolders = void 0;
const path_1 = __importDefault(__nccwpck_require__(71017));
const __1 = __nccwpck_require__(41359);
class CloudRunnerFolders {
// only the following paths that do not start a path.join with another "Full" suffixed property need to start with an absolute /
// Only the following paths that do not start a path.join with another "Full" suffixed property need to start with an absolute /
static get uniqueCloudRunnerJobFolderAbsolute() {
return path_1.default.join(`/`, CloudRunnerFolders.buildVolumeFolder, __1.CloudRunner.buildParameters.buildGuid);
}
@@ -3897,7 +3897,7 @@ class ImageTag {
const isCloudRunnerLocal = cloudRunnerBuilderPlatform === 'local' || cloudRunnerBuilderPlatform === undefined;
this.builderPlatform = ImageTag.getTargetPlatformToTargetPlatformSuffixMap(targetPlatform, editorVersion);
this.imagePlatformPrefix = ImageTag.getImagePlatformPrefixes(isCloudRunnerLocal ? process.platform : cloudRunnerBuilderPlatform);
this.imageRollingVersion = 1; // will automatically roll to the latest non-breaking version.
this.imageRollingVersion = 1; // Will automatically roll to the latest non-breaking version.
}
static get versionPattern() {
return /^20\d{2}\.\d\.\w{3,4}|3$/;
@@ -4278,7 +4278,7 @@ class Input {
}
}
const alternativeQuery = Input.ToEnvVarFormat(query);
// query input sources
// Query input sources
if (cli_1.Cli.query(query, alternativeQuery)) {
return cli_1.Cli.query(query, alternativeQuery);
}
@@ -4357,7 +4357,7 @@ class Input {
return Input.getInput('buildsPath') || 'build';
}
static get buildMethod() {
return Input.getInput('buildMethod') || ''; // processed in docker file
return Input.getInput('buildMethod') || ''; // Processed in docker file
}
static get customParameters() {
return Input.getInput('customParameters') || '';
@@ -4579,7 +4579,7 @@ class PlatformSetup {
case 'darwin':
yield platform_setup_1.SetupMac.setup(buildParameters, actionFolder);
break;
//Add other baseOS's here
// Add other baseOS's here
}
});
}
@@ -4734,8 +4734,8 @@ class SetupWindows {
if (!fs_1.default.existsSync('c:/regkeys')) {
fs_1.default.mkdirSync('c:/regkeys');
}
// These all need the Windows 10 SDK
switch (targetPlatform) {
//These all need the Windows 10 SDK
case 'StandaloneWindows':
case 'StandaloneWindows64':
case 'WSAPlayer':
@@ -4796,7 +4796,7 @@ class ValidateWindows {
}
}
static checkForWin10SDK() {
//Check for Windows 10 SDK on runner
// Check for Windows 10 SDK on runner
const windows10SDKPathExists = fs_1.default.existsSync('C:/Program Files (x86)/Windows Kits');
if (!windows10SDKPathExists) {
throw new Error(`Windows 10 SDK not found in default location. Make sure
@@ -4805,7 +4805,7 @@ class ValidateWindows {
}
}
static checkForVisualStudio() {
//Note: When upgrading to Server 2022, we will need to move to just "program files" since VS will be 64-bit
// Note: When upgrading to Server 2022, we will need to move to just "program files" since VS will be 64-bit
const visualStudioInstallPathExists = fs_1.default.existsSync('C:/Program Files (x86)/Microsoft Visual Studio');
const visualStudioDataPathExists = fs_1.default.existsSync('C:/ProgramData/Microsoft/VisualStudio');
if (!visualStudioInstallPathExists || !visualStudioDataPathExists) {