CI: temporary diagnostic of the generated-asset check (to be reverted)
build / mod (push) Failing after 43s
build / mod (push) Failing after 43s
This commit is contained in:
@@ -39,6 +39,46 @@ jobs:
|
|||||||
python3 -m pip install --user --break-system-packages -r tools/requirements.txt
|
python3 -m pip install --user --break-system-packages -r tools/requirements.txt
|
||||||
python3 tools/gen_catalog.py --check
|
python3 tools/gen_catalog.py --check
|
||||||
python3 -m unittest discover -s tools -p test_sound_catalog.py
|
python3 -m unittest discover -s tools -p test_sound_catalog.py
|
||||||
|
- name: DEBUG png byte vs pixel diff
|
||||||
|
run: |
|
||||||
|
python3 - <<'EOF'
|
||||||
|
import hashlib, os, sys, tempfile, zlib
|
||||||
|
sys.path.insert(0, 'tools')
|
||||||
|
import PIL
|
||||||
|
from PIL import Image, features
|
||||||
|
print('python', sys.version.split()[0], 'PIL', PIL.__version__, 'features.zlib', features.version('zlib'), 'runtime', zlib.ZLIB_RUNTIME_VERSION)
|
||||||
|
import gen_models
|
||||||
|
root = gen_models.ROOT
|
||||||
|
with tempfile.TemporaryDirectory() as stage:
|
||||||
|
gen_models.generate(stage)
|
||||||
|
byte_diff = pixel_diff = total = 0
|
||||||
|
other = []
|
||||||
|
for dirpath, dirs, names in os.walk(stage):
|
||||||
|
for name in names:
|
||||||
|
p = os.path.join(dirpath, name)
|
||||||
|
rel = os.path.relpath(p, stage).replace(os.sep, '/')
|
||||||
|
q = os.path.join(root, rel)
|
||||||
|
a = open(p, 'rb').read()
|
||||||
|
b = open(q, 'rb').read() if os.path.exists(q) else None
|
||||||
|
total += 1
|
||||||
|
if a == b:
|
||||||
|
continue
|
||||||
|
if rel.endswith('.png') and b is not None:
|
||||||
|
byte_diff += 1
|
||||||
|
ia, ib = Image.open(p), Image.open(q)
|
||||||
|
if ia.mode != ib.mode or ia.size != ib.size or ia.tobytes() != ib.tobytes():
|
||||||
|
pixel_diff += 1
|
||||||
|
if pixel_diff <= 5:
|
||||||
|
print('PIXEL DIFF', rel, ia.mode, ib.mode, ia.size, ib.size, len(a), len(b))
|
||||||
|
else:
|
||||||
|
other.append(rel)
|
||||||
|
print('files', total, 'png byte-diff', byte_diff, 'png pixel-diff', pixel_diff, 'non-png diffs', other[:10])
|
||||||
|
for n in ('mover', 'launch_shahed', 'deploy_s400'):
|
||||||
|
rel = 'assets/airdef/textures/item/%s.png' % n
|
||||||
|
a = open(os.path.join(stage, rel), 'rb').read()
|
||||||
|
im = Image.open(os.path.join(stage, rel))
|
||||||
|
print(n, 'bytes', len(a), 'file', hashlib.sha256(a).hexdigest()[:16], 'pixels', hashlib.sha256(im.tobytes()).hexdigest()[:16])
|
||||||
|
EOF
|
||||||
python3 tools/gen_models.py --check
|
python3 tools/gen_models.py --check
|
||||||
python3 -m unittest discover -s tools -p test_model_bounds.py
|
python3 -m unittest discover -s tools -p test_model_bounds.py
|
||||||
- name: Тесты ядра без SDK
|
- name: Тесты ядра без SDK
|
||||||
|
|||||||
Reference in New Issue
Block a user