Improve debug logging

pull/310/head
Frostebite 2022-01-08 01:46:44 +00:00
parent 27964367da
commit 6145d05ea5
4 changed files with 33 additions and 11 deletions

21
dist/index.js vendored
View File

@ -591,7 +591,6 @@ class Caching {
console_1.assert(`${fs_1.default.existsSync(destinationFolder)}`); console_1.assert(`${fs_1.default.existsSync(destinationFolder)}`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`unzip -q ${cacheSelection}.zip -d ${path_1.default.basename(destinationFolder)}`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`unzip -q ${cacheSelection}.zip -d ${path_1.default.basename(destinationFolder)}`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`mv ${path_1.default.basename(destinationFolder)}/* ${destinationFolder}`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`mv ${path_1.default.basename(destinationFolder)}/* ${destinationFolder}`);
console_1.assert(fs_1.default.existsSync(`${path_1.default.join(destinationFolder, `${cacheSelection}.zip`)}`));
} }
else { else {
remote_client_logger_1.RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`); remote_client_logger_1.RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`);
@ -820,15 +819,31 @@ class SetupCloudRunnerRepository {
try { try {
yield cloud_runner_system_1.CloudRunnerSystem.Run(`mkdir -p ${cloud_runner_state_1.CloudRunnerState.buildPathFull}`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`mkdir -p ${cloud_runner_state_1.CloudRunnerState.buildPathFull}`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`mkdir -p ${cloud_runner_state_1.CloudRunnerState.repoPathFull}`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`mkdir -p ${cloud_runner_state_1.CloudRunnerState.repoPathFull}`);
if (__1.Input.cloudRunnerTests) {
yield cloud_runner_system_1.CloudRunnerSystem.Run(`ls -lh`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`tree`);
}
yield SetupCloudRunnerRepository.cloneRepoWithoutLFSFiles(); yield SetupCloudRunnerRepository.cloneRepoWithoutLFSFiles();
if (__1.Input.cloudRunnerTests) {
yield cloud_runner_system_1.CloudRunnerSystem.Run(`ls -lh`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`tree`);
}
const lfsHashes = yield lfs_hashing_1.LFSHashing.createLFSHashFiles(); const lfsHashes = yield lfs_hashing_1.LFSHashing.createLFSHashFiles();
if (fs_1.default.existsSync(cloud_runner_state_1.CloudRunnerState.libraryFolderFull)) { if (fs_1.default.existsSync(cloud_runner_state_1.CloudRunnerState.libraryFolderFull)) {
remote_client_logger_1.RemoteClientLogger.logWarning(`!Warning!: The Unity library was included in the git repository`); remote_client_logger_1.RemoteClientLogger.logWarning(`!Warning!: The Unity library was included in the git repository`);
} }
yield caching_1.Caching.PullFromCache(cloud_runner_state_1.CloudRunnerState.lfsCacheFolderFull, cloud_runner_state_1.CloudRunnerState.lfsDirectoryFull, `${lfsHashes.lfsGuid}`); yield caching_1.Caching.PullFromCache(cloud_runner_state_1.CloudRunnerState.lfsCacheFolderFull, cloud_runner_state_1.CloudRunnerState.lfsDirectoryFull, `${lfsHashes.lfsGuid}`);
if (__1.Input.cloudRunnerTests) {
yield cloud_runner_system_1.CloudRunnerSystem.Run(`ls -lh`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`tree`);
}
yield SetupCloudRunnerRepository.pullLatestLFS(); yield SetupCloudRunnerRepository.pullLatestLFS();
yield caching_1.Caching.PushToCache(cloud_runner_state_1.CloudRunnerState.lfsCacheFolderFull, cloud_runner_state_1.CloudRunnerState.lfsDirectoryFull, `${lfsHashes.lfsGuid}`); yield caching_1.Caching.PushToCache(cloud_runner_state_1.CloudRunnerState.lfsCacheFolderFull, cloud_runner_state_1.CloudRunnerState.lfsDirectoryFull, `${lfsHashes.lfsGuid}`);
yield caching_1.Caching.PullFromCache(cloud_runner_state_1.CloudRunnerState.libraryCacheFolderFull, cloud_runner_state_1.CloudRunnerState.libraryFolderFull); yield caching_1.Caching.PullFromCache(cloud_runner_state_1.CloudRunnerState.libraryCacheFolderFull, cloud_runner_state_1.CloudRunnerState.libraryFolderFull);
if (__1.Input.cloudRunnerTests) {
yield cloud_runner_system_1.CloudRunnerSystem.Run(`ls -lh`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`tree`);
}
caching_1.Caching.handleCachePurging(); caching_1.Caching.handleCachePurging();
} }
catch (error) { catch (error) {
@ -846,10 +861,6 @@ class SetupCloudRunnerRepository {
yield cloud_runner_system_1.CloudRunnerSystem.Run(`git lfs install --skip-smudge`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`git lfs install --skip-smudge`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`git clone ${cloud_runner_state_1.CloudRunnerState.targetBuildRepoUrl} ./../${path_1.default.basename(cloud_runner_state_1.CloudRunnerState.repoPathFull)}`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`git clone ${cloud_runner_state_1.CloudRunnerState.targetBuildRepoUrl} ./../${path_1.default.basename(cloud_runner_state_1.CloudRunnerState.repoPathFull)}`);
console_1.assert(fs_1.default.existsSync(`.git`)); console_1.assert(fs_1.default.existsSync(`.git`));
if (__1.Input.cloudRunnerTests) {
yield cloud_runner_system_1.CloudRunnerSystem.Run(`ls -lh`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`tree`);
}
remote_client_logger_1.RemoteClientLogger.log(`${cloud_runner_state_1.CloudRunnerState.buildParams.branch}`); remote_client_logger_1.RemoteClientLogger.log(`${cloud_runner_state_1.CloudRunnerState.buildParams.branch}`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`git checkout ${cloud_runner_state_1.CloudRunnerState.buildParams.branch}`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`git checkout ${cloud_runner_state_1.CloudRunnerState.buildParams.branch}`);
remote_client_logger_1.RemoteClientLogger.log(`Checked out ${process.env.GITHUB_SHA}`); remote_client_logger_1.RemoteClientLogger.log(`Checked out ${process.env.GITHUB_SHA}`);

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -82,7 +82,6 @@ export class Caching {
assert(`${fs.existsSync(destinationFolder)}`); assert(`${fs.existsSync(destinationFolder)}`);
await CloudRunnerSystem.Run(`unzip -q ${cacheSelection}.zip -d ${path.basename(destinationFolder)}`); await CloudRunnerSystem.Run(`unzip -q ${cacheSelection}.zip -d ${path.basename(destinationFolder)}`);
await CloudRunnerSystem.Run(`mv ${path.basename(destinationFolder)}/* ${destinationFolder}`); await CloudRunnerSystem.Run(`mv ${path.basename(destinationFolder)}/* ${destinationFolder}`);
assert(fs.existsSync(`${path.join(destinationFolder, `${cacheSelection}.zip`)}`));
} else { } else {
RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`); RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`);
if (cacheSelection !== ``) { if (cacheSelection !== ``) {

View File

@ -13,7 +13,15 @@ export class SetupCloudRunnerRepository {
try { try {
await CloudRunnerSystem.Run(`mkdir -p ${CloudRunnerState.buildPathFull}`); await CloudRunnerSystem.Run(`mkdir -p ${CloudRunnerState.buildPathFull}`);
await CloudRunnerSystem.Run(`mkdir -p ${CloudRunnerState.repoPathFull}`); await CloudRunnerSystem.Run(`mkdir -p ${CloudRunnerState.repoPathFull}`);
if (Input.cloudRunnerTests) {
await CloudRunnerSystem.Run(`ls -lh`);
await CloudRunnerSystem.Run(`tree`);
}
await SetupCloudRunnerRepository.cloneRepoWithoutLFSFiles(); await SetupCloudRunnerRepository.cloneRepoWithoutLFSFiles();
if (Input.cloudRunnerTests) {
await CloudRunnerSystem.Run(`ls -lh`);
await CloudRunnerSystem.Run(`tree`);
}
const lfsHashes = await LFSHashing.createLFSHashFiles(); const lfsHashes = await LFSHashing.createLFSHashFiles();
if (fs.existsSync(CloudRunnerState.libraryFolderFull)) { if (fs.existsSync(CloudRunnerState.libraryFolderFull)) {
RemoteClientLogger.logWarning(`!Warning!: The Unity library was included in the git repository`); RemoteClientLogger.logWarning(`!Warning!: The Unity library was included in the git repository`);
@ -23,6 +31,10 @@ export class SetupCloudRunnerRepository {
CloudRunnerState.lfsDirectoryFull, CloudRunnerState.lfsDirectoryFull,
`${lfsHashes.lfsGuid}`, `${lfsHashes.lfsGuid}`,
); );
if (Input.cloudRunnerTests) {
await CloudRunnerSystem.Run(`ls -lh`);
await CloudRunnerSystem.Run(`tree`);
}
await SetupCloudRunnerRepository.pullLatestLFS(); await SetupCloudRunnerRepository.pullLatestLFS();
await Caching.PushToCache( await Caching.PushToCache(
CloudRunnerState.lfsCacheFolderFull, CloudRunnerState.lfsCacheFolderFull,
@ -30,6 +42,10 @@ export class SetupCloudRunnerRepository {
`${lfsHashes.lfsGuid}`, `${lfsHashes.lfsGuid}`,
); );
await Caching.PullFromCache(CloudRunnerState.libraryCacheFolderFull, CloudRunnerState.libraryFolderFull); await Caching.PullFromCache(CloudRunnerState.libraryCacheFolderFull, CloudRunnerState.libraryFolderFull);
if (Input.cloudRunnerTests) {
await CloudRunnerSystem.Run(`ls -lh`);
await CloudRunnerSystem.Run(`tree`);
}
Caching.handleCachePurging(); Caching.handleCachePurging();
} catch (error) { } catch (error) {
@ -48,10 +64,6 @@ export class SetupCloudRunnerRepository {
`git clone ${CloudRunnerState.targetBuildRepoUrl} ./../${path.basename(CloudRunnerState.repoPathFull)}`, `git clone ${CloudRunnerState.targetBuildRepoUrl} ./../${path.basename(CloudRunnerState.repoPathFull)}`,
); );
assert(fs.existsSync(`.git`)); assert(fs.existsSync(`.git`));
if (Input.cloudRunnerTests) {
await CloudRunnerSystem.Run(`ls -lh`);
await CloudRunnerSystem.Run(`tree`);
}
RemoteClientLogger.log(`${CloudRunnerState.buildParams.branch}`); RemoteClientLogger.log(`${CloudRunnerState.buildParams.branch}`);
await CloudRunnerSystem.Run(`git checkout ${CloudRunnerState.buildParams.branch}`); await CloudRunnerSystem.Run(`git checkout ${CloudRunnerState.buildParams.branch}`);
RemoteClientLogger.log(`Checked out ${process.env.GITHUB_SHA}`); RemoteClientLogger.log(`Checked out ${process.env.GITHUB_SHA}`);