Add ALD Transition Console preview and Astra lab build workflow
This commit is contained in:
1 parent
f330a3c00a
commit
e5c6a2fc0e
199 files changed
+9866
No files matched your search
@@ -0,0 +1,62 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Run local software checks only; never connect to infrastructure or install tools."""
|
||||
import argparse
|
||||
import datetime
|
||||
import hashlib
|
||||
import json
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--portable-only', action='store_true')
|
||||
args = parser.parse_args()
|
||||
records = []
|
||||
|
||||
|
||||
def run(name, argv, expected=0, cwd=ROOT, timeout=120):
|
||||
try:
|
||||
result = subprocess.run(argv, cwd=cwd, capture_output=True, text=True, timeout=timeout)
|
||||
record = dict(name=name, command=argv, expected_exit=expected,
|
||||
exit_code=result.returncode, stdout=result.stdout, stderr=result.stderr,
|
||||
status='PASS' if result.returncode == expected else 'FAIL')
|
||||
except (OSError, subprocess.TimeoutExpired) as error:
|
||||
record = dict(name=name, command=argv, status='ERROR', error=str(error))
|
||||
records.append(record)
|
||||
print(name + ': ' + record['status'], flush=True)
|
||||
return record['status'] == 'PASS'
|
||||
|
||||
|
||||
run('data_and_manifest', [sys.executable, 'tools/check_assets.py'])
|
||||
run('declared_theme_contrast', [sys.executable, 'tools/check_theme.py'])
|
||||
run('portable_rules_asan_ubsan', [sys.executable, 'tools/run_portable_tests.py'])
|
||||
# The unvalidated lock MUST block packaging in this development preview.
|
||||
run('unvalidated_release_refused', [sys.executable, 'tools/verify_release_lock.py'], expected=1)
|
||||
|
||||
qt_state = 'NOT_RUN_EXPLICIT_PORTABLE_ONLY' if args.portable_only else 'BLOCKED_MISSING_BUILD_TOOLS'
|
||||
if not args.portable_only and shutil.which('cmake'):
|
||||
if run('qt_configure', ['cmake', '-S', '.', '-B', 'build', '-DCMAKE_BUILD_TYPE=Debug']):
|
||||
if run('qt_build', ['cmake', '--build', 'build', '--parallel', '2'], timeout=300):
|
||||
qt_state = 'PASS' if run('qt_tests', ['ctest', '--output-on-failure'], cwd=ROOT/'build') else 'FAIL'
|
||||
else:
|
||||
qt_state = 'FAIL'
|
||||
else:
|
||||
qt_state = 'BLOCKED_OR_CONFIGURE_FAILED'
|
||||
|
||||
digest = hashlib.sha256()
|
||||
for base in ('src', 'tests/unit', 'schemas', 'data', 'resources', 'tools'):
|
||||
for path in sorted((ROOT/base).rglob('*')):
|
||||
if path.is_file() and '__pycache__' not in path.parts:
|
||||
digest.update(path.relative_to(ROOT).as_posix().encode() + b'\0' + path.read_bytes())
|
||||
report = dict(schema_version=1, observed_at=datetime.datetime.now(datetime.timezone.utc).isoformat(),
|
||||
source_digest=digest.hexdigest(), checks=records, qt_validation=qt_state,
|
||||
astra_lab='NOT_AVAILABLE', windows_lab='NOT_AVAILABLE', release_validated=False)
|
||||
output = ROOT/'docs/local-check-results.json'
|
||||
output.write_text(json.dumps(report, ensure_ascii=False, indent=2) + '\n')
|
||||
print('Qt validation: ' + qt_state)
|
||||
print('Report: ' + str(output))
|
||||
if any(record['status'] != 'PASS' for record in records):
|
||||
sys.exit(1)
|
||||
sys.exit(0 if args.portable_only or qt_state == 'PASS' else 2)
|
||||
Reference in new issue
Block a user