From 2832b325241918d1e01d90bddb27515c916c1655 Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Thu, 27 Jan 2022 03:06:09 +0700 Subject: [PATCH 1/5] Add --warningsAsErrors flag to DocFX --- build.fsx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/build.fsx b/build.fsx index 8c00398bda4..6339b45a386 100644 --- a/build.fsx +++ b/build.fsx @@ -632,12 +632,19 @@ Target "DocFx" (fun _ -> Version = "0.1.0-alpha-1611021200" OutputDirectory = currentDirectory @@ "tools" }) "msdn.4.5.2" - let docsPath = "./docs" - DocFx (fun p -> - { p with - Timeout = TimeSpan.FromMinutes 30.0; - WorkingDirectory = docsPath; - DocFxJson = docsPath @@ "docfx.json" }) + let docsPath = FullName "./docs" + let docFxPath = FullName(findToolInSubPath "docfx.exe" "tools/docfx.console/tools") + + let args = StringBuilder() + |> append (docsPath @@ "docfx.json" ) + |> append ("--warningsAsErrors") + |> toText + + let result = ExecProcess(fun info -> + info.FileName <- docFxPath + info.WorkingDirectory <- (Path.GetDirectoryName (FullName docFxPath)) + info.Arguments <- args) (System.TimeSpan.FromMinutes 45.0) (* Reasonably long-running task. *) + if result <> 0 then failwithf "DocFX failed. %s %s" docFxPath args ) FinalTarget "KillCreatedProcesses" (fun _ -> From ef26c28168e765a294965257255ceb9c140ee876 Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Thu, 27 Jan 2022 05:13:12 +0700 Subject: [PATCH 2/5] Add check in AzDo pr validation yaml --- build-system/pr-validation.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build-system/pr-validation.yaml b/build-system/pr-validation.yaml index eb8accd0fa7..b8747c13631 100644 --- a/build-system/pr-validation.yaml +++ b/build-system/pr-validation.yaml @@ -124,6 +124,16 @@ jobs: outputDirectory: "TestResults" artifactName: "net_core_tests_linux-$(Build.BuildId)" + - template: azure-pipeline.template.yaml + parameters: + name: "docfx_test" + displayName: "DocFX warning check" + vmImage: "ubuntu-18.04" + scriptFileName: "./build.sh" + scriptArgs: docfx incremental + outputDirectory: "TestResults" + artifactName: "docfx_test-$(Build.BuildId)" + - template: azure-pipeline.template.yaml parameters: name: "net_5_tests_windows" From 22a70464dd279ead17419904e91184c3a317e17d Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Thu, 27 Jan 2022 05:26:51 +0700 Subject: [PATCH 3/5] Use windows image for docfx test --- build-system/pr-validation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-system/pr-validation.yaml b/build-system/pr-validation.yaml index b8747c13631..50b5ef38a4c 100644 --- a/build-system/pr-validation.yaml +++ b/build-system/pr-validation.yaml @@ -128,7 +128,7 @@ jobs: parameters: name: "docfx_test" displayName: "DocFX warning check" - vmImage: "ubuntu-18.04" + vmImage: "windows-2019" scriptFileName: "./build.sh" scriptArgs: docfx incremental outputDirectory: "TestResults" From bd39b8b9314461203633e8069cda695ef40e3b4d Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Thu, 27 Jan 2022 05:33:23 +0700 Subject: [PATCH 4/5] Fix build script name --- build-system/pr-validation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-system/pr-validation.yaml b/build-system/pr-validation.yaml index 50b5ef38a4c..f0102cd3db3 100644 --- a/build-system/pr-validation.yaml +++ b/build-system/pr-validation.yaml @@ -129,7 +129,7 @@ jobs: name: "docfx_test" displayName: "DocFX warning check" vmImage: "windows-2019" - scriptFileName: "./build.sh" + scriptFileName: build.cmd scriptArgs: docfx incremental outputDirectory: "TestResults" artifactName: "docfx_test-$(Build.BuildId)" From f656da018e3450f3b8478f5021cfedaf552ae813 Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Fri, 11 Feb 2022 08:00:15 -0600 Subject: [PATCH 5/5] disable incremental builds for DocFx --- build-system/pr-validation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-system/pr-validation.yaml b/build-system/pr-validation.yaml index b12fa9d06a9..dd3ddd6538a 100644 --- a/build-system/pr-validation.yaml +++ b/build-system/pr-validation.yaml @@ -130,7 +130,7 @@ jobs: displayName: "DocFX warning check" vmImage: "windows-2019" scriptFileName: build.cmd - scriptArgs: docfx incremental + scriptArgs: docfx outputDirectory: "TestResults" artifactName: "docfx_test-$(Build.BuildId)"