Skip to content
Snippets Groups Projects
Commit 65de8b37 authored by s2870355's avatar s2870355
Browse files

added status bar

parent cf82244f
No related branches found
No related tags found
No related merge requests found
Pipeline #70783 failed
......@@ -118,31 +118,50 @@ def run_ci(compile_info : list[dict]) -> bool:
jobs = []
failed_jobs = []
current_jobs = []
waiting_count = len(compile_info)
running_count = 0
completed_count = 0
failed_count = 0
while len(jobs) != 0 or can_run_jon(compile_info) or len(current_jobs) != 0:
removed_job = None
for job in current_jobs:
poll = job["task"].poll()
if poll is not None:
running_count = running_count - 1
if job["task"].returncode != 0:
failed_count = failed_count + 1
print("failed: " + job['location'])
failed_jobs.append(job['location'])
removed_job = job
else:
completed_count = completed_count + 1
print("completed: " + job['location'])
compile_info = [remove_from_depends(r, job['location']) for r in compile_info]
removed_job = job
break
if removed_job is not None:
current_jobs.remove(removed_job)
print("\tcurrent: " + str([j['location'] for j in current_jobs]))
job["output"].close()
os.system("cls||clear")
print("\U0001f7e9" * (completed_count) + "\U0001f7e5" * failed_count + "\U0001f7ea" * running_count + "\u2B1C" * waiting_count)
print("current:")
for location in [j['location'] for j in current_jobs]:
print("\t" + location)
if can_run_jon(compile_info):
waiting_count = waiting_count - 1
running_count = running_count + 1
new_job = get_new_job(compile_info)
print(f"compiling: {new_job['location']}")
code = run_cli_parallel(new_job)
compile_info.remove(new_job)
current_jobs.append(code)
os.system("cls||clear")
print("\U0001f7e9" * (completed_count) + "\U0001f7e5" * failed_count + "\U0001f7ea" * running_count + "\u2B1C" * waiting_count)
print("current:")
for location in [j['location'] for j in current_jobs]:
print("\t" + location)
print(compile_info)
if len(failed_jobs) != 0:
print(f"failed {len(failed_jobs)} jobs:\n\t{failed_jobs}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment