Skip to content

Commit

Permalink
Build outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
bigdaz committed Feb 12, 2024
1 parent 9eb8242 commit b6ea7d5
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 8 deletions.
24 changes: 21 additions & 3 deletions dist/setup-gradle/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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]) {
Expand Down
2 changes: 1 addition & 1 deletion dist/setup-gradle/main/index.js.map

Large diffs are not rendered by default.

24 changes: 21 additions & 3 deletions dist/setup-gradle/post/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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]) {
Expand Down
2 changes: 1 addition & 1 deletion dist/setup-gradle/post/index.js.map

Large diffs are not rendered by default.

0 comments on commit b6ea7d5

Please sign in to comment.