-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
69 lines (64 loc) · 2.19 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
name: $(TeamProject)_$(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
trigger:
- master
- refs/tags/*
pr:
- master
jobs:
- job: Test_Build_Deploy
pool:
vmImage: 'vs2017-win2016'
steps:
- task: Powershell@2
displayName: 'Test'
inputs:
targetType: 'filePath'
filePath: .\Build\Start-Build.ps1
arguments: -Task Test -Verbose
errorActionPreference: 'stop'
failOnStderr: true
- task: PublishTestResults@2
displayName: 'Publish Test Results'
condition: and(always(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
testRunner: 'NUnit'
testResultsFiles: '**/TestResults.xml'
testRunTitle: 'PS_Win2016'
- task: reportgenerator@4
displayName: 'Generate Code Coverage Report'
condition: and(always(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
reports: 'TestCoverage.xml'
reporttypes: 'HtmlInline_AzurePipelines_Dark'
sourcedirs: $(CodeCoverageDirectories)
targetdir: coveragereport
- task: PublishCodeCoverageResults@1
displayName: 'Publish Code Coverage Results'
condition: and(always(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
codeCoverageTool: 'JaCoCo'
summaryFileLocation: '**/TestCoverage.xml'
- task: Powershell@2
displayName: 'Set build version'
condition: and(always(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
env:
BUILD_NAME: $(Build.BuildNumber)
GITHUB_PAT: $(github.pat)
inputs:
targetType: 'filePath'
filePath: .\Build\Start-Build.ps1
arguments: -Task SetBuildVersion -Verbose
errorActionPreference: 'stop'
failOnStderr: true
- task: Powershell@2
displayName: 'Build and deploy'
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
env:
GITHUB_PAT: $(github.pat)
PSREPO_APIKEY: $(psrepo.apikey)
inputs:
targetType: 'filePath'
filePath: .\Build\Start-Build.ps1
arguments: -Task Deploy -Verbose
errorActionPreference: 'stop'
failOnStderr: true