Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
Signed-off-by: chahatsagarmain <[email protected]>
  • Loading branch information
chahatsagarmain committed Jan 15, 2025
1 parent 3cc8f37 commit 6d30ca1
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions .github/workflows/ci-check-bundle-size.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check Binaries bundle size
name: Check Binaries binary size

on:
push:
Expand Down Expand Up @@ -41,48 +41,48 @@ jobs:
- name: Build jaeger binary
run: make build-jaeger

- name: Calculate bundle size
- name: Calculate jaeger binary size
run: |
TOTAL_SIZE=$(du -sb ./cmd/jaeger/jaeger-linux-amd64 | cut -f1)
echo "$TOTAL_SIZE" > ./new_bundle_size.txt
echo "Total bundle size: $TOTAL_SIZE bytes"
echo "$TOTAL_SIZE" > ./new_jaeger_binary_size.txt
echo "Total binary size: $TOTAL_SIZE bytes"
- name: Restore previous bundle size
id: cache-bundle-size
- name: Restore previous binary size
id: cache-binary-size
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2.0
with:
path: ./bundle_size.txt
key: jaeger-bundle
path: ./jaeger_binary_size.txt
key: jaeger-binary
restore-keys: |
jaeger-bundle
jaeger-binary
- name: Compare bundle sizes
if: steps.cache-bundle-size.outputs.cache-hit == 'true'
- name: Compare jaeger binary sizes
if: steps.cache-binary-size.outputs.cache-hit == 'true'
run: |
OLD_BUNDLE_SIZE=$(cat ./bundle_size.txt)
NEW_BUNDLE_SIZE=$(cat ./new_bundle_size.txt)
echo "Previous bundle size: $OLD_BUNDLE_SIZE bytes"
echo "New bundle size: $NEW_BUNDLE_SIZE bytes"
OLD_BUNDLE_SIZE=$(cat ./jaeger_binary_size.txt)
NEW_BUNDLE_SIZE=$(cat ./new_jaeger_binary_size.txt)
echo "Previous binary size: $OLD_BUNDLE_SIZE bytes"
echo "New binary size: $NEW_BUNDLE_SIZE bytes"
SIZE_CHANGE=$(( $NEW_BUNDLE_SIZE - $OLD_BUNDLE_SIZE ))
PERCENTAGE_CHANGE=$(( SIZE_CHANGE * 100 / $OLD_BUNDLE_SIZE ))
echo "Size change: $PERCENTAGE_CHANGE%"
if [ $PERCENTAGE_CHANGE -gt 2 ]; then
echo "❌ Bundle size increased by more than 2% ($PERCENTAGE_CHANGE%)"
echo "❌ binary size increased by more than 2% ($PERCENTAGE_CHANGE%)"
exit 1
else
echo "✅ Bundle size change is within acceptable range ($PERCENTAGE_CHANGE%)"
echo "✅ binary size change is within acceptable range ($PERCENTAGE_CHANGE%)"
fi

- name: Remove previous *_bundle_*.txt
run: |
rm -rf ./bundle_size.txt
mv ./new_bundle_size.txt ./bundle_size.txt
rm -rf ./jaeger_binary_size.txt
mv ./new_jaeger_binary_size.txt ./jaeger_binary_size.txt
- name: Save new bundle size
- name: Save new jaeger binary size
if: ${{ (github.event_name == 'push') && (github.ref == 'refs/heads/main') }}
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2.0
with:
path: ./bundle_size.txt
key: jaeger-bundle_${{ github.run_id }}
path: ./jaeger_binary_size.txt
key: jaeger_binary_${{ github.run_id }}

0 comments on commit 6d30ca1

Please sign in to comment.