Xaml-Controls-Gallery/azure-pipelines.yml

104 строки
3.1 KiB
YAML

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:configuration="$(buildConfiguration)" /p:PublishProfile="./WinUIGallery/Properties/PublishProfiles/win-$(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"