adding the HTML/JS compressed sizes to the comment

This commit is contained in:
Rob Emery committed 2026-10-22 12:34:48 +01:00
1 parent 94ca35f65e
commit ef0d9d872e
2 files changed
+21 -7

No files matched your search

+5 -1
View File
@@ -45,6 +45,9 @@ jobs:
run: | run: |
sed -rn 's/^([XCD]SEG|(BANK[0-9])).*=\s+([0-9]+)\. bytes.*$/MAIN_\1=\3/p' /tmp/main.map | sort -u >> "$GITHUB_ENV" sed -rn 's/^([XCD]SEG|(BANK[0-9])).*=\s+([0-9]+)\. bytes.*$/MAIN_\1=\3/p' /tmp/main.map | sort -u >> "$GITHUB_ENV"
sed -rn 's/^([XCD]SEG|(BANK[0-9])).*=\s+([0-9]+)\. bytes.*$/BRANCH_\1=\3/p' /tmp/branch.map | sort -u >> "$GITHUB_ENV" sed -rn 's/^([XCD]SEG|(BANK[0-9])).*=\s+([0-9]+)\. bytes.*$/BRANCH_\1=\3/p' /tmp/branch.map | sort -u >> "$GITHUB_ENV"
du -sb main/output/html_min | awk '{print "MAIN_WEB="$1}' >> "$GITHUB_ENV"
du -sb branch/output/html_min | awk '{print "BRANCH_WEB="$1}' >>"$GITHUB_ENV"
- name: Update PR comment - name: Update PR comment
uses: marocchino/sticky-pull-request-comment@v3 uses: marocchino/sticky-pull-request-comment@v3
with: with:
@@ -54,7 +57,7 @@ jobs:
Commit: ${{ github.sha }} Commit: ${{ github.sha }}
| Bank # | Main | Branch | | Name | Main | Branch |
| --- | --- | --- | | --- | --- | --- |
| XSEG | ${{ env.MAIN_XSEG }} bytes | ${{ env.BRANCH_XSEG }} bytes | | XSEG | ${{ env.MAIN_XSEG }} bytes | ${{ env.BRANCH_XSEG }} bytes |
| CSEG | ${{ env.MAIN_CSEG }} bytes | ${{ env.BRANCH_CSEG }} bytes | | CSEG | ${{ env.MAIN_CSEG }} bytes | ${{ env.BRANCH_CSEG }} bytes |
@@ -62,3 +65,4 @@ jobs:
| 1 | ${{ env.MAIN_BANK1 }} bytes | ${{ env.BRANCH_BANK1 }} bytes | | 1 | ${{ env.MAIN_BANK1 }} bytes | ${{ env.BRANCH_BANK1 }} bytes |
| 2 | ${{ env.MAIN_BANK2 }} bytes | ${{ env.BRANCH_BANK2 }} bytes | | 2 | ${{ env.MAIN_BANK2 }} bytes | ${{ env.BRANCH_BANK2 }} bytes |
| 3 | ${{ env.MAIN_BANK3 }} bytes | ${{ env.BRANCH_BANK3 }} bytes | | 3 | ${{ env.MAIN_BANK3 }} bytes | ${{ env.BRANCH_BANK3 }} bytes |
| HTML/JS | ${{ env.MAIN_WEB }} bytes | ${{ env.BRANCH_WEB }} bytes |
+16 -6
View File
@@ -7,15 +7,25 @@ if [[ ! -s output-main/rtlplayground.map ]]; then
git switch "$original_branch" git switch "$original_branch"
fi fi
source <(sed -rn 's/^([XCD]SEG|(BANK[0-9])).*=\s+([0-9]+)\. bytes.*$/main_\1=\3/p' output-main/rtlplayground.map | sort -u) source <(sed -rn 's/^([XCD]SEG|(BANK[0-9])).*=\s+([0-9]+)\. bytes.*$/main_\1=\3/p' output-main/rtlplayground.map | sort -u)
main_WEB=$(du -sb output-main/html_min | awk '{print $1}')
if [[ ! -s "output/$MACHINE/rtlplayground.map" ]]; then if [[ ! -s "output/$MACHINE/rtlplayground.map" ]]; then
make CI=1 MACHINE="$MACHINE" make CI=1 MACHINE="$MACHINE"
fi fi
source <(sed -rn 's/^([XCD]SEG|(BANK[0-9])).*=\s+([0-9]+)\. bytes.*$/branch_\1=\3/p' output/"$MACHINE"/rtlplayground.map | sort -u) source <(sed -rn 's/^([XCD]SEG|(BANK[0-9])).*=\s+([0-9]+)\. bytes.*$/branch_\1=\3/p' output/"$MACHINE"/rtlplayground.map | sort -u)
branch_WEB=$(du -sb output/html_min | awk '{print $1}')
print_line() {
local name=$1 main=$2 branch=$3
printf '%-20s %-20s %-20s %-20s\n' "$name" "$main" "$branch" "$((branch - main))"
}
printf '%-20s %-20s %-20s %-20s\n' "segment" "main" "branch" "change" printf '%-20s %-20s %-20s %-20s\n' "segment" "main" "branch" "change"
printf '%-20s %-20s %-20s %-20s\n' "BANK1" "$main_BANK1" "$branch_BANK1" "$(($branch_BANK1-$main_BANK1))"
printf '%-20s %-20s %-20s %-20s\n' "BANK2" "$main_BANK2" "$branch_BANK2" "$(($branch_BANK2-$main_BANK2))" print_line "BANK1" "$main_BANK1" "$branch_BANK1"
printf '%-20s %-20s %-20s %-20s\n' "BANK3" "$main_BANK3" "$branch_BANK3" "$(($branch_BANK3-$main_BANK3))" print_line "BANK2" "$main_BANK2" "$branch_BANK2"
printf '%-20s %-20s %-20s %-20s\n' "CSEG" "$main_CSEG" "$branch_CSEG" "$(($branch_CSEG-$main_CSEG))" print_line "BANK3" "$main_BANK3" "$branch_BANK3"
printf '%-20s %-20s %-20s %-20s\n' "DSEG" "$main_DSEG" "$branch_DSEG" "$(($branch_DSEG-$main_DSEG))" print_line "CSEG" "$main_CSEG" "$branch_CSEG"
printf '%-20s %-20s %-20s %-20s\n' "XSEG" "$main_XSEG" "$branch_XSEG" "$(($branch_XSEG-$main_XSEG))" print_line "DSEG" "$main_DSEG" "$branch_DSEG"
print_line "XSEG" "$main_XSEG" "$branch_XSEG"
print_line "WEB" "$main_WEB" "$branch_WEB"