(action,attachconfig,attachconfig_result)
| 52 | print("\033[32m✅ AttachConfig add success!\033[0m") |
| 53 | |
| 54 | def GetAttachConfig(action,attachconfig,attachconfig_result): |
| 55 | rtt_root = os.getcwd() |
| 56 | yml_files_content = [] |
| 57 | directory = os.path.join(rtt_root, 'rtt_root', rtt_root, '.ci/attachconfig') |
| 58 | if os.path.exists(directory): |
| 59 | for root, dirs, files in os.walk(directory): |
| 60 | for filename in files: |
| 61 | if filename.endswith('attachconfig.yml'): |
| 62 | file_path = os.path.join(root, filename) |
| 63 | if os.path.exists(file_path): |
| 64 | try: |
| 65 | with open(file_path, 'r') as file: |
| 66 | content = yaml.safe_load(file) |
| 67 | if content is None: |
| 68 | continue |
| 69 | yml_files_content.append(content) |
| 70 | except yaml.YAMLError as e: |
| 71 | print(f"::error::Error parsing YAML file: {e}") |
| 72 | continue |
| 73 | except Exception as e: |
| 74 | print(f"::error::Error reading file: {e}") |
| 75 | continue |
| 76 | for projects in yml_files_content: |
| 77 | for name, details in projects.items(): |
| 78 | if details.get("kconfig") is None: |
| 79 | continue |
| 80 | if(projects.get(name) is not None): |
| 81 | if action == "get": |
| 82 | attachconfig.append(name) |
| 83 | if action == "search" and name == attachconfig: |
| 84 | from ci.bsp_buildings import get_details_and_dependencies |
| 85 | detail_list=get_details_and_dependencies([name],projects) |
| 86 | for line in detail_list: |
| 87 | attachconfig_result.append(line) |
no test coverage detected