-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathazure-pipelines.yml
70 lines (59 loc) · 1.91 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Azure DevOps
# Build pipeline for PSRule
strategy:
matrix:
Linux:
imageName: 'ubuntu-16.04'
MacOS:
imageName: 'macos-10.13'
Windows:
imageName: 'vs2017-win2016'
publishModule: 'true'
variables:
buildConfiguration: 'Release'
version: '0.3.0'
# Use build number format, i.e. 0.1.0-B181101
name: $(version)-B$(date:yyMM)$(rev:rr)
trigger:
- master
pool:
vmImage: $(imageName)
steps:
# Install pipeline dependencies and build module
- powershell: ./scripts/pipeline-build.ps1 -File ./PSRule.build.ps1 -Configuration $(buildConfiguration) -ModuleVersion $(Build.BuildNumber) -ReleaseVersion "$(Release.Version)"
displayName: 'Build module'
# Run module benchmark
- powershell: ./scripts/pipeline-build.ps1 -Task Benchmark -File ./PSRule.build.ps1 -Configuration $(buildConfiguration) -ModuleVersion $(Build.BuildNumber) -ReleaseVersion "$(Release.Version)"
displayName: 'Benchmark'
condition: eq(variables['benchmark'], 'true')
# DotNet test results
- task: PublishTestResults@2
displayName: 'Publish unit test results'
inputs:
testRunTitle: 'DotNet on $(imageName)'
testRunner: VSTest
testResultsFiles: 'reports/*.trx'
mergeTestResults: true
platform: $(imageName)
configuration: $(buildConfiguration)
publishRunAttachments: true
condition: succeededOrFailed()
# Pester test results
- task: PublishTestResults@2
displayName: 'Publish Pester results'
inputs:
testRunTitle: 'Pester on $(imageName)'
testRunner: NUnit
testResultsFiles: 'reports/*.xml'
mergeTestResults: true
platform: $(imageName)
configuration: $(buildConfiguration)
publishRunAttachments: true
condition: succeededOrFailed()
# Generate artifacts
- task: PublishBuildArtifacts@1
displayName: 'Publish PSRule module'
inputs:
PathtoPublish: out/modules/PSRule
ArtifactName: PSRule
condition: and(succeeded(), eq(variables['publishModule'], 'true'))