CI: Run dint job on all files on deviceinfo_schema.toml change

Similar to kconfigcheck.toml, let's run the dint job on all deviceinfo
files when the spec itself is changed. This allows to catch possible new
warnings and errors early and fix them.

Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8139>
This commit is contained in:
Luca Weiss 2026-03-07 15:37:58 +01:00 committed by The Friendly Meow (merge) Bot
parent acf264e262
commit 1ab8eefdd5
No known key found for this signature in database
2 changed files with 11 additions and 3 deletions

View file

@ -3,6 +3,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
import common
import glob
import os.path
import subprocess
import sys
@ -11,9 +12,15 @@ if __name__ == "__main__":
if common.commit_message_has_string("[ci:skip-dint]"):
print("WARNING: not linting deviceinfo files ([ci:skip-dint])")
exit(0)
# only lint deviceinfo files in the devices repo
deviceinfo_files = {file for file in common.get_changed_files()
if os.path.basename(file) == "deviceinfo" and file.startswith("device/")}
if "deviceinfo_schema.toml" in common.get_changed_files():
print("deviceinfo_schema.toml changed -> checking all deviceinfo files")
pmaports_dir = common.get_pmaports_dir()
deviceinfo_files = set(glob.glob(pmaports_dir + "/device/*/*/deviceinfo"))
else:
# only lint deviceinfo files in the devices repo
deviceinfo_files = {file for file in common.get_changed_files()
if os.path.basename(file) == "deviceinfo" and file.startswith("device/")}
try:
subprocess.run(["dint", "check", *deviceinfo_files], text=True, check=True)

View file

@ -128,6 +128,7 @@ dint:
- .ci/**/*
- .gitlab-ci.yml
- device/*/device-*/deviceinfo
- deviceinfo_schema.toml
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/dint.sh