Skip to content

Commit 4b59b84

Browse files
committed
chore: check build lib size
1 parent 2c031e1 commit 4b59b84

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

.github/workflows/flutter_ci.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,26 @@ jobs:
120120
run: cargo make --profile ${{ matrix.flutter_profile }} appflowy-core-dev
121121
shell: bash
122122

123+
- name: Check FFI library size
124+
shell: bash
125+
run: |
126+
LIB=$(find frontend -name "libappflowy_backend.so" 2>/dev/null | head -1)
127+
if [ -n "$LIB" ]; then
128+
SIZE_BYTES=$(stat -c%s "$LIB")
129+
SIZE_MB=$(echo "scale=2; $SIZE_BYTES / 1048576" | bc)
130+
echo "## FFI Library Size" >> $GITHUB_STEP_SUMMARY
131+
echo "**libappflowy_backend.so: ${SIZE_MB} MB**" >> $GITHUB_STEP_SUMMARY
132+
echo "FFI library size: ${SIZE_MB} MB"
133+
134+
MAX_SIZE_MB=150
135+
if (( $(echo "$SIZE_MB > $MAX_SIZE_MB" | bc -l) )); then
136+
echo "::error::FFI library size (${SIZE_MB} MB) exceeds limit (${MAX_SIZE_MB} MB)"
137+
exit 1
138+
fi
139+
else
140+
echo "::warning::Could not find libappflowy_backend.so"
141+
fi
142+
123143
- name: Clean cargo build artifacts
124144
working-directory: frontend/rust-lib
125145
run: cargo clean

0 commit comments

Comments
 (0)