[ci][attachconfig] remove some output

This commit is contained in:
guotong ma 2023-12-25 14:01:07 +08:00 committed by Rbb666
parent a490fd2391
commit 18c44e6cee
1 changed files with 19 additions and 9 deletions

View File

@ -12,18 +12,28 @@ def add_summary(text):
os.system(f'echo "{text}" >> $GITHUB_STEP_SUMMARY ;')
def run_cmd(cmd):
def run_cmd(cmd, output_info=True):
"""
run command and return output and result.
"""
print('\033[1;32m' + cmd + '\033[0m')
res = os.system(cmd + " > output.txt 2>&1")
output_str_list = []
if output_info:
res = os.system(cmd + " > output.txt 2>&1")
else:
res = os.system(cmd + " > /dev/null 2>output.txt")
with open("output.txt", "r") as file:
output = file.readlines()
for line in output:
output_str_list = file.readlines()
for line in output_str_list:
print(line, end='')
os.remove("output.txt")
return output, res
return output_str_list, res
def build_bsp(bsp):
@ -31,7 +41,7 @@ def build_bsp(bsp):
build bsp.
cd {rtt_root}
scons -C bsp/{bsp} --pyconfig-silent
scons -C bsp/{bsp} --pyconfig-silent > /dev/null
cd {rtt_root}/bsp/{bsp}
pkgs --update
@ -41,7 +51,7 @@ def build_bsp(bsp):
scons -C bsp/{bsp} -j{nproc} --debug=time
cd {rtt_root}/bsp/{bsp}
scons -c
scons -c > /dev/null
rm -rf packages
"""
@ -49,7 +59,7 @@ def build_bsp(bsp):
os.chdir(rtt_root)
if os.path.exists(f"{rtt_root}/bsp/{bsp}/Kconfig"):
os.chdir(rtt_root)
run_cmd(f'scons -C bsp/{bsp} --pyconfig-silent')
run_cmd(f'scons -C bsp/{bsp} --pyconfig-silent', output_info=False)
os.chdir(f'{rtt_root}/bsp/{bsp}')
run_cmd('pkgs --update')
@ -63,7 +73,7 @@ def build_bsp(bsp):
success = False
os.chdir(f'{rtt_root}/bsp/{bsp}')
run_cmd('scons -c')
run_cmd('scons -c', output_info=False)
pkg_dir = os.path.join(rtt_root, 'bsp', bsp, 'packages')
shutil.rmtree(pkg_dir, ignore_errors=True)