Skip to content

Commit

Permalink
Improved sample pipelines. Upgrade tools to .NET 6
Browse files Browse the repository at this point in the history
  • Loading branch information
mtirion committed Jan 18, 2023
1 parent f353d29 commit 4fe360e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 34 deletions.
22 changes: 10 additions & 12 deletions PipelineExamples/documentation-build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
###########################################################################
# This is a sample pipeline that can be used for generating a documentation
# website using DocFX. In this pipeline we use the DocFxTocGenerator tool
# to generate the table of contents.
# This is a sample Azure DevOps pipeline that can be used for generating
# a documentation website using DocFX. In this pipeline we use the
# DocFxTocGenerator tool to generate the table of contents.
###########################################################################

trigger:
- none

Expand All @@ -19,18 +18,17 @@ steps:
- powershell: choco install docfx -y
displayName: Install docfx

# install the companion tools
- powershell: choco install docfx-companion-tools -y
displayName: Install docfx companion tools

# run the toc generator on /DocExamample folder
- task: DotNetCoreCLI@2
displayName: 'Building automatically toc.yml'
inputs:
command: 'run'
projects: '$(System.DefaultWorkingDirectory)/src/DocFxTocGenerator'
arguments: '-d $(System.DefaultWorkingDirectory)\DocExample -si'
- powershell: DocFxTocGenerator -d .\DocExamples -si
displayName: 'Generating TOC for .\DocExamples'

# run docfx
# run docfx to generate documentation website
- powershell: |
&docfx DocEample\docfx.json
if ($lastexitcode -ne 0)
{
throw [System.Exception] "docfx build failed with exit code $lastexitcode."
Expand Down
28 changes: 9 additions & 19 deletions PipelineExamples/documentation-validation.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
###########################################################################
# This is a sample pipeline that can be used for validating documentation.
# In this pipeline we use markdownlint and the DocLinkChecker tool.
# This is a sample Azure DevOps pipeline that can be used for validating
# documentation. In this pipeline we use markdownlint and the DocLinkChecker tool.
###########################################################################

trigger: none

pool:
Expand All @@ -22,19 +21,10 @@ jobs:
CONFIGFILE: $(System.DefaultWorkingDirectory)/.markdownlint.json
displayName: 'Run markdownlint'

# run DocLinkChecker to validate documentation links in \DocExample folder
- job:
displayName: 'Documentation links check'
steps:
- task: DotNetCoreCLI@2
displayName: 'Restore for DocLinkChecker'
inputs:
command: 'restore'
projects: '$(System.DefaultWorkingDirectory)/src/DocLinkChecker/DocLinkChecker/*.csproj'
feedsToUse: 'select'
- task: DotNetCoreCLI@2
displayName: 'Checking documentation links with DocLinkChecker'
inputs:
command: 'run'
projects: '$(System.DefaultWorkingDirectory)/src/DocLinkChecker/DocLinkChecker'
arguments: '-d $(System.DefaultWorkingDirectory)\DocExample -a'
# install the companion tools
- powershell: choco install docfx-companion-tools -y
displayName: Install docfx companion tools

# run the toc generator on /DocExamample folder
- powershell: DocLinkChecker -d .\DocExamples -a
displayName: 'Checking links in .\DocExamples'
2 changes: 1 addition & 1 deletion src/DocFxTocGenerator/DocFxTocGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/DocLanguageTranslator/DocLanguageTranslator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/DocLinkChecker/DocLinkChecker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>
Expand Down

0 comments on commit 4fe360e

Please sign in to comment.