Skip to content
Snippets Groups Projects
Commit 14467203 authored by Austin Anderson's avatar Austin Anderson
Browse files

Tweak badge generation

parent d2fc0879
Branches
No related tags found
No related merge requests found
...@@ -239,9 +239,10 @@ print(template.render( ...@@ -239,9 +239,10 @@ print(template.render(
# Maybe the print statement above should be using an output file instead. # Maybe the print statement above should be using an output file instead.
for category in YAML_CONFIG["badges"]: for category in YAML_CONFIG["badges"]:
total = len(by_group[category]) total = len(by_group[category])
failing = total - sum([jobs[0]["passing"] for name, jobs in by_group[category].items()]) passed = sum([jobs[0]["passing"] for name, jobs in by_group[category].items()])
failed = total - passed
if failing == 0: if failing == 0:
url = f"https://img.shields.io/static/v1?label={category}&message=passing&color=success" url = f"https://img.shields.io/static/v1?label={category}&message={passed} passed, 0 failed&color=success"
else: else:
url = f"https://img.shields.io/static/v1?label={category}&message={failing}/{total} failing&color=critical" url = f"https://img.shields.io/static/v1?label={category}&message={passed} passed, {failed} failed&color=critical"
subprocess.run(["wget", url, "-O", f"{category}.svg"]) subprocess.run(["wget", url, "-O", f"{category}.svg"])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment