Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 02e574ca20 | |||
| 5ac72287f4 |
@@ -32,11 +32,53 @@ jobs:
|
||||
run: nice -n 19 python3 tools/airdef.py fork
|
||||
- name: Проверка закреплённого checkout
|
||||
run: python3 -m unittest discover -s tools -p test_engine_checkout.py
|
||||
# Системный Python образа — externally managed (PEP 668): без --break-system-packages pip отказывает,
|
||||
# и тесты со сборкой ниже вообще не запускаются. Контейнер задачи одноразовый, так что --user безопасен.
|
||||
- name: Проверка generated assets
|
||||
run: |
|
||||
python3 -m pip install --user -r tools/requirements.txt
|
||||
python3 -m pip install --user --break-system-packages -r tools/requirements.txt
|
||||
python3 tools/gen_catalog.py --check
|
||||
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 -m unittest discover -s tools -p test_model_bounds.py
|
||||
- name: Тесты ядра без SDK
|
||||
|
||||
Reference in New Issue
Block a user