Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions build/pipelines/templates/run-staticAnalysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,18 @@ steps:
- powershell: |
$results = Invoke-ScriptAnalyzer -Path ./ –Recurse
$results | ForEach-Object { Write-Host "##vso[task.logissue type=$($_.Severity);sourcepath=$($_.ScriptPath);linenumber=$($_.Line);columnnumber=$($_.Column);]$($_.Message)" }

$null = New-Item -Path ..\ -Name ScriptAnalyzer -ItemType Directory -Force
./build/scripts/ConvertTo-NUnitXml.ps1 -ScriptAnalyzerResult $results -Path ../ScriptAnalyzer/test-results.xml
workingDirectory: '$(System.DefaultWorkingDirectory)'
displayName: 'Run Static Code Analysis (PSScriptAnalyzer)'

- task: PublishTestResults@2
displayName: 'Publish ScriptAnalyzer Test Results'
inputs:
testRunTitle: 'Windows Test Results for PSScriptAnalyzer'
buildPlatform: 'Windows'
testRunner: NUnit
testResultsFiles: '../ScriptAnalyzer/test-results.xml'
failTaskOnFailedTests: true # required to fail build when tests fail
condition: succeededOrFailed()
Loading