forked from homotechsual/NinjaOne
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pr-pipeline.azure-pipelines.yml
52 lines (48 loc) · 1.75 KB
/
pr-pipeline.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
# Docs: https://aka.ms/yaml
name: $(Build.DefinitionName)-$(Date:yyyyMMdd)
trigger:
- main
pool:
vmImage: 'vs2017-win2016'
variables:
- group: MSPsUK KeyVault
stages:
- stage: Setup
jobs:
- job: Setup
steps:
- powershell: .\bootstrap.ps1
displayName: 'Install pre-requisites'
- stage: Lint
jobs:
- job: Lint
steps:
- task: PowerShell@2
displayName: 'Lint with PS Script Analyzer'
inputs:
TargetType: filePath
PWSH: true
FilePath: '$(System.DefaultWorkingDirectory)\Tests\Test-WithPSScriptAnalyzer.ps1'
Arguments: '-ScriptDirectory $(System.DefaultWorkingDirectory)'
- stage: Test
jobs:
- job: TestandPublish
steps:
- task: Pester@10
inputs:
ScriptFolder: '$(System.DefaultWorkingDirectory)\*'
ResultsFile: '$(Common.TestResultsDirectory)\Pester-Results.xml'
CodeCoverageOutputFile: '$(Common.TestResultsDirectory)\Code-Coverage.xml'
UsePSCore: true
AdditionalModulePath: '$(Build.ArtifactStagingDirectory)'
- task: PublishTestResults@2
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '$(Common.TestResultsDirectory)\Pester-Results.xml'
searchFolder: '$(Common.TestResultsDirectory)'
failTaskOnFailedTests: true
- task: PublishCodeCoverageResults@1
inputs:
summaryFileLocation: '$(Common.TestResultsDirectory)\Code-Coverage.xml'
codeCoverageTool: 'JaCoCo'
pathToSources: '$(System.DefaultWorkingDirectory)'