Skip to content

Commit 6e42dfe

Browse files
committed
2 parents 4c339bd + e011416 commit 6e42dfe

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

azure-pipelines.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,14 @@ pool:
1111

1212
steps:
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
@@ -28,4 +34,9 @@ steps:
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)'

0 commit comments

Comments
 (0)