PowerShell/.vsts-ci/misc-analysis.yml
Travis Plunk 003a141f31
Remove directory causing static analysis failure (#8812)
Remove directory causing static analysis failure
2019-02-01 18:03:12 -08:00

67 lines
2 KiB
YAML

name: PR-$(System.PullRequest.PullRequestNumber)-$(Date:yyyyMMdd)$(Rev:.rr)
trigger:
# Batch merge builds together while a merge build is running
batch: true
branches:
include:
- master
- release*
paths:
exclude:
- /src/*
pr:
branches:
include:
- master
- release*
paths:
exclude:
- /src/*
resources:
- repo: self
clean: true
phases:
- phase: Linux_CI
queue:
name: Hosted Ubuntu 1604
steps:
- powershell: |
Get-ChildItem -Path env:
displayName: Capture environment
condition: succeededOrFailed()
- powershell: Install-module pester -Scope CurrentUser -Force -SkipPublisherCheck
displayName: Install Pester
condition: succeededOrFailed()
- bash: |
sudo npm install -g markdown-spellcheck@0.11.0
# Sometimes this folder is left behind with root permissions and is needed by later NPM installs which don't need sudo
sudo rm -rf ~/.npm/_cacache
displayName: Install mdspell
condition: succeededOrFailed()
- powershell: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))"
displayName: Set Build Name for Non-PR
condition: ne(variables['Build.Reason'], 'PullRequest')
- bash: |
mdspell '**/*.md' '!**/Pester/**/*.md' --ignore-numbers --ignore-acronyms --report --en-us;
displayName: Test Spelling
condition: succeededOrFailed()
- powershell: |
Import-module ./build.psm1
$path = Join-Path -Path $pwd -ChildPath './commonTestResults.xml'
$results = invoke-pester -Script ./test/common -OutputFile $path -OutputFormat NUnitXml -PassThru
Write-Host "##vso[results.publish type=NUnit;mergeResults=true;runTitle=Common Tests;publishRunAttachments=true;resultFiles=$path;]"
if($results.TotalCount -eq 0 -or $results.FailedCount -gt 0)
{
throw "markdown link tests failed"
}
displayName: Run Common Tests
condition: succeededOrFailed()