diff --git a/.ci/lib/check_devices_in_wiki.py b/.ci/lib/check_devices_in_wiki.py index 3bc5fa8a8..3af69fbdc 100755 --- a/.ci/lib/check_devices_in_wiki.py +++ b/.ci/lib/check_devices_in_wiki.py @@ -7,6 +7,8 @@ import argparse import sys import urllib.request +# Same dir +import common def get_devices() -> list[str]: """:returns: list of all devices""" @@ -94,13 +96,23 @@ def main() -> int: parser.add_argument("--path", help="instead of downloading the devices" " page from the wiki, use a local HTML file", type=Path, default=None) + parser.add_argument("--all", help="check all devices (default: check only" + " devices changed from branch point)", + action="store_true") args = parser.parse_args() - # Check all devices html = get_wiki_devices_html(args.path) html["renamed"] = get_wiki_renamed_devices_html() error = False - for device in get_devices(): + devices = [] + if args.all: + devices = get_devices() + else: + devices = common.get_changed_devices() + # remove 'device-' prefix + devices = [d[7:] for d in devices] + devices = [d.removesuffix("-downstream") for d in devices] + for device in devices: if not check_device(device, html, args.booting): error = True diff --git a/.ci/lib/common.py b/.ci/lib/common.py index 83a4fa304..be0ac0c0e 100755 --- a/.ci/lib/common.py +++ b/.ci/lib/common.py @@ -184,3 +184,10 @@ def get_changed_kernels(): if pkgname.startswith("linux-"): ret += [pkgname] return ret + +def get_changed_devices(): + ret = [] + for pkgname in get_changed_packages(): + if pkgname.startswith("device-"): + ret += [pkgname] + return ret diff --git a/.ci/wiki.sh b/.ci/wiki.sh index de2b43568..e727234f0 100755 --- a/.ci/wiki.sh +++ b/.ci/wiki.sh @@ -7,9 +7,11 @@ if [ "$(id -u)" = 0 ]; then set -x apk -q add \ + git \ python3 exec su "${TESTUSER:-build}" -c "sh -e $0" fi set -x -.ci/lib/check_devices_in_wiki.py --booting +# shellcheck disable=SC2068 +.ci/lib/check_devices_in_wiki.py --booting $@