rockstor / rockstor-doc

Rockstor documentation
http://rockstor.com/docs
Other
25 stars 30 forks source link

Treat warnings as errors when building docs #407 #408

Closed FroggyFlox closed 1 year ago

FroggyFlox commented 1 year ago

Fixes #407 @phillxnet, ready for review.

This pull request's proposal

We currently only use the default build options with make html. Switch to manually defining the sphinx-build command to use additional options. -E to use a clean environment every time, -W to treat warnings as errors and thus make the Github action fail (more easily detected), and --keep-going to list all warnings in a single run.

Testing

This branch was tested by creating a PR against my fork's master branch, which triggered the updated Github action. That branch contained 2 instances of underlines shorter than their title (similar to warnings in #406). This led to:

2023-01-28T16:27:55.9424206Z ##[group]Run sphinx-build -b html -E -W --keep-going . _build/html
(...)
2023-01-28T16:27:58.5238661Z /home/runner/work/rockstor-doc/rockstor-doc/data_loss.rst:4: WARNING: Title underline too short.
2023-01-28T16:27:58.5238941Z 
2023-01-28T16:27:58.5239151Z 
2023-01-28T16:27:58.5239546Z Data Loss-prevention and Recovery in Rockstor
2023-01-28T16:27:58.5240138Z ==================================
2023-01-28T16:27:58.5240745Z /home/runner/work/rockstor-doc/rockstor-doc/data_loss.rst:44: WARNING: Title underline too short.
2023-01-28T16:27:58.5241009Z 
2023-01-28T16:27:58.5241108Z Pool drive count advice
(...)
2023-01-28T16:28:01.1993940Z build finished with problems, 2 warnings.
2023-01-28T16:28:01.2975596Z ##[error]Process completed with exit code 1.

The "checks" summary thus looked like: image

Checklist

phillxnet commented 1 year ago

@FroggyFlox Thanks for stepping up to this one. Much appreciated. I'll merge now directly.