diff options
| author | Supper Thomas <[email protected]> | 2025-03-23 12:38:27 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-03-23 12:38:27 +0800 |
| commit | 151c7a6112ed1d29bfd5534e6525fd1263f77606 (patch) | |
| tree | 9b6b79ba209f191378047b2ca6029eefe9a8684f /tools | |
| parent | cdb5ce8d04c4c0395f625af717091ea0f227007f (diff) | |
[action/ci] 把每次编译结果上传到github (#10135)
* [action/ci] 把每次编译结果上传到github
* [fix]
* add output
* fix
* fixthe attach_file_name
* fix
* fix name
* [action] 更新一下toolchain的版本号
* [bsp/stm32] hex 生成
* Update type.h
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/ci/bsp_buildings.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/tools/ci/bsp_buildings.py b/tools/ci/bsp_buildings.py index 8b182df63d..8ba412a779 100644 --- a/tools/ci/bsp_buildings.py +++ b/tools/ci/bsp_buildings.py @@ -36,7 +36,7 @@ def run_cmd(cmd, output_info=True): return output_str_list, res -def build_bsp(bsp, scons_args=''): +def build_bsp(bsp, scons_args='',name='default'): """ build bsp. @@ -57,6 +57,7 @@ def build_bsp(bsp, scons_args=''): """ success = True os.chdir(rtt_root) + os.makedirs(f'{rtt_root}/output/bsp/{bsp}', exist_ok=True) if os.path.exists(f"{rtt_root}/bsp/{bsp}/Kconfig"): os.chdir(rtt_root) run_cmd(f'scons -C bsp/{bsp} --pyconfig-silent', output_info=False) @@ -67,18 +68,23 @@ def build_bsp(bsp, scons_args=''): nproc = multiprocessing.cpu_count() os.chdir(rtt_root) - cmd = f'scons -C bsp/{bsp} -j{nproc} {scons_args} --debug=time' + cmd = f'scons -C bsp/{bsp} -j{nproc} {scons_args}' # --debug=time for debug time __, res = run_cmd(cmd, output_info=True) if res != 0: success = False + else: + #拷贝当前的文件夹下面的所有以elf结尾的文件拷贝到rt-thread/output文件夹下 + import glob + # 拷贝编译生成的文件到output目录,文件拓展为 elf,bin,hex + for file_type in ['*.elf', '*.bin', '*.hex']: + files = glob.glob(f'{rtt_root}/bsp/{bsp}/{file_type}') + for file in files: + shutil.copy(file, f'{rtt_root}/output/bsp/{bsp}/{name.replace("/", "_")}.{file_type[2:]}') os.chdir(f'{rtt_root}/bsp/{bsp}') run_cmd('scons -c', output_info=False) - #pkg_dir = os.path.join(rtt_root, 'bsp', bsp, 'packages') - #shutil.rmtree(pkg_dir, ignore_errors=True) - return success @@ -145,7 +151,7 @@ def build_bsp_attachconfig(bsp, attach_file): scons_args = check_scons_args(attach_path) - res = build_bsp(bsp, scons_args) + res = build_bsp(bsp, scons_args,name=attach_file) shutil.copyfile(config_bacakup, config_file) os.remove(config_bacakup) @@ -220,7 +226,7 @@ if __name__ == "__main__": scons_arg.append(line) scons_arg_str=' '.join(scons_arg) if scons_arg else ' ' print(f"::group::\tCompiling yml project: =={count}==={name}=scons_arg={scons_arg_str}==") - res = build_bsp(bsp, scons_arg_str) + res = build_bsp(bsp, scons_arg_str,name=name) if not res: print(f"::error::build {bsp} {name} failed.") add_summary(f'\t- ❌ build {bsp} {name} failed.') |
