|
27 | 27 | SIZE=$(stat -f%z zig-out/bin/cljw) |
28 | 28 | SIZE_MB=$(echo "scale=2; $SIZE / 1048576" | bc) |
29 | 29 | 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" |
33 | 33 | exit 1 |
34 | 34 | fi |
35 | 35 | - name: E2E tests |
@@ -78,12 +78,18 @@ jobs: |
78 | 78 | ./zig-out/bin/cljw -e '(println "CI pass")' |
79 | 79 | - name: Binary size check |
80 | 80 | 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) |
82 | 88 | 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" |
87 | 93 | exit 1 |
88 | 94 | fi |
89 | 95 | - name: E2E tests |
|
0 commit comments