forked from Ginger-Automation/Ginger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
116 lines (90 loc) · 4.85 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
# .NET
jobs:
# ------------------------------------------------------------------------------------------------------
# Request Windows VM Windows 2019 with Visual Studio 2019 - set Ginger solution
# ------------------------------------------------------------------------------------------------------
- job: Windows
pool:
vmImage: 'windows-2019' #Visual Studio 2019 Preview on Windows Server 2019
# ------------------------------------------------------------------------------------------------------
# Job Variables
# ------------------------------------------------------------------------------------------------------
variables:
solution: '**/*.sln' # = D:\a\1\s\Ginger\Ginger.sln
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
solutionDirectory: 'Ginger-Automation/Ginger'
testDLLs: |
**\GingerUtilsTest\bin\$(buildConfiguration)\netcoreapp2.2\GingerUtilsTest.dll
**\GingerCoreCommonTest\bin\$(buildConfiguration)\netcoreapp2.2\GingerCoreCommonTest.dll
**\GingerCoreNETUnitTest\bin\$(buildConfiguration)\netcoreapp2.2\GingerCoreNETUnitTest.dll
**\GingerConsoleTest\bin\$(buildConfiguration)\netcoreapp2.2\GingerConsoleTest.dll
**\GingerAutoPilotTest\bin\$(buildConfiguration)\netcoreapp2.2\GingerAutoPilotTest.dll
**\GingerPluginCoreTest\bin\$(buildConfiguration)\netcoreapp2.2\GingerPluginCoreTest.dll
artifactsFolder: 'D:\a\1\a'
# ------------------------------------------------------------------------------------------------------
# Steps task
# ------------------------------------------------------------------------------------------------------
steps:
# ------------------------------------------------------------------------------------------------------
# Install .Net core SDK 2.2
# ------------------------------------------------------------------------------------------------------
- task: DotNetCoreInstaller@0
inputs:
packageType: 'sdk' # Options: runtime, sdk
version: '2.2.100'
displayName: Install .Net Core 2.2
# ------------------------------------------------------------------------------------------------------
# Install Nuget tool
# ------------------------------------------------------------------------------------------------------
- task: NuGetToolInstaller@0
displayName: NuGet Tool Installer
# ------------------------------------------------------------------------------------------------------
# Restore Ginger solution NuGet packages
# ------------------------------------------------------------------------------------------------------
- task: NuGetCommand@2
inputs:
command: restore
restoreSolution: '$(solution)'
displayName: Restore Ginger Solution Nuget Packages
# ------------------------------------------------------------------------------------------------------
# Build Ginger Solution
# ------------------------------------------------------------------------------------------------------
- task: VSBuild@1
inputs:
solution: '$(solution)' # = D:\a\1\s\Ginger\Ginger.sln
# platform: 'x86'
# clean: true
configuration: '$(buildConfiguration)'
msbuildArgs: /NoLogo /m
# /TargetFrameworkVersion /TargetCompactFramework
# msbuildArchitecture: 'x86' # Optional. Options: x86, x64
# TreatWarningsAsErrors / NoWarn -- do not allow warnings - do it later when we have zero warnings
displayName: Build Ginger solution
# ------------------------------------------------------------------------------------------------------
# Run Unit Test for .NET Core test DLLs
# ------------------------------------------------------------------------------------------------------
- task: VSTest@2
displayName: 'Run tests for Ginger .Net Core *Test DLLs'
inputs:
testAssemblyVer2: $(testDLLs)
runInParallel: True
codeCoverageEnabled: True
# ------------------------------------------------------------------------------------------------------
# Run .Net Framework tests using powershell and publish the results
# ------------------------------------------------------------------------------------------------------
- task: PowerShell@2
displayName: Run tests for Ginger .NetFramework *Test Dlls
inputs:
filePath: TestDotNetFramework.ps1
- task: PublishTestResults@2
displayName: Publish .Net Framework test result
condition: succeededOrFailed()
inputs:
testResultsFormat: VSTest
testResultsFiles: '**/DotNetFramework/*.trx'
# ------------------------------------------------------------------------------------------------------
# PublishBuildArtifacts
# ------------------------------------------------------------------------------------------------------
- task: PublishBuildArtifacts@1
condition: succeededOrFailed()