forked from FSLogix/Invoke-FslShrinkDisk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
55 lines (49 loc) · 2.05 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- master
pool:
vmImage: "windows-2019"
steps:
- task: PowerShell@2
displayName: "Install Newest Pester Version"
inputs:
targetType: "inline" # Optional. Options: filePath, inline
#filePath: # Required when targetType == FilePath
#arguments: # Optional
script: Install-Module -Name Pester -Force -SkipPublisherCheck
# Required when targetType == Inline
#errorActionPreference: 'stop' # Optional. Options: stop, continue, silentlyContinue
#failOnStderr: false # Optional
#ignoreLASTEXITCODE: false # Optional
#pwsh: false # Optional
#workingDirectory: # Optional
- task: PowerShell@2
displayName: "Run Pester Tests for Script"
inputs:
targetType: "inline" # Optional. Options: filePath, inline
#filePath: # Required when targetType == FilePath
#arguments: # Optional
script: Invoke-Pester -OutputFile PesterTest.xml -OutputFormat NUnitXml -CodeCoverage (Get-ChildItem .\functions -File -Recurse -Include *.ps1 | ? {$_.Name -ne 'Invoke-Parallel.ps1'}) -CodeCoverageOutputFile CodeCoverage.xml # Required when targetType == Inline
#errorActionPreference: 'stop' # Optional. Options: stop, continue, silentlyContinue
#failOnStderr: false # Optional
#ignoreLASTEXITCODE: false # Optional
#pwsh: false # Optional
#workingDirectory: # Optional
- task: PublishTestResults@2
inputs:
testRunTitle: "Pester Test Results"
buildPlatform: "Windows"
testRunner: "NUnit"
testResultsFiles: '.\PesterTest.xml'
mergeTestResults: false
failTaskOnFailedTests: true
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: "JaCoCo" # Options: cobertura, jaCoCo
summaryFileLocation: '.\CodeCoverage.xml'
#reportDirectory: # Optional
#additionalCodeCoverageFiles: # Optional
failIfCoverageEmpty: true # Optional