Skip to content

Commit e9d3b94

Browse files
author
James Brundage
committed
feat: Adding PipeScript Factor to Build Summary ( Fixes #914 )
1 parent c24349e commit e9d3b94

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Commands/PipeScript/Export-PipeScript.ps1

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,17 @@ function Export-Pipescript {
479479
"$filesToBuildTotal in $($BuildTime)" | Out-Host
480480
"::endgroup::Building PipeScripts [$FilesToBuildCount / $filesToBuildTotal] : $($buildFile.Source)" | Out-Host
481481
if ($TotalInputFileLength) {
482-
$kbIn = $([Math]::Round($TotalInputFileLength / 1kb))
483-
$kbOut = $([Math]::Round($TotalOutputFileLength / 1kb))
484-
$pipeScriptFactor = $kbIn/$kbOut
482+
$kbIn = [Math]::Round($TotalInputFileLength / 1kb)
483+
$kbOut = [Math]::Round($TotalOutputFileLength / 1kb)
484+
$pipeScriptFactor = [Math]::round([double]$TotalOutputFileLength/[double]$TotalInputFileLength,4)
485+
486+
if ($env:GITHUB_STEP_SUMMARY) {
487+
@(
488+
"<span style='font-size:1em'>$kbIn</span> generated <span style='font-size:$($pipeScriptFactor/ 2)em'>"
489+
"<span style='font-size:$($pipeScriptFactor)em'>PipeScript Factor : $pipeScriptFactor</span>"
490+
) | Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY
491+
}
492+
485493
"$([Math]::Round($TotalInputFileLength / 1kb)) kb input"
486494
"$([Math]::Round($TotalOutputFileLength / 1kb)) kb output",
487495
"PipeScript Factor: X$([Math]::round([double]$TotalOutputFileLength/[double]$TotalInputFileLength,4))"

0 commit comments

Comments
 (0)