-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
145 lines (122 loc) · 5.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: '$(DayOfYear)$(Rev:rr)'
trigger:
- master
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
verbosity: 'normal'
minNetcoreVer: 'netcoreapp2.1'
maxNetcoreVer: 'netcoreapp3.1'
netstandardName: 'netstandard2.1'
frameworkToDescribe: 'netcoreapp3.1'
netfxName: 'net48'
windowsImage: 'windows-2019'
strategy:
matrix:
windows:
imageName: 'windows-2019'
buildConfiguration: 'Release'
buildNetfx: 'true'
dotnetExeExtension: '.exe'
#linux:
# imageName: 'ubuntu-16.04'
# buildConfiguration: 'Netcore_Release'
# dotnetExeExtension: ''
pool:
vmImage: $(imageName)
steps:
#----------------------------------------------------------------------------------------------------
# Install tools & netcore x64
#----------------------------------------------------------------------------------------------------
- task: NuGetToolInstaller@0
- task: UseDotNet@2
displayName: 'Install .net core 2.1'
inputs:
packageType: sdk
version: 2.1.x
installationPath: $(Agent.ToolsDirectory)/dotnet
- task: UseDotNet@2
displayName: 'Install .net core 3.1'
inputs:
packageType: sdk
version: 3.1.x
installationPath: $(Agent.ToolsDirectory)/dotnet
#----------------------------------------------------------------------------------------------------
# Build
#----------------------------------------------------------------------------------------------------
- task: DotNetCoreCLI@2
displayName: 'Main Build without tests'
inputs:
command: build
projects: 'SimpleProcessFramework.sln'
arguments: '-c $(buildConfiguration)_NoTests -v $(verbosity) /p:OfficialBuildNumber=$(Build.BuildNumber)'
- task: DotNetCoreCLI@2
displayName: 'Full Build'
inputs:
command: build
projects: 'SimpleProcessFramework.sln'
arguments: '-c $(buildConfiguration) -v $(verbosity) /p:OfficialBuildNumber=$(Build.BuildNumber)'
#----------------------------------------------------------------------------------------------------
# Manually install netcore x86 (runtime only)
#----------------------------------------------------------------------------------------------------
- task: PowerShell@2
displayName: 'Netcore 2.1 x86'
inputs:
filePath: '$(Build.SourcesDirectory)/ManualInstallDotnet.ps1'
arguments: '-Version 2.1 -CliPath $(Agent.ToolsDirectory)/dotnet32 -Arch x86'
- task: PowerShell@2
displayName: 'Netcore 3.1 x86'
inputs:
filePath: '$(Build.SourcesDirectory)/ManualInstallDotnet.ps1'
arguments: '-Version 3.1 -CliPath $(Agent.ToolsDirectory)/dotnet32 -Arch x86 -NoDownloadScript'
- script: 'echo "##vso[task.setvariable variable=SPFX_DOTNET_EXE_PATH;]$(Agent.ToolsDirectory)/dotnet/dotnet$(dotnetExeExtension)'
displayName: Set SPFX_DOTNET_EXE_PATH
- script: 'echo "##vso[task.setvariable variable=SPFX_DOTNET_EXE_PATH32;]$(Agent.ToolsDirectory)/dotnet32/dotnet$(dotnetExeExtension)'
displayName: Set SPFX_DOTNET_EXE_PATH32
#----------------------------------------------------------------------------------------------------
# Tests
#----------------------------------------------------------------------------------------------------
- script: '$(Build.SourcesDirectory)/bin/$(buildConfiguration)/$(frameworkToDescribe)/Spfx.Process.Netcore --spfx-describe'
displayName: 'Describe Hosts for tests'
- task: DotNetCoreCLI@2
displayName: 'Run tests $(minNetcoreVer)'
continueOnError: true
inputs:
command: test
projects: 'Spfx.Tests'
buildConfiguration: '$(buildConfiguration)'
testRunTitle: '$(buildConfiguration) $(minNetcoreVer)'
arguments: '-c $(buildConfiguration) -f $(minNetcoreVer) -v $(verbosity) --no-build --no-restore'
- task: DotNetCoreCLI@2
displayName: 'Run tests $(maxNetcoreVer)'
continueOnError: true
inputs:
command: test
projects: 'Spfx.Tests'
buildConfiguration: '$(buildConfiguration)'
testRunTitle: '$(buildConfiguration) $(maxNetcoreVer)'
arguments: '-c $(buildConfiguration) -f $(maxNetcoreVer) -v $(verbosity) --no-build --no-restore'
- task: DotNetCoreCLI@2
displayName: 'Run tests (netfx)'
continueOnError: true
condition: eq(variables['buildNetfx'], 'true')
inputs:
command: test
projects: 'SimpleProcessFramework.sln'
buildConfiguration: '$(buildConfiguration)'
testRunTitle: '$(buildConfiguration) $(netfxName)'
arguments: '-c $(buildConfiguration) -f $(netfxName) -v $(verbosity) --no-build --no-restore'
#----------------------------------------------------------------------------------------------------
# Nuget publish
#----------------------------------------------------------------------------------------------------
- task: NuGetAuthenticate@0
inputs:
nuGetServiceConnections: 'Github-Packages'
- task: NuGetCommand@2
displayName: 'Nuget Push'
inputs:
command: 'push'
packagesToPush: '$(Build.Repository.LocalPath)\nuspec\*.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'Github-Packages'
verbosityPush: 'Detailed'