Skip to content

Commit 8abba04

Browse files
committed
Output errors in the job summary
1 parent 39dee6e commit 8abba04

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

.github/workflows/build.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,19 @@ jobs:
5858
path: output/${{ matrix.languageCode }}
5959
key: docs-output-${{ matrix.languageCode }}
6060
- name: Build the documentation (${{ matrix.languageCode }})
61-
run: make html-${{ matrix.languageCode }} SPHINXOPTS='-n -W -a'
62-
- name: Build the documentation and show all errors
61+
# -n (Run in nitpicky mode. This generates warnings for all missing references)
62+
# -a (Always write all output files, even if there is no changes)
63+
# -W (Turn warnings into errors)
64+
# NOTE: Changed in version 8.1: sphinx-build no longer exits on the first warning,
65+
# NOTE: but instead runs the entire build and exits with exit status 1 if any warnings were generated.
66+
# NOTE: This behaviour was previously enabled with --keep-going.
67+
# -w (Warnings file)
68+
run: make html-${{ matrix.languageCode }} SPHINXOPTS='-n -W -a -w /tmp/sphinx-warnings.txt --keep-going'
69+
- name: Report all errors
6370
if: ${{ failure() }}
64-
# This mode will not exit on the first error and will display all of them
65-
run: make html-${{ matrix.languageCode }} SPHINXOPTS='-n -a'
71+
# TODO: format errors like '::error file={name},line={line},endLine={endLine},title={title}::{message}'
72+
run: |
73+
echo '### Errors for ${{ matrix.languageCode }}' >> $GITHUB_STEP_SUMMARY
74+
echo '```' >> $GITHUB_STEP_SUMMARY
75+
sed "s,$PWD/,," /tmp/sphinx-warnings.txt >> $GITHUB_STEP_SUMMARY
76+
echo '```' >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)