Skip to content

Commit

Permalink
fix build size report
Browse files Browse the repository at this point in the history
  • Loading branch information
AGulev committed Dec 22, 2024
1 parent c171d6f commit c37cb28
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check_size.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: '17.0.5+8'
java-version: '21.0.5+11.0.LTS'
distribution: 'temurin'

- name: Setup matplotlib
Expand Down
1 change: 0 additions & 1 deletion bundle_report.csv
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,3 @@ VERSION,arm64-ios,arm64-android,armv7-android,x86_64-macos,js-web,wasm-web,x86_6
1.9.3,1377701,1832234,1815852,3849745,1435504,1048396,1976636,2428057,2858941,3491209
1.9.4,1396325,1852714,1840428,3903801,1442770,1047320,1998650,2453272,2888976,3525049
1.9.5,1395866,1856810,1840428,3908023,1444022,1048360,2000146,2454121,2890311,3525175
1.9.6,0,0,0,0,22,22,22,22,22,0
16 changes: 14 additions & 2 deletions check_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ def get_size_from_url(sha1, path):
return 0

def get_engine_size_from_aws(sha1, platform, filename):
if platform == "x86-win32":
platform = "win32"
print("Gettings size of {} for platform {} with sha1 {} from AWS".format(filename, platform, sha1))
path = "engine/{}/stripped/{}".format(platform, filename)
path = "engine/{}/{}".format(platform, filename)
size = get_size_from_url(sha1, path)
if size == 0:
path = "engine/{}/{}".format(platform, filename)
Expand Down Expand Up @@ -142,6 +144,16 @@ def get_engine_size_from_bob(sha1, platform, filename):
print(e)
return 0

def get_engine_size(sha1, platform, filename):
# Try to get the engine size from Bob
size = get_engine_size_from_bob(sha1, platform, filename)
if size > 0:
return size

# Fall back to getting the engine size from AWS
size = get_engine_size_from_aws(sha1, platform, filename)
return size

def get_zipped_size(path):
tmp = tempfile.NamedTemporaryFile("wb")
z = zipfile.ZipFile(tmp, "w", zipfile.ZIP_DEFLATED)
Expand Down Expand Up @@ -488,7 +500,7 @@ def check_for_updates(latest_release, releases):
# update reports (if releases are missing from a report file)
print("Creating reports")
# create_report("legacy_engine_report.csv", releases['releases'], engines, get_engine_size_from_aws)
create_report("engine_report.csv", releases['releases'], engines, get_engine_size_from_bob)
create_report("engine_report.csv", releases['releases'], engines, get_engine_size)
create_report("bundle_report.csv", releases['releases'], bundles, get_bundle_size_from_bob)
create_report("bob_report.csv", releases['releases'], bob_files, get_bob_size_from_aws)
create_report("editor_report.csv", releases['releases'], editor_files, get_editor_size_from_aws)
Expand Down
1 change: 0 additions & 1 deletion engine_report.csv
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,3 @@ VERSION,arm64-ios,arm64-android,armv7-android,x86_64-macos,js-web,wasm-web,x86_6
1.9.3,2852736,3764568,3406692,3833280,5039346,2374239,4173144,6093824,7476736,3474744
1.9.4,2886280,3814912,3455588,3887336,5020648,2399700,4219736,6159360,7556608,3508584
1.9.5,2886416,3816832,3457772,3891432,5023084,2400982,4219832,6160384,7559680,3508584
1.9.6,2886600,3819952,0,3887520,0,2408422,4236360,0,7565312,3508760

0 comments on commit c37cb28

Please sign in to comment.