diff --git a/dist/cleanup/index.js b/dist/cleanup/index.js index a23d826..a7172fe 100644 --- a/dist/cleanup/index.js +++ b/dist/cleanup/index.js @@ -74462,6 +74462,7 @@ function generateReports() { } if (arePRReportsEnabled()) { (0, utils_1.createPRComment)(report); + const prBaseReport = createPRComparison(buildOutput, prMetrics); (0, utils_1.createPRComment)(prBaseReport); } } @@ -74491,6 +74492,56 @@ function setNativeImageOption(value) { fs.writeFileSync(optionsFile, `NativeImageArgs = ${value}`); } } +function createPRComparison(dataRecent, dataBase) { + const detailsRecent = dataRecent.image_details; + const detailsBase = dataBase.image_details; + const debugInfoBytesRecent = detailsRecent.debug_info ? detailsRecent.debug_info.bytes : 0; + const otherBytesRecent = detailsRecent.total_bytes - + detailsRecent.code_area.bytes - + detailsRecent.image_heap.bytes - + debugInfoBytesRecent; + const debugInfoBytesBase = detailsBase.debug_info ? detailsBase.debug_info.bytes : 0; + const otherBytesBase = detailsBase.total_bytes - + detailsBase.code_area.bytes - + detailsBase.image_heap.bytes - + debugInfoBytesBase; + return `## GraalVM Native Image PR comparison + +#### Image Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CategoryRecent BranchBase Branch
Code area${bytesToHuman(detailsRecent.code_area.bytes)} (${toPercent(detailsRecent.code_area.bytes, detailsRecent.total_bytes)}%)${bytesToHuman(detailsBase.code_area.bytes)} (${toPercent(detailsBase.code_area.bytes, detailsBase.total_bytes)}%)
Image heap${bytesToHuman(detailsRecent.image_heap.bytes)} (${toPercent(detailsRecent.image_heap.bytes, detailsRecent.total_bytes)}%)${bytesToHuman(detailsBase.image_heap.bytes)} (${toPercent(detailsBase.image_heap.bytes, detailsBase.total_bytes)}%)
Other data${bytesToHuman(otherBytesRecent)} (${toPercent(otherBytesRecent, detailsRecent.total_bytes)}%)${bytesToHuman(otherBytesBase)} (${toPercent(otherBytesBase, detailsBase.total_bytes)}%)
Total${bytesToHuman(detailsRecent.total_bytes)} (100.000%)${bytesToHuman(detailsBase.total_bytes)} (100.000%)
+ +Report generated by setup-graalvm.`; +} function createReport(data) { const context = github.context; const info = data.general_info; diff --git a/dist/main/index.js b/dist/main/index.js index e5e9a16..c32d132 100644 --- a/dist/main/index.js +++ b/dist/main/index.js @@ -74561,6 +74561,7 @@ function generateReports() { } if (arePRReportsEnabled()) { (0, utils_1.createPRComment)(report); + const prBaseReport = createPRComparison(buildOutput, prMetrics); (0, utils_1.createPRComment)(prBaseReport); } } @@ -74590,6 +74591,56 @@ function setNativeImageOption(value) { fs.writeFileSync(optionsFile, `NativeImageArgs = ${value}`); } } +function createPRComparison(dataRecent, dataBase) { + const detailsRecent = dataRecent.image_details; + const detailsBase = dataBase.image_details; + const debugInfoBytesRecent = detailsRecent.debug_info ? detailsRecent.debug_info.bytes : 0; + const otherBytesRecent = detailsRecent.total_bytes - + detailsRecent.code_area.bytes - + detailsRecent.image_heap.bytes - + debugInfoBytesRecent; + const debugInfoBytesBase = detailsBase.debug_info ? detailsBase.debug_info.bytes : 0; + const otherBytesBase = detailsBase.total_bytes - + detailsBase.code_area.bytes - + detailsBase.image_heap.bytes - + debugInfoBytesBase; + return `## GraalVM Native Image PR comparison + +#### Image Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CategoryRecent BranchBase Branch
Code area${bytesToHuman(detailsRecent.code_area.bytes)} (${toPercent(detailsRecent.code_area.bytes, detailsRecent.total_bytes)}%)${bytesToHuman(detailsBase.code_area.bytes)} (${toPercent(detailsBase.code_area.bytes, detailsBase.total_bytes)}%)
Image heap${bytesToHuman(detailsRecent.image_heap.bytes)} (${toPercent(detailsRecent.image_heap.bytes, detailsRecent.total_bytes)}%)${bytesToHuman(detailsBase.image_heap.bytes)} (${toPercent(detailsBase.image_heap.bytes, detailsBase.total_bytes)}%)
Other data${bytesToHuman(otherBytesRecent)} (${toPercent(otherBytesRecent, detailsRecent.total_bytes)}%)${bytesToHuman(otherBytesBase)} (${toPercent(otherBytesBase, detailsBase.total_bytes)}%)
Total${bytesToHuman(detailsRecent.total_bytes)} (100.000%)${bytesToHuman(detailsBase.total_bytes)} (100.000%)
+ +Report generated by setup-graalvm.`; +} function createReport(data) { const context = github.context; const info = data.general_info; diff --git a/src/features/reports.ts b/src/features/reports.ts index 6097adc..5714d20 100644 --- a/src/features/reports.ts +++ b/src/features/reports.ts @@ -148,6 +148,7 @@ export async function generateReports(): Promise { } if (arePRReportsEnabled()) { createPRComment(report) + const prBaseReport = createPRComparison(buildOutput, prMetrics) createPRComment(prBaseReport) } } @@ -179,6 +180,61 @@ function setNativeImageOption(value: string): void { } } +function createPRComparison(dataRecent: BuildOutput, dataBase: BuildOutput): string { + const detailsRecent = dataRecent.image_details + const detailsBase = dataBase.image_details + const debugInfoBytesRecent = detailsRecent.debug_info ? detailsRecent.debug_info.bytes : 0 + const otherBytesRecent = + detailsRecent.total_bytes - + detailsRecent.code_area.bytes - + detailsRecent.image_heap.bytes - + debugInfoBytesRecent + + const debugInfoBytesBase = detailsBase.debug_info ? detailsBase.debug_info.bytes : 0 + const otherBytesBase = + detailsBase.total_bytes - + detailsBase.code_area.bytes - + detailsBase.image_heap.bytes - + debugInfoBytesBase + + return `## GraalVM Native Image PR comparison + +#### Image Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CategoryRecent BranchBase Branch
Code area${bytesToHuman(detailsRecent.code_area.bytes)} (${toPercent(detailsRecent.code_area.bytes, detailsRecent.total_bytes)}%)${bytesToHuman(detailsBase.code_area.bytes)} (${toPercent(detailsBase.code_area.bytes, detailsBase.total_bytes)}%)
Image heap${bytesToHuman(detailsRecent.image_heap.bytes)} (${toPercent(detailsRecent.image_heap.bytes, detailsRecent.total_bytes)}%)${bytesToHuman(detailsBase.image_heap.bytes)} (${toPercent(detailsBase.image_heap.bytes, detailsBase.total_bytes)}%)
Other data${bytesToHuman(otherBytesRecent)} (${toPercent(otherBytesRecent, detailsRecent.total_bytes)}%)${bytesToHuman(otherBytesBase)} (${toPercent(otherBytesBase, detailsBase.total_bytes)}%)
Total${bytesToHuman(detailsRecent.total_bytes)} (100.000%)${bytesToHuman(detailsBase.total_bytes)} (100.000%)
+ +Report generated by setup-graalvm.` +} + function createReport(data: BuildOutput): string { const context = github.context const info = data.general_info @@ -438,6 +494,7 @@ function createReport(data: BuildOutput): string { Report generated by setup-graalvm.` } + function toPercent(part: number, total: number): string { return `${((part / total) * 100).toFixed(3)}%` }