forked from homotechsual/HaloAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pr-pipeline.azure-pipelines.yml
59 lines (56 loc) · 2.05 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
53
54
55
56
57
58
59
# Docs: https://aka.ms/yaml
name: $(Build.DefinitionName)-$(Date:yyyyMMdd)
trigger: none
pr:
branches:
include:
- develop
- main
pool:
vmImage: 'windows-latest'
variables:
- group: MSPsUK KeyVault
stages:
- stage: Lint
jobs:
- job: Setup
steps:
- powershell: .\Bootstrap.ps1
displayName: 'Install pre-requisites'
- job: Lint
dependsOn: Setup
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: TestandPublishResults
steps:
- task: Pester@10
env:
HaloTestingURL: $(HaloTestingURL)
HaloTestingClientID: $(HaloTestingClientID)
HaloTestingClientSecret: $(HaloTestingClientSecret)
HaloTestingTenant: $(HaloTestingTenant)
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)'