dotnet / docfx

Static site generator for .NET API documentation.
https://dotnet.github.io/docfx/
MIT License
4.02k stars 853 forks source link

Making the build fail if there is a warnings in the log #6894

Open bitbonk opened 3 years ago

bitbonk commented 3 years ago

Operating System: Windows

DocFX Version Used: 2.56.5.0

Template used: custom template

Steps to Reproduce:

  1. Run a build on any CI build server or in a script (e.g. .ps1 or .cmd) where either docfx metadata, docfx build or docfx pdf produces at least one warning (e.g. because a a link cannot be resolved).

Expected Behavior: The CI build fails or the script fails or there should be means to make it fail in such a situation.

Actual Behavior: The CI build does not fail and there are no means to make it fail in such a situation.

pascalberger commented 3 years ago

When using Cake for running DocFx the Cake.Issues.DocFx addin can be used to parse the log file for warnings and break the build afterwards. See here for an example how to use the addin.

bitbonk commented 3 years ago

I switched from Cake to Nuke a while ago. The same thing will be possible there too once @matkoch and @billhenn have merged https://github.com/nuke-build/nuke/pull/629

KalleOlaviNiemitalo commented 3 years ago

The Warnings Next Generation plugin for Jenkins can parse log files generated by DocFX v2.