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)}`);
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}`);
console_1.assert(fs_1.default.existsSync(`${path_1.default.join(destinationFolder, `${cacheSelection}.zip`)}`));
}
else {
remote_client_logger_1.RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`);
@ -820,15 +819,31 @@ class SetupCloudRunnerRepository {
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.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();
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();
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`);
}
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 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);
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();
}
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 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`));
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}`);
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}`);

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)}`);
await CloudRunnerSystem.Run(`unzip -q ${cacheSelection}.zip -d ${path.basename(destinationFolder)}`);
await CloudRunnerSystem.Run(`mv ${path.basename(destinationFolder)}/* ${destinationFolder}`);
assert(fs.existsSync(`${path.join(destinationFolder, `${cacheSelection}.zip`)}`));
} else {
RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`);
if (cacheSelection !== ``) {

View File

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