Build outputs

This commit is contained in:
Daz DeBoer 2022-06-06 11:53:30 -06:00
parent 8096e65e0a
commit de51428ba5
No known key found for this signature in database
GPG key ID: DD6B9F0B06683D5D
4 changed files with 46 additions and 14 deletions

26
dist/main/index.js vendored
View file

@ -65528,6 +65528,7 @@ exports.tryDelete = exports.handleCacheFailure = exports.cacheDebug = exports.sa
const core = __importStar(__nccwpck_require__(2186));
const cache = __importStar(__nccwpck_require__(7799));
const github = __importStar(__nccwpck_require__(5438));
const exec = __importStar(__nccwpck_require__(1514));
const crypto = __importStar(__nccwpck_require__(6113));
const path = __importStar(__nccwpck_require__(1017));
const fs = __importStar(__nccwpck_require__(7147));
@ -65639,7 +65640,7 @@ function saveCache(cachePath, cacheKey, listener) {
if (error instanceof cache.ReserveCacheError) {
listener.markAlreadyExists(cacheKey);
}
handleCacheFailure(error, `Failed to save cache entry ${cacheKey}`);
handleCacheFailure(error, `Failed to save cache entry with path '${cachePath}' and key: ${cacheKey}`);
}
});
}
@ -65670,8 +65671,9 @@ function handleCacheFailure(error, message) {
exports.handleCacheFailure = handleCacheFailure;
function tryDelete(file) {
return __awaiter(this, void 0, void 0, function* () {
const maxAttempts = 5;
const stat = fs.lstatSync(file);
for (let count = 0; count < 3; count++) {
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
try {
if (stat.isDirectory()) {
fs.rmdirSync(file, { recursive: true });
@ -65682,11 +65684,14 @@ function tryDelete(file) {
return;
}
catch (error) {
if (count === 2) {
if (attempt === maxAttempts) {
core.warning(`Failed to delete ${file}, which will impact caching.
It is likely locked by another process. Output of 'jps -ml':
${yield getJavaProcesses()}`);
throw error;
}
else {
core.warning(String(error));
cacheDebug(`Attempt to delete ${file} failed. Will try again.`);
yield delay(1000);
}
}
@ -65699,6 +65704,12 @@ function delay(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
});
}
function getJavaProcesses() {
return __awaiter(this, void 0, void 0, function* () {
const jpsOutput = yield exec.getExecOutput('jps', ['-lm']);
return jpsOutput.stdout;
});
}
/***/ }),
@ -66381,6 +66392,10 @@ const job_summary_1 = __nccwpck_require__(7345);
const GRADLE_SETUP_VAR = 'GRADLE_BUILD_ACTION_SETUP_COMPLETED';
const GRADLE_USER_HOME = 'GRADLE_USER_HOME';
const CACHE_LISTENER = 'CACHE_LISTENER';
const JOB_SUMMARY_ENABLED_PARAMETER = 'generate-job-summary';
function shouldGenerateJobSummary() {
return core.getBooleanInput(JOB_SUMMARY_ENABLED_PARAMETER);
}
function setup(buildRootDirectory) {
return __awaiter(this, void 0, void 0, function* () {
const gradleUserHome = yield determineGradleUserHome(buildRootDirectory);
@ -66399,7 +66414,6 @@ function setup(buildRootDirectory) {
exports.setup = setup;
function complete() {
return __awaiter(this, void 0, void 0, function* () {
core.info('Inside setupGradle.complete()');
if (!core.getState(GRADLE_SETUP_VAR)) {
core.info('Gradle setup post-action only performed for first gradle-build-action step in workflow.');
return;
@ -66411,7 +66425,9 @@ function complete() {
const cacheListener = cache_reporting_1.CacheListener.rehydrate(core.getState(CACHE_LISTENER));
const gradleUserHome = core.getState(GRADLE_USER_HOME);
yield caches.save(gradleUserHome, cacheListener);
if (shouldGenerateJobSummary()) {
(0, job_summary_1.writeJobSummary)(buildResults, cacheListener);
}
});
}
exports.complete = complete;

File diff suppressed because one or more lines are too long

26
dist/post/index.js vendored
View file

@ -64579,6 +64579,7 @@ exports.tryDelete = exports.handleCacheFailure = exports.cacheDebug = exports.sa
const core = __importStar(__nccwpck_require__(2186));
const cache = __importStar(__nccwpck_require__(7799));
const github = __importStar(__nccwpck_require__(5438));
const exec = __importStar(__nccwpck_require__(1514));
const crypto = __importStar(__nccwpck_require__(6113));
const path = __importStar(__nccwpck_require__(1017));
const fs = __importStar(__nccwpck_require__(7147));
@ -64690,7 +64691,7 @@ function saveCache(cachePath, cacheKey, listener) {
if (error instanceof cache.ReserveCacheError) {
listener.markAlreadyExists(cacheKey);
}
handleCacheFailure(error, `Failed to save cache entry ${cacheKey}`);
handleCacheFailure(error, `Failed to save cache entry with path '${cachePath}' and key: ${cacheKey}`);
}
});
}
@ -64721,8 +64722,9 @@ function handleCacheFailure(error, message) {
exports.handleCacheFailure = handleCacheFailure;
function tryDelete(file) {
return __awaiter(this, void 0, void 0, function* () {
const maxAttempts = 5;
const stat = fs.lstatSync(file);
for (let count = 0; count < 3; count++) {
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
try {
if (stat.isDirectory()) {
fs.rmdirSync(file, { recursive: true });
@ -64733,11 +64735,14 @@ function tryDelete(file) {
return;
}
catch (error) {
if (count === 2) {
if (attempt === maxAttempts) {
core.warning(`Failed to delete ${file}, which will impact caching.
It is likely locked by another process. Output of 'jps -ml':
${yield getJavaProcesses()}`);
throw error;
}
else {
core.warning(String(error));
cacheDebug(`Attempt to delete ${file} failed. Will try again.`);
yield delay(1000);
}
}
@ -64750,6 +64755,12 @@ function delay(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
});
}
function getJavaProcesses() {
return __awaiter(this, void 0, void 0, function* () {
const jpsOutput = yield exec.getExecOutput('jps', ['-lm']);
return jpsOutput.stdout;
});
}
/***/ }),
@ -65065,6 +65076,10 @@ const job_summary_1 = __nccwpck_require__(7345);
const GRADLE_SETUP_VAR = 'GRADLE_BUILD_ACTION_SETUP_COMPLETED';
const GRADLE_USER_HOME = 'GRADLE_USER_HOME';
const CACHE_LISTENER = 'CACHE_LISTENER';
const JOB_SUMMARY_ENABLED_PARAMETER = 'generate-job-summary';
function shouldGenerateJobSummary() {
return core.getBooleanInput(JOB_SUMMARY_ENABLED_PARAMETER);
}
function setup(buildRootDirectory) {
return __awaiter(this, void 0, void 0, function* () {
const gradleUserHome = yield determineGradleUserHome(buildRootDirectory);
@ -65083,7 +65098,6 @@ function setup(buildRootDirectory) {
exports.setup = setup;
function complete() {
return __awaiter(this, void 0, void 0, function* () {
core.info('Inside setupGradle.complete()');
if (!core.getState(GRADLE_SETUP_VAR)) {
core.info('Gradle setup post-action only performed for first gradle-build-action step in workflow.');
return;
@ -65095,7 +65109,9 @@ function complete() {
const cacheListener = cache_reporting_1.CacheListener.rehydrate(core.getState(CACHE_LISTENER));
const gradleUserHome = core.getState(GRADLE_USER_HOME);
yield caches.save(gradleUserHome, cacheListener);
if (shouldGenerateJobSummary()) {
(0, job_summary_1.writeJobSummary)(buildResults, cacheListener);
}
});
}
exports.complete = complete;

File diff suppressed because one or more lines are too long