File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111
1212steps :
1313- powershell : |
14- Install-Module PSScriptAnalyzer -Scope Currentuser
15- Invoke-Pester -Path ./Tests -OutputFormat NUnitXml -OutputFile TestResults.xml -PassThru
14+ Install-Module PSScriptAnalyzer -Scope Currentuser -SkipPublisherCheck -Force
15+ $TestResults = Invoke-Pester -Path ./Tests -OutputFormat NUnitXml -OutputFile TestResults.xml -PassThru
16+
17+ if ($TestResults.FailedCount -gt 0) {
18+ Throw "Failed '$($TestResults.FailedCount)' tests, build failed"
19+ Exit
20+ }
21+
1622 displayName : ' Pester'
1723
1824- task : PublishTestResults@2
2834 $NewVersion = "{0}.{1}.{2}" -f $version.Major,$version.Minor,($version.Build + 1)
2935
3036 Write-Host New SemVer is: $NewVersion
31- displayName : New Semver
37+ Write-Host "##vso[task.setvariable variable=Build.SemVerId;]$NewVersion"
38+ displayName : New Semver
39+ - task : PowerShell@2
40+ inputs :
41+ filePath : ' Publish-ToPSGallery.ps1'
42+ arguments : ' -nuGetApiKey $(PSGallery_PAT) -moduleVersion $(Build.SemVerId)'
You can’t perform that action at this time.
0 commit comments