Build outputs

This commit is contained in:
daz 2024-02-11 17:35:43 -07:00
parent 9eb8242410
commit b6ea7d5b78
No known key found for this signature in database
4 changed files with 44 additions and 8 deletions

View File

@ -139144,6 +139144,9 @@ class GradleStateCache {
fs_1.default.mkdirSync(actionCacheDir, { recursive: true });
this.copyInitScripts();
this.registerToolchains();
if (core.isDebug()) {
this.configureInfoLogLevel();
}
}
copyInitScripts() {
const initScriptsDir = path_1.default.resolve(this.gradleUserHome, 'init.d');
@ -139182,9 +139185,22 @@ class GradleStateCache {
const absolutePath = path_1.default.resolve(__dirname, '..', '..', '..', 'sources', 'src', 'resources', ...paths);
return fs_1.default.readFileSync(absolutePath, 'utf8');
}
configureInfoLogLevel() {
const infoProperties = `org.gradle.logging.level=info\norg.gradle.logging.stacktrace=all\n`;
const propertiesFile = path_1.default.resolve(this.gradleUserHome, 'gradle.properties');
if (fs_1.default.existsSync(propertiesFile)) {
core.info(`Merged --info and --stacktrace into existing ${propertiesFile} file`);
const existingProperties = fs_1.default.readFileSync(propertiesFile, 'utf-8');
fs_1.default.writeFileSync(propertiesFile, `${infoProperties}\n${existingProperties}`);
}
else {
core.info(`Created a new ${propertiesFile} with --info and --stacktrace`);
fs_1.default.writeFileSync(propertiesFile, infoProperties);
}
}
debugReportGradleUserHomeSize(label) {
return __awaiter(this, void 0, void 0, function* () {
if (!(0, cache_utils_1.isCacheDebuggingEnabled)()) {
if (!(0, cache_utils_1.isCacheDebuggingEnabled)() && !core.isDebug()) {
return;
}
if (!fs_1.default.existsSync(this.gradleUserHome)) {
@ -141041,7 +141057,9 @@ function addPRComment(jobSummary) {
const pull_request_number = context.payload.pull_request.number;
core.info(`Adding Job Summary as comment to PR #${pull_request_number}.`);
const prComment = `<h3>Job Summary for Gradle</h3>
<h5>${github.context.workflow} :: <em>${github.context.job}</em></h5>
<a href="${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}" target="_blank">
<h5>${context.workflow} :: <em>${context.job}</em></h5>
</a>
${jobSummary}`;
const github_token = params.getGithubToken();
@ -141110,7 +141128,7 @@ function renderBuildScan(result) {
function renderBuildScanBadge(outcomeText, outcomeColor, targetUrl) {
const badgeUrl = `https://img.shields.io/badge/Build%20Scan%C2%AE-${outcomeText}-${outcomeColor}?logo=Gradle`;
const badgeHtml = `<img src="${badgeUrl}" alt="Build Scan ${outcomeText}" />`;
return `<a href="${targetUrl}" rel="nofollow">${badgeHtml}</a>`;
return `<a href="${targetUrl}" rel="nofollow" target="_blank">${badgeHtml}</a>`;
}
function shouldGenerateJobSummary(buildResults) {
if (!process.env[summary_1.SUMMARY_ENV_VAR]) {

File diff suppressed because one or more lines are too long

View File

@ -136597,6 +136597,9 @@ class GradleStateCache {
fs_1.default.mkdirSync(actionCacheDir, { recursive: true });
this.copyInitScripts();
this.registerToolchains();
if (core.isDebug()) {
this.configureInfoLogLevel();
}
}
copyInitScripts() {
const initScriptsDir = path_1.default.resolve(this.gradleUserHome, 'init.d');
@ -136635,9 +136638,22 @@ class GradleStateCache {
const absolutePath = path_1.default.resolve(__dirname, '..', '..', '..', 'sources', 'src', 'resources', ...paths);
return fs_1.default.readFileSync(absolutePath, 'utf8');
}
configureInfoLogLevel() {
const infoProperties = `org.gradle.logging.level=info\norg.gradle.logging.stacktrace=all\n`;
const propertiesFile = path_1.default.resolve(this.gradleUserHome, 'gradle.properties');
if (fs_1.default.existsSync(propertiesFile)) {
core.info(`Merged --info and --stacktrace into existing ${propertiesFile} file`);
const existingProperties = fs_1.default.readFileSync(propertiesFile, 'utf-8');
fs_1.default.writeFileSync(propertiesFile, `${infoProperties}\n${existingProperties}`);
}
else {
core.info(`Created a new ${propertiesFile} with --info and --stacktrace`);
fs_1.default.writeFileSync(propertiesFile, infoProperties);
}
}
debugReportGradleUserHomeSize(label) {
return __awaiter(this, void 0, void 0, function* () {
if (!(0, cache_utils_1.isCacheDebuggingEnabled)()) {
if (!(0, cache_utils_1.isCacheDebuggingEnabled)() && !core.isDebug()) {
return;
}
if (!fs_1.default.existsSync(this.gradleUserHome)) {
@ -138360,7 +138376,9 @@ function addPRComment(jobSummary) {
const pull_request_number = context.payload.pull_request.number;
core.info(`Adding Job Summary as comment to PR #${pull_request_number}.`);
const prComment = `<h3>Job Summary for Gradle</h3>
<h5>${github.context.workflow} :: <em>${github.context.job}</em></h5>
<a href="${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}" target="_blank">
<h5>${context.workflow} :: <em>${context.job}</em></h5>
</a>
${jobSummary}`;
const github_token = params.getGithubToken();
@ -138429,7 +138447,7 @@ function renderBuildScan(result) {
function renderBuildScanBadge(outcomeText, outcomeColor, targetUrl) {
const badgeUrl = `https://img.shields.io/badge/Build%20Scan%C2%AE-${outcomeText}-${outcomeColor}?logo=Gradle`;
const badgeHtml = `<img src="${badgeUrl}" alt="Build Scan ${outcomeText}" />`;
return `<a href="${targetUrl}" rel="nofollow">${badgeHtml}</a>`;
return `<a href="${targetUrl}" rel="nofollow" target="_blank">${badgeHtml}</a>`;
}
function shouldGenerateJobSummary(buildResults) {
if (!process.env[summary_1.SUMMARY_ENV_VAR]) {

File diff suppressed because one or more lines are too long