Skip to content

Commit 28bed52

Browse files
authored
Merge pull request #369 from online-judge-tools/view-error-logs-links
Add links from generated documents to GitHub Actions when some tests fails
2 parents c73a7ff + f9f21f9 commit 28bed52

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

onlinejudge_verify/documentation/build.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ def _render_source_code_stat_for_page(
9898
data = _render_source_code_stat(stat, basedir=basedir)
9999
data['_pathExtension'] = path.suffix.lstrip('.')
100100
data['_verificationStatusIcon'] = _get_verification_status_icon(stat.verification_status)
101+
data['_isVerificationFailed'] = stat.verification_status in (VerificationStatus.LIBRARY_SOME_WA, VerificationStatus.LIBRARY_ALL_WA, VerificationStatus.TEST_WRONG_ANSWER)
101102

102103
def ext(relative_path: pathlib.Path) -> Dict[str, Any]:
103104
stat = source_code_stats_dict[relative_path]

onlinejudge_verify_resources/_includes/document_header.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ <h1>{{ page.data._verificationStatusIcon }} {{ page.title }}
99
<li>Problem: <a href="{{ page.data.attributes.PROBLEM }}">{{ page.data.attributes.PROBLEM }}</a></li>
1010
{% endif %}
1111
{% if page.data._pathExtension == "hpp" %}<li><a id="include-directive-anchor">Include: <code id="include-directive-code">#include "{{ page.data.path }}"</code></a></li>{% endif %}
12+
{% if page.data._isVerificationFailed %}<li>Link: <a href="{{ site.github.repository_url }}/actions">{{ page.data._verificationStatusIcon }} View error logs on GitHub Actions</a></li>{% endif %}
1213
{% for link in page.data.attributes.links %}
1314
{% if link != page.data.attributes.PROBLEM %}
1415
<li>Link: <a href="{{ link }}">{{ link }}</a></li>

0 commit comments

Comments
 (0)