d176853672
* move markdown lint tests * move markdown link tests * refactor static link analysis into a matrix * cache yarn packages * fix paramater name
57 lines
1.7 KiB
YAML
57 lines
1.7 KiB
YAML
jobs:
|
|
- job: markdown
|
|
displayName: Markdown Spelling
|
|
|
|
pool:
|
|
vmImage: ubuntu-20.04
|
|
|
|
variables:
|
|
- name: repoPath
|
|
value: $(Agent.BuildDirectory)/$(repoFolder)
|
|
|
|
steps:
|
|
- checkout: self
|
|
clean: true
|
|
path: $(repoFolder)
|
|
|
|
- checkout: ComplianceRepo
|
|
|
|
- powershell: |
|
|
Get-ChildItem -Path env:
|
|
displayName: Capture Environment
|
|
condition: succeededOrFailed()
|
|
|
|
- bash: |
|
|
curl -o- --progress-bar -L https://yarnpkg.com/install.sh | bash
|
|
displayName: Bootstrap Yarn
|
|
condition: succeededOrFailed()
|
|
|
|
- bash: |
|
|
sudo yarn global add markdown-spellcheck@0.11.0
|
|
displayName: Install mdspell
|
|
condition: succeededOrFailed()
|
|
|
|
- bash: |
|
|
mdspell '**/*.md' '!**/Pester/**/*.md' '!**/dotnet-tools/**/*.md' --ignore-numbers --ignore-acronyms --report --en-us;
|
|
displayName: Test Spelling in Markdown
|
|
condition: succeededOrFailed()
|
|
workingDirectory: '$(repoPath)'
|
|
|
|
- ${{ if not(contains(variables['SYSTEM.COLLECTIONURI'],'mscodehub')) }}:
|
|
- pwsh: |
|
|
Import-module ./build.psm1
|
|
$path = Join-Path -Path $pwd -ChildPath './commonTestResults.xml'
|
|
$results = invoke-pester -Script ./test/common/markdown-lint -OutputFile $path -OutputFormat NUnitXml -PassThru
|
|
Write-Host "##vso[results.publish type=NUnit;mergeResults=true;runTitle=Markdown Lint;publishRunAttachments=true;resultFiles=$path;]"
|
|
if($results.TotalCount -eq 0 -or $results.FailedCount -gt 0)
|
|
{
|
|
throw "Markdown tests failed"
|
|
}
|
|
displayName: Run Markdown Lint Tests
|
|
condition: succeededOrFailed()
|
|
workingDirectory: '$(repoPath)'
|
|
|
|
- template: dailyBuildCompliance.yml@ComplianceRepo
|
|
parameters:
|
|
sourceScanPath: '$(repoPath)'
|