Skip to content

Commit 65c5a03

Browse files
committed
CI: update binary size thresholds for post-All-Zig baselines
macOS: 4.5MB → 4.8MB (baseline ~4.54MB after All-Zig migration) Linux: check stripped binary size instead of raw ELF (debug info makes raw size ~21MB, stripped ~4.5MB matches macOS)
1 parent fd68ea5 commit 65c5a03

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ jobs:
2727
SIZE=$(stat -f%z zig-out/bin/cljw)
2828
SIZE_MB=$(echo "scale=2; $SIZE / 1048576" | bc)
2929
echo "Binary size: ${SIZE_MB}MB ($SIZE bytes)"
30-
# Threshold: 4.5MB (baseline 4.25MB + 5% margin)
31-
if [ "$SIZE" -gt 4718592 ]; then
32-
echo "FAIL: Binary size ${SIZE_MB}MB exceeds 4.5MB threshold"
30+
# Threshold: 4.8MB (baseline ~4.5MB, see .dev/baselines.md)
31+
if [ "$SIZE" -gt 5033164 ]; then
32+
echo "FAIL: Binary size ${SIZE_MB}MB exceeds 4.8MB threshold"
3333
exit 1
3434
fi
3535
- name: E2E tests
@@ -78,12 +78,18 @@ jobs:
7878
./zig-out/bin/cljw -e '(println "CI pass")'
7979
- name: Binary size check
8080
run: |
81-
SIZE=$(stat -c%s zig-out/bin/cljw)
81+
RAW_SIZE=$(stat -c%s zig-out/bin/cljw)
82+
RAW_MB=$(echo "scale=2; $RAW_SIZE / 1048576" | bc)
83+
echo "Binary size (raw): ${RAW_MB}MB ($RAW_SIZE bytes)"
84+
# Linux ELF includes debug info in ReleaseSafe; check stripped size
85+
cp zig-out/bin/cljw /tmp/cljw_stripped
86+
strip /tmp/cljw_stripped
87+
SIZE=$(stat -c%s /tmp/cljw_stripped)
8288
SIZE_MB=$(echo "scale=2; $SIZE / 1048576" | bc)
83-
echo "Binary size: ${SIZE_MB}MB ($SIZE bytes)"
84-
# Linux binary may differ from macOS; use generous 5MB threshold
85-
if [ "$SIZE" -gt 5242880 ]; then
86-
echo "FAIL: Binary size ${SIZE_MB}MB exceeds 5MB threshold"
89+
echo "Binary size (stripped): ${SIZE_MB}MB ($SIZE bytes)"
90+
# Threshold: 4.8MB stripped (baseline ~4.5MB, see .dev/baselines.md)
91+
if [ "$SIZE" -gt 5033164 ]; then
92+
echo "FAIL: Stripped binary ${SIZE_MB}MB exceeds 4.8MB threshold"
8793
exit 1
8894
fi
8995
- name: E2E tests

0 commit comments

Comments
 (0)