Skip to content

Commit

Permalink
Update checks script
Browse files Browse the repository at this point in the history
  • Loading branch information
andremion committed Dec 31, 2024
1 parent 580e378 commit 02ecd81
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/sdk-size-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:

env:
MODULES: "stream-chat-android-client stream-chat-android-offline stream-chat-android-ui-components stream-chat-android-compose"
MODULES: "stream-chat-android-compose"
METRICS_FILE: "metrics/size.json"
MAX_TOLERANCE: 500
FINE_TOLERANCE: 250
Expand All @@ -25,7 +25,7 @@ jobs:
- name: Assemble SDKs
run: |
for module in $MODULES; do
modules+=" :$module:assembleDebug"
modules+=" :metrics:$module-baseline:assemble :metrics:$module-stream:assemble"
done
./gradlew $modules
Expand All @@ -41,10 +41,16 @@ jobs:
run: |
echo '{}' > pr_sdk_sizes.json
# Calculate sizes from the .aar files and save them into a temporary JSON file
# Calculate sizes from the .apk files and save them into a temporary JSON file
# so it can be exported for the next job step
for module in $MODULES; do
size=$(du -k $module/build/outputs/aar/*debug.aar | awk '{print $1}')
baselineFile="metrics/$module/build/outputs/apk/debug/$module-baseline-debug.apk"
streamFile="metrics/$module/build/outputs/apk/debug/$module-stream-debug.apk"
baselineSize=$(du -k "$baselineFile" | awk '{print $1}')
streamSize=$(du -k "$streamFile" | awk '{print $1}')
size=$((streamSize - baselineSize))
jq -c --arg sdk "$module" --arg size "$size" '. + {($sdk): ($size | tonumber)}' pr_sdk_sizes.json > temp.json && mv temp.json pr_sdk_sizes.json
done
Expand Down

0 comments on commit 02ecd81

Please sign in to comment.