Skip to content

Commit

Permalink
Fix reversed deltas, strip report_pkg prefix in deltas
Browse files Browse the repository at this point in the history
  • Loading branch information
H-Plus-Time committed Dec 4, 2023
1 parent 642313c commit 7f1dc95
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ jobs:
...v,
...Object.fromEntries(['size', 'compressed_size'].map(subK => {
// compute the percentage change, NaN if the asset wasn't available
const proportionalDelta = 1 - v?.[subK] / baseAsset?.[subK];
const absoluteDelta = baseAsset?.[subK] - v?.[subK]
const proportionalDelta = v?.[subK] / baseAsset?.[subK] - 1;
const absoluteDelta = v?.[subK] - baseAsset?.[subK]
const sign = Math.sign(proportionalDelta);
// conditionally color the output via an inline latex block
let fragment = '';
Expand All @@ -239,7 +239,7 @@ jobs:
// output a markdown fragment
const sizeFragment = `${formatter.format(size)} ${size_delta}`
const compressedFragment = `${formatter.format(compressed_size)} ${compressed_size_delta}`
return [asset, sizeFragment, compressedFragment]
return [asset.replace('report_pkg/', ''), sizeFragment, compressedFragment]
});
await core.summary.addHeading('Asset Sizes').addTable([
[{data: 'Asset', header: true}, {data: 'Uncompressed Size', header: true}, {data: 'Compressed Size', header: true}],
Expand Down

0 comments on commit 7f1dc95

Please sign in to comment.