Skip to content

Commit

Permalink
Merge pull request #171 from MetRonnie/status
Browse files Browse the repository at this point in the history
Fix status page
  • Loading branch information
oliver-sanders authored Jul 28, 2023
2 parents 0811871 + 7168b8f commit 57309e2
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 23 deletions.
2 changes: 1 addition & 1 deletion docs/status/branches.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
},
"branch_actions": {
"cylc/cylc-flow": ["test_fast", "test_functional", "build", "test_conda-build"],
"cylc/cylc-flow": ["test_fast", "test_functional", "bash", "build", "test_manylinux", "test_conda-build", "test_tutorial_workflow"],
"cylc/cylc-rose": ["tests"],
"cylc/cylc-uiserver": ["test", "build"],
"cylc/cylc-doc": ["test"],
Expand Down
6 changes: 6 additions & 0 deletions docs/status/build
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ def render(data_file, template_file, output_file):
env = Environment(**kwargs).from_string(template_code)

with open(output_file, 'w') as output_fh:
output_fh.write(
"<!-- This file is auto-generated, please do not edit it directly."
"\n\n"
"Please edit `branches.json` and raise a pull request, this file "
"will be automatically regenerated on merge. -->\n"
)
output_fh.write(
env.render(data)
)
Expand Down
52 changes: 30 additions & 22 deletions docs/status/template.md.jinja2
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
{#
This template/markdown file is auto-generated, please do not edit it directly.
Please edit `branches.json` and raise a pull request, this fille will be
automatically regenerated on merge.
#}

{% macro badge(repo, branch, action) -%}
[![{{ action }}](https://github.com/{{ repo }}/actions/workflows/{{ action }}.yml/badge.svg?branch={{ branch }})](https://github.com/{{ repo }}/actions/workflows/{{ action }}.yml)
{% macro badge(repo, branch, workflow) -%}
[![{{ workflow }}](https://github.com/{{ repo }}/actions/workflows/{{ workflow }}.yml/badge.svg?branch={{ branch }})](https://github.com/{{ repo }}/actions/workflows/{{ workflow }}.yml?query=branch%3A{{ branch }})
{%- endmacro %}

{% macro format_repo(repo) -%}
Expand All @@ -19,9 +10,9 @@ automatically regenerated on merge.
[{{ branch }}](https://github.com/{{ repo }}/tree/{{ branch }})
{%- endmacro %}

{%- macro format_actions(repo, branch, actions) -%}
{%- for action in actions -%}
{{ badge(repo, branch, action) }}
{%- macro format_actions(repo, branch, workflows) -%}
{%- for workflow in workflows -%}
{{ badge(repo, branch, workflow) }}
{%- if not loop.last %} {% endif -%}
{%- endfor -%}
{%- endmacro -%}
Expand All @@ -30,19 +21,36 @@ automatically regenerated on merge.

## Nightly Builds

| repo | actions |
|:---|:---|
{% for repo, actions in nightly_actions.items() %}
| {{ format_repo(repo) }} | {{ format_actions(repo, 'master', actions) }} |
<table>
<tr>
<th>repo</th>
<th>workflows</th>
</tr>
{% for repo, workflows in nightly_actions.items() %}
<tr>
<td>{{ format_repo(repo) }}</td>
<td>{{ format_actions(repo, 'master', workflows) }}</td>
</tr>
{%- endfor %}
</table>

## Branches

{% for meta_release, components in meta_releases.items() %}
### {{ meta_release }}
| repo | branch | actions |
|:---|:---|:---|

<table>
<tr>
<th>repo</th>
<th>branch</th>
<th>workflows</th>
</tr>
{% for repo, branch in components.items() -%}
| {{ format_repo(repo) }} | {{ format_branch(repo, branch) }} | {{ format_actions(repo, branch, branch_actions.get(repo, [])) }} |
{% endfor %}
<tr>
<td>{{ format_repo(repo) }}</td>
<td>{{ format_branch(repo, branch) }}</td>
<td>{{ format_actions(repo, branch, branch_actions.get(repo, [])) }}</td>
</tr>
{%- endfor %}
</table>
{% endfor %}

0 comments on commit 57309e2

Please sign in to comment.