@@ -56,6 +56,40 @@ steps:
5656 waitFor :
5757 - wasm_cmake
5858 timeout : 1800s
59+ - name : gcr.io/cloud-builders/gsutil
60+ args :
61+ - cp
62+ - ' gs://vizzu-lib-main/lib/size.txt'
63+ - ' /workspace/build/cmake-wasm/weblib/size_downloaded.txt'
64+ id : download_size
65+ waitFor :
66+ - wasm_make
67+ - name : vizzu/vizzu-devenv:v0.8.x
68+ args :
69+ - python3
70+ - ' -c'
71+ - |
72+ threshold = 1.05
73+ with open('/workspace/build/cmake-wasm/weblib/size.txt', 'r') as size_file:
74+ for line in size_file:
75+ file, actual_size = line.strip().split()
76+ downloaded_line = next(
77+ (d_line for d_line in open('/workspace/build/cmake-wasm/weblib/size_downloaded.txt', 'r') if d_line.startswith(file)),
78+ None
79+ )
80+ if downloaded_line:
81+ downloaded_size = downloaded_line.split()[1]
82+ if float(actual_size) > float(downloaded_size) * threshold:
83+ print(f"Error: File {file} size exceeds the threshold.")
84+ exit(1)
85+ else:
86+ print(f"Success: File {file} size comparison passed. Actual: {actual_size}, Downloaded: {downloaded_size}")
87+ else:
88+ print(f"Warning: Downloaded size not found for file {file}. Skipping comparison. Actual: {actual_size}")
89+
90+ id : check_size
91+ waitFor :
92+ - download_size
5993 - name : vizzu/vizzu-devenv:v0.8.x
6094 args :
6195 - node
@@ -106,6 +140,7 @@ steps:
106140 - .
107141 id : test_integration
108142 waitFor :
143+ - check_size
109144 - test_jsUnit
110145 - test_desktopUnit
111146 - test_wasmUnit
@@ -118,7 +153,7 @@ steps:
118153 echo $SHORT_SHA > sha.txt
119154 fi
120155 dir : /workspace/example
121- id : sha_generate
156+ id : meta_generate
122157 waitFor :
123158 - test_integration
124159 entrypoint : bash
@@ -129,10 +164,11 @@ steps:
129164 if [ $BRANCH_NAME == "main" ]
130165 then
131166 gsutil -m cp '/workspace/example/sha.txt' 'gs://vizzu-lib-main/lib'
167+ gsutil -m cp '/workspace/build/cmake-wasm/weblib/size.txt' 'gs://vizzu-lib-main/lib'
132168 fi
133- id : sha_upload
169+ id : meta_upload
134170 waitFor :
135- - sha_generate
171+ - meta_generate
136172 entrypoint : bash
137173 - name : gcr.io/cloud-builders/gsutil
138174 args :
0 commit comments