forked from microsoft/WinUI-Gallery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
103 lines (88 loc) · 3.07 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
trigger:
- main
pool:
vmImage: "windows-2022"
variables:
solutionGallery: "**/WinUIGallery.sln"
solutionUITests: "**/UITests.sln"
buildPlatform: "x64"
buildConfiguration: "Debug"
appxPackageDir: '$(build.artifactStagingDirectory)\AppxPackages\\'
steps:
- task: NuGetToolInstaller@1
displayName: Install NuGet 5.8.0
inputs:
versionSpec: 5.8.0
- task: NuGetCommand@2
displayName: Restore NuGet Packages for WinUI Gallery
inputs:
command: 'restore'
restoreSolution: '**/*.sln'
feedsToUse: 'config'
nugetConfigPath: '$(System.DefaultWorkingDirectory)\nuget.config'
- task: PowerShell@2
displayName: Generate Test Signing Certificate
inputs:
targetType: filePath
filePath: build/GenerateTestPFX.ps1
- task: DotNetCoreCLI@2
displayName: Build WinUI Gallery Package
inputs:
command: 'publish'
publishWebProjects: false
projects: '$(solutionGallery)'
arguments: '/p:AppxPackageDir="D:\a\1\a\AppxPackages\\" /p:platform="$(buildPlatform)" /p:PublishProfile="./WinUIGallery/Properties/PublishProfiles/win10-$(buildPlatform).pubxml"'
zipAfterPublish: false
modifyOutputPath: false
- script: |
dir /b /s $(Build.ArtifactStagingDirectory)
dir /b /s $(System.DefaultWorkingDirectory)
displayName: 'List contents of ArtifactStagingDirectory and DefaultWorkingDirectory'
- task: VSTest@2
displayName: 'Run Sample Unit Tests'
inputs:
failOnMinTestsNotRun: true
minimumExpectedTests: '3'
testAssemblyVer2: |
**\WinUIGalleryUnitTests.build.appxrecipe
- task: PowerShell@2
displayName: Install WinUI Gallery Package
inputs:
targetType: "inline"
script: |
cd $(appxPackageDir)
$AppBundle = Get-ChildItem -Filter WinUIGallery*Test -Name
cd $AppBundle
./Install.ps1 -Force
errorActionPreference: "continue"
failOnStderr: true
workingDirectory: "$(System.DefaultWorkingDirectory)"
- task: NuGetCommand@2
displayName: Restore Packages for UI Tests Project
inputs:
restoreSolution: "$(solutionUITests)"
- task: VSBuild@1
displayName: Build UI Tests Project
inputs:
platform: "$(buildPlatform)"
solution: "$(solutionUITests)"
configuration: "$(buildConfiguration)"
- task: Windows Application Driver@0
displayName: Start Windows Application Driver
inputs:
OperationType: "Start"
AgentResolution: "1080p"
- task: VSTest@2
displayName: Run UI Tests
inputs:
testSelector: "testAssemblies"
testAssemblyVer2: |
**\UITests.dll
!**\*TestAdapter.dll
!**\obj\**
!**\ref\**
searchFolder: "$(System.DefaultWorkingDirectory)"
- task: Windows Application Driver@0
displayName: Stop Windows Application Driver
inputs:
OperationType: "Stop"