feat: validate emulator profiles in CI

This commit is contained in:
Abdessamad Derraz committed 2026-08-08 04:24:11 +02:00
1 parent 5f60138dce
commit a0ca5f208a
5 files changed
+155 -15

No files matched your search

+29
View File
@@ -5,6 +5,7 @@ on:
paths:
- "bios/**"
- "platforms/**"
- "emulators/**"
permissions:
contents: read
@@ -94,6 +95,34 @@ jobs:
sys.exit(1)
"
- name: Validate emulator profiles
run: |
python -c "
import json, yaml, sys
from jsonschema import validate, ValidationError
from pathlib import Path
with open('schemas/emulator.schema.json') as f:
schema = json.load(f)
errors = []
for yml_file in sorted(Path('emulators').glob('*.yml')):
if yml_file.name.endswith('.old.yml'):
continue
with open(yml_file) as f:
profile = yaml.safe_load(f)
try:
validate(profile, schema)
except ValidationError as e:
path = '/'.join(str(p) for p in e.absolute_path)
errors.append(f'{yml_file.name}: {path}: {e.message}')
print(f'FAIL {yml_file.name}: {path}: {e.message}')
print(f'{len(errors)} invalid profiles')
if errors:
sys.exit(1)
"
run-tests:
runs-on: ubuntu-latest
steps: