diff --git a/dist/cleanup/index.js b/dist/cleanup/index.js index 414de27..d693b2f 100644 --- a/dist/cleanup/index.js +++ b/dist/cleanup/index.js @@ -74118,6 +74118,7 @@ exports.generateReports = exports.setUpNativeImageBuildReports = void 0; const c = __importStar(__nccwpck_require__(9042)); const core = __importStar(__nccwpck_require__(2186)); const fs = __importStar(__nccwpck_require__(7147)); +const github = __importStar(__nccwpck_require__(5438)); const path_1 = __nccwpck_require__(1017); const os_1 = __nccwpck_require__(2037); const utils_1 = __nccwpck_require__(1314); @@ -74191,6 +74192,7 @@ function setNativeImageOption(value) { } } function createReport(data) { + const context = github.context; const info = data.general_info; const analysis = data.analysis_results; const details = data.image_details; @@ -74201,40 +74203,149 @@ function createReport(data) { debugInfoBytes; let debugInfoLine = ''; if (details.debug_info) { - debugInfoLine = `\n| [Debug info](${DOCS_BASE}#glossary-debug-info) | ${bytesToHuman(debugInfoBytes)} | ${toPercent(debugInfoBytes, details.total_bytes)} | |`; + debugInfoLine = ` + + Debug info + ${bytesToHuman(debugInfoBytes)} + ${toPercent(debugInfoBytes, details.total_bytes)} + + `; } const resources = data.resource_usage; - return `## Generated \`${info.name}\` + return `## GraalVM Native Image Build Report -using [Native Image](https://www.graalvm.org/native-image/) from ${info.graalvm_version} (${info.java_version}). +\`${info.name}\` generated as part of the '${context.job}' job in run #${context.runNumber}. + +#### Environment + + + + + + + + + + + + + + +
GraalVM version${info.graalvm_version}C compiler${info.c_compiler}
Java version${info.java_version}Garbage collector${info.garbage_collector}
#### Analysis Results -| Category | Types | in % | Fields | in % | Methods | in % | -|:---------|------:|-----:|-------:|-----:|--------:|-----:| -| [Reachable](${DOCS_BASE}#glossary-reachability) | ${analysis.classes.reachable} | ${toPercent(analysis.classes.reachable, analysis.classes.total)} | ${analysis.fields.reachable} | ${toPercent(analysis.fields.reachable, analysis.fields.total)} | ${analysis.methods.reachable} | ${toPercent(analysis.methods.reachable, analysis.methods.total)} | -| [Reflection](${DOCS_BASE}#glossary-reflection-registrations) | ${analysis.classes.reflection} | ${toPercent(analysis.classes.reflection, analysis.classes.total)} | ${analysis.fields.reflection} | ${toPercent(analysis.fields.reflection, analysis.fields.total)} | ${analysis.methods.reflection} | ${toPercent(analysis.methods.reflection, analysis.methods.total)} | -| [JNI](${DOCS_BASE}#glossary-jni-access-registrations) | ${analysis.classes.jni} | ${toPercent(analysis.classes.jni, analysis.classes.total)} | ${analysis.fields.jni} | ${toPercent(analysis.fields.jni, analysis.fields.total)} | ${analysis.methods.jni} | ${toPercent(analysis.methods.jni, analysis.methods.total)} | -| [Loaded](${DOCS_BASE}#glossary-reachability) | ${analysis.classes.total} | 100.000% | ${analysis.fields.total} | 100.000% | ${analysis.methods.total} | 100.000% | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CategoryTypesin %Fieldsin %Methodsin %
Reachable${analysis.classes.reachable}${toPercent(analysis.classes.reachable, analysis.classes.total)}${analysis.fields.reachable}${toPercent(analysis.fields.reachable, analysis.fields.total)}${analysis.methods.reachable}${toPercent(analysis.methods.reachable, analysis.methods.total)}
Reflection${analysis.classes.reflection}${toPercent(analysis.classes.reflection, analysis.classes.total)}${analysis.fields.reflection}${toPercent(analysis.fields.reflection, analysis.fields.total)}${analysis.methods.reflection}${toPercent(analysis.methods.reflection, analysis.methods.total)}
JNI${analysis.classes.jni}${toPercent(analysis.classes.jni, analysis.classes.total)}${analysis.fields.jni}${toPercent(analysis.fields.jni, analysis.fields.total)}${analysis.methods.jni}${toPercent(analysis.methods.jni, analysis.methods.total)}
Loaded${analysis.classes.total}100.000%${analysis.fields.total}100.000%${analysis.methods.total}100.000%
#### Image Details -| Category | Size | in % | Details | -|:---------|-----:|-----:|:--------| -| [Code area](${DOCS_BASE}#glossary-code-area)| ${bytesToHuman(details.code_area.bytes)} | ${toPercent(details.code_area.bytes, details.total_bytes)} | ${details.code_area.compilation_units} compilation units | -| [Image heap](${DOCS_BASE}#glossary-image-heap) | ${bytesToHuman(details.image_heap.bytes)} | ${toPercent(details.image_heap.bytes, details.total_bytes)} | ${bytesToHuman(details.image_heap.resources.bytes)} for ${details.image_heap.resources.count} resources |${debugInfoLine} -| [Other data](${DOCS_BASE}#glossary-other-data) | ${bytesToHuman(otherBytes)} | ${toPercent(otherBytes, details.total_bytes)} | | -| Total | **${bytesToHuman(details.total_bytes)}** | 100.000% | | + + + + + + + + + + + + + + + + + + + + + + ${debugInfoLine} + + + + + + + + + + + + + +
CategorySizein %Details
Code area${bytesToHuman(details.code_area.bytes)}${toPercent(details.code_area.bytes, details.total_bytes)}${details.code_area.compilation_units} compilation units
Image heap${bytesToHuman(details.image_heap.bytes)}${toPercent(details.image_heap.bytes, details.total_bytes)}${bytesToHuman(details.image_heap.resources.bytes)} for ${details.image_heap.resources.count} resources
Other data${bytesToHuman(otherBytes)}${toPercent(otherBytes, details.total_bytes)}
Total${bytesToHuman(details.total_bytes)}100.000%
#### Resource Usage -| Category | | -|:---------|:------| -| [GCs](${DOCS_BASE}#glossary-garbage-collections) | ${resources.garbage_collection.total_secs.toFixed(2)}s in ${resources.garbage_collection.count} GCs | -| [Peak RSS](${DOCS_BASE}#glossary-peak-rss) | ${bytesToHuman(resources.memory.peak_rss_bytes)} | -| [CPU load](${DOCS_BASE}#glossary-cpu-load) | ${resources.cpu.load.toFixed(3)} (${toPercent(resources.cpu.load, resources.cpu.total_cores)} of ${resources.cpu.total_cores} CPU cores) | + + + + + + + + + + + + + + + +
Garbage collection${resources.garbage_collection.total_secs.toFixed(2)}s in ${resources.garbage_collection.count} GCs
Peak RSS${bytesToHuman(resources.memory.peak_rss_bytes)} (${toPercent(resources.memory.peak_rss_bytes, resources.memory.system_total)} of ${bytesToHuman(resources.memory.system_total)} system memory)
CPU load${resources.cpu.load.toFixed(3)} (${toPercent(resources.cpu.load, resources.cpu.total_cores)} of ${resources.cpu.total_cores} CPU cores)
-_Report generated by [setup-graalvm](https://github.com/marketplace/actions/github-action-for-graalvm)._`; +Report generated by setup-graalvm.`; } function toPercent(part, total) { return `${((part / total) * 100).toFixed(3)}%`; diff --git a/dist/main/index.js b/dist/main/index.js index e8602b7..50af8ba 100644 --- a/dist/main/index.js +++ b/dist/main/index.js @@ -74220,6 +74220,7 @@ exports.generateReports = exports.setUpNativeImageBuildReports = void 0; const c = __importStar(__nccwpck_require__(9042)); const core = __importStar(__nccwpck_require__(2186)); const fs = __importStar(__nccwpck_require__(7147)); +const github = __importStar(__nccwpck_require__(5438)); const path_1 = __nccwpck_require__(1017); const os_1 = __nccwpck_require__(2037); const utils_1 = __nccwpck_require__(1314); @@ -74293,6 +74294,7 @@ function setNativeImageOption(value) { } } function createReport(data) { + const context = github.context; const info = data.general_info; const analysis = data.analysis_results; const details = data.image_details; @@ -74303,40 +74305,149 @@ function createReport(data) { debugInfoBytes; let debugInfoLine = ''; if (details.debug_info) { - debugInfoLine = `\n| [Debug info](${DOCS_BASE}#glossary-debug-info) | ${bytesToHuman(debugInfoBytes)} | ${toPercent(debugInfoBytes, details.total_bytes)} | |`; + debugInfoLine = ` + + Debug info + ${bytesToHuman(debugInfoBytes)} + ${toPercent(debugInfoBytes, details.total_bytes)} + + `; } const resources = data.resource_usage; - return `## Generated \`${info.name}\` + return `## GraalVM Native Image Build Report -using [Native Image](https://www.graalvm.org/native-image/) from ${info.graalvm_version} (${info.java_version}). +\`${info.name}\` generated as part of the '${context.job}' job in run #${context.runNumber}. + +#### Environment + + + + + + + + + + + + + + +
GraalVM version${info.graalvm_version}C compiler${info.c_compiler}
Java version${info.java_version}Garbage collector${info.garbage_collector}
#### Analysis Results -| Category | Types | in % | Fields | in % | Methods | in % | -|:---------|------:|-----:|-------:|-----:|--------:|-----:| -| [Reachable](${DOCS_BASE}#glossary-reachability) | ${analysis.classes.reachable} | ${toPercent(analysis.classes.reachable, analysis.classes.total)} | ${analysis.fields.reachable} | ${toPercent(analysis.fields.reachable, analysis.fields.total)} | ${analysis.methods.reachable} | ${toPercent(analysis.methods.reachable, analysis.methods.total)} | -| [Reflection](${DOCS_BASE}#glossary-reflection-registrations) | ${analysis.classes.reflection} | ${toPercent(analysis.classes.reflection, analysis.classes.total)} | ${analysis.fields.reflection} | ${toPercent(analysis.fields.reflection, analysis.fields.total)} | ${analysis.methods.reflection} | ${toPercent(analysis.methods.reflection, analysis.methods.total)} | -| [JNI](${DOCS_BASE}#glossary-jni-access-registrations) | ${analysis.classes.jni} | ${toPercent(analysis.classes.jni, analysis.classes.total)} | ${analysis.fields.jni} | ${toPercent(analysis.fields.jni, analysis.fields.total)} | ${analysis.methods.jni} | ${toPercent(analysis.methods.jni, analysis.methods.total)} | -| [Loaded](${DOCS_BASE}#glossary-reachability) | ${analysis.classes.total} | 100.000% | ${analysis.fields.total} | 100.000% | ${analysis.methods.total} | 100.000% | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CategoryTypesin %Fieldsin %Methodsin %
Reachable${analysis.classes.reachable}${toPercent(analysis.classes.reachable, analysis.classes.total)}${analysis.fields.reachable}${toPercent(analysis.fields.reachable, analysis.fields.total)}${analysis.methods.reachable}${toPercent(analysis.methods.reachable, analysis.methods.total)}
Reflection${analysis.classes.reflection}${toPercent(analysis.classes.reflection, analysis.classes.total)}${analysis.fields.reflection}${toPercent(analysis.fields.reflection, analysis.fields.total)}${analysis.methods.reflection}${toPercent(analysis.methods.reflection, analysis.methods.total)}
JNI${analysis.classes.jni}${toPercent(analysis.classes.jni, analysis.classes.total)}${analysis.fields.jni}${toPercent(analysis.fields.jni, analysis.fields.total)}${analysis.methods.jni}${toPercent(analysis.methods.jni, analysis.methods.total)}
Loaded${analysis.classes.total}100.000%${analysis.fields.total}100.000%${analysis.methods.total}100.000%
#### Image Details -| Category | Size | in % | Details | -|:---------|-----:|-----:|:--------| -| [Code area](${DOCS_BASE}#glossary-code-area)| ${bytesToHuman(details.code_area.bytes)} | ${toPercent(details.code_area.bytes, details.total_bytes)} | ${details.code_area.compilation_units} compilation units | -| [Image heap](${DOCS_BASE}#glossary-image-heap) | ${bytesToHuman(details.image_heap.bytes)} | ${toPercent(details.image_heap.bytes, details.total_bytes)} | ${bytesToHuman(details.image_heap.resources.bytes)} for ${details.image_heap.resources.count} resources |${debugInfoLine} -| [Other data](${DOCS_BASE}#glossary-other-data) | ${bytesToHuman(otherBytes)} | ${toPercent(otherBytes, details.total_bytes)} | | -| Total | **${bytesToHuman(details.total_bytes)}** | 100.000% | | + + + + + + + + + + + + + + + + + + + + + + ${debugInfoLine} + + + + + + + + + + + + + +
CategorySizein %Details
Code area${bytesToHuman(details.code_area.bytes)}${toPercent(details.code_area.bytes, details.total_bytes)}${details.code_area.compilation_units} compilation units
Image heap${bytesToHuman(details.image_heap.bytes)}${toPercent(details.image_heap.bytes, details.total_bytes)}${bytesToHuman(details.image_heap.resources.bytes)} for ${details.image_heap.resources.count} resources
Other data${bytesToHuman(otherBytes)}${toPercent(otherBytes, details.total_bytes)}
Total${bytesToHuman(details.total_bytes)}100.000%
#### Resource Usage -| Category | | -|:---------|:------| -| [GCs](${DOCS_BASE}#glossary-garbage-collections) | ${resources.garbage_collection.total_secs.toFixed(2)}s in ${resources.garbage_collection.count} GCs | -| [Peak RSS](${DOCS_BASE}#glossary-peak-rss) | ${bytesToHuman(resources.memory.peak_rss_bytes)} | -| [CPU load](${DOCS_BASE}#glossary-cpu-load) | ${resources.cpu.load.toFixed(3)} (${toPercent(resources.cpu.load, resources.cpu.total_cores)} of ${resources.cpu.total_cores} CPU cores) | + + + + + + + + + + + + + + + +
Garbage collection${resources.garbage_collection.total_secs.toFixed(2)}s in ${resources.garbage_collection.count} GCs
Peak RSS${bytesToHuman(resources.memory.peak_rss_bytes)} (${toPercent(resources.memory.peak_rss_bytes, resources.memory.system_total)} of ${bytesToHuman(resources.memory.system_total)} system memory)
CPU load${resources.cpu.load.toFixed(3)} (${toPercent(resources.cpu.load, resources.cpu.total_cores)} of ${resources.cpu.total_cores} CPU cores)
-_Report generated by [setup-graalvm](https://github.com/marketplace/actions/github-action-for-graalvm)._`; +Report generated by setup-graalvm.`; } function toPercent(part, total) { return `${((part / total) * 100).toFixed(3)}%`; diff --git a/src/features/reports.ts b/src/features/reports.ts index 27f48f9..23731ea 100644 --- a/src/features/reports.ts +++ b/src/features/reports.ts @@ -1,6 +1,7 @@ import * as c from '../constants' import * as core from '@actions/core' import * as fs from 'fs' +import * as github from '@actions/github' import {join} from 'path' import {tmpdir} from 'os' import {createPRComment, isPREvent, toSemVer} from '../utils' @@ -149,6 +150,7 @@ function setNativeImageOption(value: string): void { } function createReport(data: BuildOutput): string { + const context = github.context const info = data.general_info const analysis = data.analysis_results const details = data.image_details @@ -160,89 +162,204 @@ function createReport(data: BuildOutput): string { debugInfoBytes let debugInfoLine = '' if (details.debug_info) { - debugInfoLine = `\n| [Debug info](${DOCS_BASE}#glossary-debug-info) | ${bytesToHuman( - debugInfoBytes - )} | ${toPercent(debugInfoBytes, details.total_bytes)} | |` + debugInfoLine = ` + + Debug info + ${bytesToHuman(debugInfoBytes)} + ${toPercent(debugInfoBytes, details.total_bytes)} + + ` } const resources = data.resource_usage - return `## Generated \`${info.name}\` + return `## GraalVM Native Image Build Report -using [Native Image](https://www.graalvm.org/native-image/) from ${ - info.graalvm_version - } (${info.java_version}). +\`${info.name}\` generated as part of the '${ + context.job + }' job in run #${context.runNumber}. + +#### Environment + + + + + + + + + + + + + + +
GraalVM version${info.graalvm_version}C compiler${info.c_compiler}
Java version${info.java_version}Garbage collector${info.garbage_collector}
#### Analysis Results -| Category | Types | in % | Fields | in % | Methods | in % | -|:---------|------:|-----:|-------:|-----:|--------:|-----:| -| [Reachable](${DOCS_BASE}#glossary-reachability) | ${ - analysis.classes.reachable - } | ${toPercent(analysis.classes.reachable, analysis.classes.total)} | ${ - analysis.fields.reachable - } | ${toPercent(analysis.fields.reachable, analysis.fields.total)} | ${ - analysis.methods.reachable - } | ${toPercent(analysis.methods.reachable, analysis.methods.total)} | -| [Reflection](${DOCS_BASE}#glossary-reflection-registrations) | ${ - analysis.classes.reflection - } | ${toPercent(analysis.classes.reflection, analysis.classes.total)} | ${ - analysis.fields.reflection - } | ${toPercent(analysis.fields.reflection, analysis.fields.total)} | ${ - analysis.methods.reflection - } | ${toPercent(analysis.methods.reflection, analysis.methods.total)} | -| [JNI](${DOCS_BASE}#glossary-jni-access-registrations) | ${ - analysis.classes.jni - } | ${toPercent(analysis.classes.jni, analysis.classes.total)} | ${ - analysis.fields.jni - } | ${toPercent(analysis.fields.jni, analysis.fields.total)} | ${ - analysis.methods.jni - } | ${toPercent(analysis.methods.jni, analysis.methods.total)} | -| [Loaded](${DOCS_BASE}#glossary-reachability) | ${ - analysis.classes.total - } | 100.000% | ${analysis.fields.total} | 100.000% | ${ - analysis.methods.total - } | 100.000% | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CategoryTypesin %Fieldsin %Methodsin %
Reachable${analysis.classes.reachable}${toPercent( + analysis.classes.reachable, + analysis.classes.total + )}${analysis.fields.reachable}${toPercent( + analysis.fields.reachable, + analysis.fields.total + )}${analysis.methods.reachable}${toPercent( + analysis.methods.reachable, + analysis.methods.total + )}
Reflection${analysis.classes.reflection}${toPercent( + analysis.classes.reflection, + analysis.classes.total + )}${analysis.fields.reflection}${toPercent( + analysis.fields.reflection, + analysis.fields.total + )}${analysis.methods.reflection}${toPercent( + analysis.methods.reflection, + analysis.methods.total + )}
JNI${analysis.classes.jni}${toPercent( + analysis.classes.jni, + analysis.classes.total + )}${analysis.fields.jni}${toPercent( + analysis.fields.jni, + analysis.fields.total + )}${analysis.methods.jni}${toPercent( + analysis.methods.jni, + analysis.methods.total + )}
Loaded${analysis.classes.total}100.000%${analysis.fields.total}100.000%${analysis.methods.total}100.000%
#### Image Details -| Category | Size | in % | Details | -|:---------|-----:|-----:|:--------| -| [Code area](${DOCS_BASE}#glossary-code-area)| ${bytesToHuman( - details.code_area.bytes - )} | ${toPercent(details.code_area.bytes, details.total_bytes)} | ${ - details.code_area.compilation_units - } compilation units | -| [Image heap](${DOCS_BASE}#glossary-image-heap) | ${bytesToHuman( - details.image_heap.bytes - )} | ${toPercent( - details.image_heap.bytes, - details.total_bytes - )} | ${bytesToHuman(details.image_heap.resources.bytes)} for ${ - details.image_heap.resources.count - } resources |${debugInfoLine} -| [Other data](${DOCS_BASE}#glossary-other-data) | ${bytesToHuman( - otherBytes - )} | ${toPercent(otherBytes, details.total_bytes)} | | -| Total | **${bytesToHuman(details.total_bytes)}** | 100.000% | | + + + + + + + + + + + + + + + + + + + + + + ${debugInfoLine} + + + + + + + + + + + + + +
CategorySizein %Details
Code area${bytesToHuman(details.code_area.bytes)}${toPercent( + details.code_area.bytes, + details.total_bytes + )}${ + details.code_area.compilation_units + } compilation units
Image heap${bytesToHuman(details.image_heap.bytes)}${toPercent( + details.image_heap.bytes, + details.total_bytes + )}${bytesToHuman( + details.image_heap.resources.bytes + )} for ${details.image_heap.resources.count} resources
Other data${bytesToHuman(otherBytes)}${toPercent(otherBytes, details.total_bytes)}
Total${bytesToHuman( + details.total_bytes + )}100.000%
#### Resource Usage -| Category | | -|:---------|:------| -| [GCs](${DOCS_BASE}#glossary-garbage-collections) | ${resources.garbage_collection.total_secs.toFixed( - 2 - )}s in ${resources.garbage_collection.count} GCs | -| [Peak RSS](${DOCS_BASE}#glossary-peak-rss) | ${bytesToHuman( - resources.memory.peak_rss_bytes - )} | -| [CPU load](${DOCS_BASE}#glossary-cpu-load) | ${resources.cpu.load.toFixed( - 3 - )} (${toPercent(resources.cpu.load, resources.cpu.total_cores)} of ${ + + + + + + + + + + + + + + + +
Garbage collection${resources.garbage_collection.total_secs.toFixed( + 2 + )}s in ${resources.garbage_collection.count} GCs
Peak RSS${bytesToHuman( + resources.memory.peak_rss_bytes + )} (${toPercent( + resources.memory.peak_rss_bytes, + resources.memory.system_total + )} of ${bytesToHuman(resources.memory.system_total)} system memory)
CPU load${resources.cpu.load.toFixed(3)} (${toPercent( + resources.cpu.load, resources.cpu.total_cores - } CPU cores) | + )} of ${resources.cpu.total_cores} CPU cores)
-_Report generated by [setup-graalvm](https://github.com/marketplace/actions/github-action-for-graalvm)._` +Report generated by setup-graalvm.` } function toPercent(part: number, total: number): string {