diff --git a/dist/cleanup/index.js b/dist/cleanup/index.js index bb6f45c..d404ee7 100644 --- a/dist/cleanup/index.js +++ b/dist/cleanup/index.js @@ -74451,7 +74451,7 @@ function generateReports() { return; } const buildOutput = JSON.parse(fs.readFileSync(BUILD_OUTPUT_JSON_PATH, 'utf8')); - yield (0, utils_1.saveReportJson)(JSON.stringify(buildOutput)); + (0, utils_1.saveReportJson)(JSON.stringify(buildOutput)); const report = createReport(buildOutput); if (areJobReportsEnabled()) { core.summary.addRaw(report); diff --git a/dist/main/index.js b/dist/main/index.js index 702b72d..6a0b0b6 100644 --- a/dist/main/index.js +++ b/dist/main/index.js @@ -74550,7 +74550,7 @@ function generateReports() { return; } const buildOutput = JSON.parse(fs.readFileSync(BUILD_OUTPUT_JSON_PATH, 'utf8')); - yield (0, utils_1.saveReportJson)(JSON.stringify(buildOutput)); + (0, utils_1.saveReportJson)(JSON.stringify(buildOutput)); const report = createReport(buildOutput); if (areJobReportsEnabled()) { core.summary.addRaw(report); diff --git a/src/features/reports.ts b/src/features/reports.ts index aa8c242..8ce4b8e 100644 --- a/src/features/reports.ts +++ b/src/features/reports.ts @@ -15,12 +15,12 @@ const BYTES_TO_KiB = 1024 const BYTES_TO_MiB = 1024 * 1024 const BYTES_TO_GiB = 1024 * 1024 * 1024 const DOCS_BASE = - 'https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/BuildOutput.md' + 'https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/BuildOutput.md' const INPUT_NI_JOB_REPORTS = 'native-image-job-reports' const INPUT_NI_PR_REPORTS = 'native-image-pr-reports' const NATIVE_IMAGE_CONFIG_FILE = join( - tmpdir(), - 'native-image-options.properties' + tmpdir(), + 'native-image-options.properties' ) const NATIVE_IMAGE_CONFIG_FILE_ENV = 'NATIVE_IMAGE_CONFIG_FILE' //const { Octokit } = require("@octokit/rest"); @@ -96,28 +96,28 @@ interface BuildOutput { } export async function setUpNativeImageBuildReports( - isGraalVMforJDK17OrLater: boolean, - graalVMVersion: string, - reportToken: string + isGraalVMforJDK17OrLater: boolean, + graalVMVersion: string, + reportToken: string ): Promise { const isRequired = areJobReportsEnabled() || arePRReportsEnabled() if (!isRequired) { return } const isSupported = - isGraalVMforJDK17OrLater || - graalVMVersion === c.VERSION_LATEST || - graalVMVersion === c.VERSION_DEV || - (!graalVMVersion.startsWith(c.MANDREL_NAMESPACE) && - gte(toSemVer(graalVMVersion), '22.2.0')) + isGraalVMforJDK17OrLater || + graalVMVersion === c.VERSION_LATEST || + graalVMVersion === c.VERSION_DEV || + (!graalVMVersion.startsWith(c.MANDREL_NAMESPACE) && + gte(toSemVer(graalVMVersion), '22.2.0')) if (!isSupported) { core.warning( - `Build reports for PRs and job summaries are only available in GraalVM 22.2.0 or later. This build job uses GraalVM ${graalVMVersion}.` + `Build reports for PRs and job summaries are only available in GraalVM 22.2.0 or later. This build job uses GraalVM ${graalVMVersion}.` ) return } setNativeImageOption( - `-H:BuildOutputJSONFile=${BUILD_OUTPUT_JSON_PATH.replace(/\\/g, '\\\\')}` + `-H:BuildOutputJSONFile=${BUILD_OUTPUT_JSON_PATH.replace(/\\/g, '\\\\')}` )// Escape backslashes for Windows REPORT_TOKEN = reportToken } @@ -126,15 +126,15 @@ export async function generateReports(): Promise { if (areJobReportsEnabled() || arePRReportsEnabled()) { if (!fs.existsSync(BUILD_OUTPUT_JSON_PATH)) { core.warning( - 'Unable to find build output data to create a report. Are you sure this build job has used GraalVM Native Image?' + 'Unable to find build output data to create a report. Are you sure this build job has used GraalVM Native Image?' ) return } const buildOutput: BuildOutput = JSON.parse( - fs.readFileSync(BUILD_OUTPUT_JSON_PATH, 'utf8') + fs.readFileSync(BUILD_OUTPUT_JSON_PATH, 'utf8') ) - await saveReportJson(JSON.stringify(buildOutput)) + saveReportJson(JSON.stringify(buildOutput)) const report = createReport(buildOutput) if (areJobReportsEnabled()) { @@ -185,10 +185,10 @@ function createReport(data: BuildOutput): string { } const debugInfoBytes = details.debug_info ? details.debug_info.bytes : 0 const otherBytes = - details.total_bytes - - details.code_area.bytes - - details.image_heap.bytes - - debugInfoBytes + details.total_bytes - + details.code_area.bytes - + details.image_heap.bytes - + debugInfoBytes let debugInfoLine = '' if (details.debug_info) { debugInfoLine = ` @@ -221,7 +221,7 @@ function createReport(data: BuildOutput): string { if (info.graal_compiler) { let pgoSuffix = '' const isOracleGraalVM = - info.vendor_version && info.vendor_version.includes('Oracle GraalVM') + info.vendor_version && info.vendor_version.includes('Oracle GraalVM') if (isOracleGraalVM) { const pgo = info.graal_compiler.pgo const pgoText = pgo ? pgo.join('+') : 'off' @@ -244,17 +244,17 @@ function createReport(data: BuildOutput): string { if (resources.total_secs) { totalTime = ` in ${secondsToHuman(resources.total_secs)}` gcTotalTimeRatio = ` (${toPercent( - resources.garbage_collection.total_secs, - resources.total_secs + resources.garbage_collection.total_secs, + resources.total_secs )} of total time)` } return `## GraalVM Native Image Build Report example \`${info.name}\` generated${totalTime} as part of the '${ - context.job + context.job }' job in run #${context.runNumber}. #### Environment @@ -289,55 +289,55 @@ function createReport(data: BuildOutput): string { Reachable ${analysisTypes.reachable.toLocaleString()} ${toPercent( - analysisTypes.reachable, - analysisTypes.total - )} + analysisTypes.reachable, + analysisTypes.total + )} ${analysis.fields.reachable.toLocaleString()} ${toPercent( - analysis.fields.reachable, - analysis.fields.total - )} + analysis.fields.reachable, + analysis.fields.total + )} ${analysis.methods.reachable.toLocaleString()} ${toPercent( - analysis.methods.reachable, - analysis.methods.total - )} + analysis.methods.reachable, + analysis.methods.total + )} Reflection ${analysisTypes.reflection.toLocaleString()} ${toPercent( - analysisTypes.reflection, - analysisTypes.total - )} + analysisTypes.reflection, + analysisTypes.total + )} ${analysis.fields.reflection.toLocaleString()} ${toPercent( - analysis.fields.reflection, - analysis.fields.total - )} + analysis.fields.reflection, + analysis.fields.total + )} ${analysis.methods.reflection.toLocaleString()} ${toPercent( - analysis.methods.reflection, - analysis.methods.total - )} + analysis.methods.reflection, + analysis.methods.total + )} JNI ${analysisTypes.jni.toLocaleString()} ${toPercent( - analysisTypes.jni, - analysisTypes.total - )} + analysisTypes.jni, + analysisTypes.total + )} ${analysis.fields.jni.toLocaleString()} ${toPercent( - analysis.fields.jni, - analysis.fields.total - )} + analysis.fields.jni, + analysis.fields.total + )} ${analysis.methods.jni.toLocaleString()} ${toPercent( - analysis.methods.jni, - analysis.methods.total - )} + analysis.methods.jni, + analysis.methods.total + )} Loaded @@ -367,20 +367,20 @@ function createReport(data: BuildOutput): string { Code area ${bytesToHuman(details.code_area.bytes)} ${toPercent( - details.code_area.bytes, - details.total_bytes - )} + details.code_area.bytes, + details.total_bytes + )} ${details.code_area.compilation_units.toLocaleString()} compilation units Image heap ${bytesToHuman(details.image_heap.bytes)} ${toPercent( - details.image_heap.bytes, - details.total_bytes - )} + details.image_heap.bytes, + details.total_bytes + )} ${objectCount}${bytesToHuman( - details.image_heap.resources.bytes + details.image_heap.resources.bytes )} for ${details.image_heap.resources.count.toLocaleString()} resources ${debugInfoLine} @@ -392,8 +392,8 @@ function createReport(data: BuildOutput): string { Total ${bytesToHuman( - details.total_bytes - )} + details.total_bytes + )} 100.000% @@ -407,23 +407,23 @@ function createReport(data: BuildOutput): string { Garbage collection ${resources.garbage_collection.total_secs.toFixed( - 2 - )}s${gcTotalTimeRatio} in ${resources.garbage_collection.count} GCs + 2 + )}s${gcTotalTimeRatio} in ${resources.garbage_collection.count} GCs Peak RSS ${bytesToHuman( - resources.memory.peak_rss_bytes - )} (${toPercent( - resources.memory.peak_rss_bytes, - resources.memory.system_total + 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 + resources.cpu.load, + resources.cpu.total_cores )} of ${resources.cpu.total_cores} CPU cores) diff --git a/src/utils.ts b/src/utils.ts index 5a18c38..78014d9 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -211,4 +211,4 @@ export async function saveReportJson(content: string): Promise { `Failed to create pull request comment. Please make sure this job has 'write' permissions for the 'pull-requests' scope (see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions)? Internal error: ${err}` ) } -} \ No newline at end of file +}