ci: show the size of the build next to main in the job summary

The bank growth step only exported the sizes to the environment since the
comment that used them was removed, so nothing showed them any more. It now
writes a table of the code banks, XSEG, the stack left after the internal
RAM is allocated and the web assets, main against the branch, to the job
summary, which needs no write permission on the pull request.
This commit is contained in:
DrDoof authored and d00f committed 2026-10-29 18:45:54 +01:00
1 parent 9a61e471ea
commit 2cd68167fc
2 files changed
+22 -6

No files matched your search

+3 -6
View File
@@ -40,7 +40,7 @@ jobs:
- name: Check that every machine definition can be compiled - name: Check that every machine definition can be compiled
run: cd branch && make machine_check run: cd branch && make machine_check
- name: Make project (4x2/RTL8372) - name: Make project (4x2/RTL8372)
run: cd branch && make CI=1 MACHINE="KP_9000_6XHML_X2" && cp output/KP_9000_6XHML_X2/rtlplayground.map /tmp/branch.map run: mkdir -p /tmp/branch /tmp/main && cd branch && make CI=1 MACHINE="KP_9000_6XHML_X2" && cp output/KP_9000_6XHML_X2/rtlplayground.map output/KP_9000_6XHML_X2/rtlplayground.mem /tmp/branch/
- name: Make project (8x1/RTL8373) - name: Make project (8x1/RTL8373)
run: cd branch && make CI=1 MACHINE="KP_9000_9XHML_X_V3_1" run: cd branch && make CI=1 MACHINE="KP_9000_9XHML_X_V3_1"
- name: Make project with the health instrumentation - name: Make project with the health instrumentation
@@ -49,10 +49,7 @@ jobs:
run: | run: |
ln -s ../branch/toolchain main/toolchain ln -s ../branch/toolchain main/toolchain
PATH="$(echo "$PWD"/branch/toolchain/sdcc-*/bin):$PATH" PATH="$(echo "$PWD"/branch/toolchain/sdcc-*/bin):$PATH"
cd main && make CI=1 MACHINE="KP_9000_6XHML_X2" && cp output/KP_9000_6XHML_X2/rtlplayground.map /tmp/main.map cd main && make CI=1 MACHINE="KP_9000_6XHML_X2" && cp output/KP_9000_6XHML_X2/rtlplayground.map output/KP_9000_6XHML_X2/rtlplayground.mem /tmp/main/
- name: Calculate bank growth - name: Calculate bank growth
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" sh branch/tools/size_summary.sh /tmp/main /tmp/branch main/output/KP_9000_6XHML_X2/html_min branch/output/KP_9000_6XHML_X2/html_min >> "$GITHUB_STEP_SUMMARY"
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/KP_9000_6XHML_X2/html_min | awk '{print "MAIN_WEB="$1}' >> "$GITHUB_ENV"
du -sb branch/output/KP_9000_6XHML_X2/html_min | awk '{print "BRANCH_WEB="$1}' >>"$GITHUB_ENV"
+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh
seg() {
sed -rn "s/^$1[^=]*=\\s+([0-9]+)\\. bytes.*$/\\1/p" "$2/rtlplayground.map" | head -n 1
}
stack() {
sed -rn 's/.* with ([0-9]+) bytes available.*/\1/p' "$1/rtlplayground.mem"
}
row() {
echo "| $1 | $2 | $3 | $((${3:-0} - ${2:-0})) |"
}
echo "### KP_9000_6XHML_X2"
echo
echo "| | main | branch | change |"
echo "| --- | ---: | ---: | ---: |"
for s in HOME CSEG BANK1 BANK2 BANK3 BANK4 XSEG; do
row "$s" "$(seg $s "$1")" "$(seg $s "$2")"
done
row "stack available" "$(stack "$1")" "$(stack "$2")"
row "web" "$(du -sb "$3" | cut -f1)" "$(du -sb "$4" | cut -f1)"