Skip to content

Commit

Permalink
[action] rename yml file
Browse files Browse the repository at this point in the history
  • Loading branch information
supperthomas committed Nov 4, 2024
1 parent ea7ee04 commit 3f4cc6c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
File renamed without changes.
26 changes: 14 additions & 12 deletions tools/ci/bsp_buildings.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,27 +160,28 @@ def build_bsp_attachconfig(bsp, attach_file):
print("::endgroup::")

yml_files_content = []
directory = os.path.join(rtt_root, 'bsp', bsp)
ci_file_path = os.path.join(directory, 'ci.yml')
if os.path.exists(ci_file_path):
with open(ci_file_path, 'r') as file:
content = yaml.safe_load(file)
yml_files_content.append(content)
directory = os.path.join(rtt_root, 'bsp', bsp, '.ci/attachconfig')
if os.path.exists(directory):
for filename in os.listdir(directory):
if filename.endswith('attachconfig.yml'):
file_path = os.path.join(directory, filename)
if os.path.exists(file_path):
with open(file_path, 'r') as file:
content = yaml.safe_load(file)
yml_files_content.append(content)

config_file = os.path.join(rtt_root, 'bsp', bsp, '.config')

for projects in yml_files_content:
for name, details in projects.items():

# 把kconfig 放到.config里面,然后执行scons编译
config_bacakup = config_file+'.origin'
shutil.copyfile(config_file, config_bacakup)
with open(config_file, 'a') as destination:
for line in details.get('kconfig'):
destination.write(line + '\n')
scons_arg = details.get('scons_arg')
scons_arg_str = scons_arg[0] if scons_arg else ' '
print(f"::group::\tCompiling yml project: =={name}=scons_arg={scons_arg_str}==")
print(f"::group::\tCompiling yml project: =={count}==={name}=scons_arg={scons_arg_str}==")
res = build_bsp(bsp, scons_arg_str)
if not res:
print(f"::error::build {bsp} {name} failed.")
Expand All @@ -197,9 +198,10 @@ def build_bsp_attachconfig(bsp, attach_file):
attach_list = []
for root, dirs, files in os.walk(attach_dir):
for file in files:
file_path = os.path.join(root, file)
relative_path = os.path.relpath(file_path, attach_dir)
attach_list.append(relative_path)
if file.endswith('attach'):
file_path = os.path.join(root, file)
relative_path = os.path.relpath(file_path, attach_dir)
attach_list.append(relative_path)

for attach_file in attach_list:
count += 1
Expand Down

0 comments on commit 3f4cc6c

Please sign in to comment.