diff --git a/examples/chef/chef.py b/examples/chef/chef.py index 5a3f388785aa1d..5fdb6bc42610d2 100755 --- a/examples/chef/chef.py +++ b/examples/chef/chef.py @@ -180,6 +180,7 @@ def main(argv: Sequence[str]) -> None: chef_zzz_root = os.path.join(_CHEF_SCRIPT_PATH, "zzz_generated") ci_manifest_file_name = os.path.join(_CHEF_SCRIPT_PATH, "cimanifest.json") chef_devices_dir = os.path.join(_CHEF_SCRIPT_PATH, "devices") + ci_allowlist = ['lighting-app.zap'] # # Validate zzz_generated @@ -190,8 +191,7 @@ def main(argv: Sequence[str]) -> None: print(f"Validating {chef_zzz_root}") for device_dir_item in os.listdir(chef_devices_dir): target_file_ext = ".zap" - if device_dir_item.endswith(target_file_ext) and device_dir_item == 'lightin\ -g-app.zap': + if device_dir_item.endswith(target_file_ext) and device_dir_item in ci_allowlist: device_name = device_dir_item[:-len(target_file_ext)] device_file_path = os.path.join(chef_devices_dir, device_dir_item) with open(device_file_path, "rb") as device_file: @@ -199,6 +199,7 @@ def main(argv: Sequence[str]) -> None: device_file_md5 = hashlib.md5(device_file_data).hexdigest() ci_manifest[device_name] = device_file_md5 print(f"Manifest for {device_name} : {device_file_md5}") + # git ls-tree fails in CI # git_cmd = ["git", "ls-tree", "master", "third_party/zap/repo"] # zap_commit = str(subprocess.check_output(git_cmd, cwd=_REPO_BASE_PATH)) # zap_commit = zap_commit.split(" ")[2] @@ -208,8 +209,7 @@ def main(argv: Sequence[str]) -> None: with open(ci_manifest_file_name, "r", encoding="utf-8") as ci_manifest_file: cached_manifest = json.loads(ci_manifest_file.read()) for device in ci_manifest: - if device != "zap_commit" and device == "lighting-app": - # Filter to one example + if device != "zap_commit": if cached_manifest[device] != ci_manifest[device]: print("Cached files out of date. Please run chef with the flag --generate_zzz and commit") exit(1) @@ -258,7 +258,7 @@ def main(argv: Sequence[str]) -> None: print(f"Generating files in {chef_zzz_root} for all devices") for device_dir_item in os.listdir(chef_devices_dir): target_file_ext = ".zap" - if device_dir_item.endswith(target_file_ext) and device_dir_item == 'lighting-app.zap': + if device_dir_item.endswith(target_file_ext) and device_dir_item in ci_allowlist: # Filter to one example device_name = device_dir_item[:-len(target_file_ext)] device_file_path = os.path.join(chef_devices_dir, device_dir_item)