Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
182 changes: 182 additions & 0 deletions .pipelines/WinUI-Gallery-OneBranch-Official.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr)

# https://aka.ms/obpipelines/triggers
trigger: none

parameters: # parameters are shown up in ADO UI in a build queue time
- name: 'debug'
displayName: 'Enable debug output'
type: boolean
default: false

variables:
CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)] # needed for onebranch.pipeline.version task https://aka.ms/obpipelines/versioning
system.debug: ${{ parameters.debug }}
ENABLE_PRS_DELAYSIGN: 1
ROOT: $(Build.SourcesDirectory)
REPOROOT: $(Build.SourcesDirectory)
OUTPUTROOT: $(REPOROOT)\out
NUGET_XMLDOC_MODE: none

# Docker image which is used to build the project https://aka.ms/obpipelines/containers
WindowsContainerImage: 'onebranch.azurecr.io/windows/ltsc2019/vse2022:latest'

Codeql.Enabled: true # CodeQL once every 3 days on the default branch for all languages its applicable to in that pipeline.

resources:
repositories:
- repository: templates
type: git
name: OneBranch.Pipelines/GovernedTemplates
ref: refs/heads/main

extends:
template: v2/OneBranch.Official.CrossPlat.yml@templates # https://aka.ms/obpipelines/templates
parameters:
platform:
name: 'windows_undocked'

globalSdl: # Refer the wiki for more options in this parameter: https://aka.ms/obpipelines/sdl
tsa:
enabled: false # onebranch publish all sdl results to TSA. If TSA is disabled all SDL tools will forced into 'break' build mode.
# suppression:
# suppressionFile: $(Build.SourcesDirectory)\.gdn\global.gdnsuppress
featureFlags:
ensureArtifactsDirExists: true

stages:
- stage: build
jobs:
- job: main
pool:
# read more about custom job pool types at https://aka.ms/obpipelines/yaml/jobs
pool:
type: windows
isCustom: true
name: Azure Pipelines
vmImage: 'windows-latest'

variables:
ob_outputDirectory: $(build.artifactStagingDirectory)
ob_artifactSuffix: _$(buildPlatform)_$(buildConfiguration)

solutionGallery: "**/WinUIGallery.sln"
solutionUITests: "**/UITests.sln"
buildPlatform: "x64"
buildConfiguration: "Debug"
appxPackageDir: '$(Build.ArtifactStagingDirectory)\AppxPackages\\'

steps:
# Package Restore
- 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: UseDotNet@2
continueOnError: true
inputs:
packageType: 'sdk'
performMultiLevelLookup: true

# Signing
- task: PowerShell@2
displayName: Generate Test Signing Certificate
inputs:
targetType: filePath
filePath: build/GenerateTestPFX.ps1

# Build (Product)
- task: DotNetCoreCLI@2
displayName: Build WinUI Gallery Package
inputs:
command: 'publish'
publishWebProjects: false
projects: '$(solutionGallery)'
arguments: '/p:AppxPackageDir="$(appxPackageDir)" /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'

# Install and Run Unit Tests
- task: VSTest@2
displayName: 'Run Sample Unit Tests'
inputs:
testSelector: "testAssemblies"
searchFolder: "$(System.DefaultWorkingDirectory)"
failOnMinTestsNotRun: true
minimumExpectedTests: '3'
testAssemblyVer2: |
**\WinUIGalleryUnitTests.build.appxrecipe

# Build and Run UI Tests
- 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 -Certificate WinUIGallery.Desktop.cer -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"
WADArguments: "4724"

- task: VSTest@2
displayName: Run UI Tests
inputs:
testSelector: "testAssemblies"
testAssemblyVer2: |
**\UITests.dll
!**\*TestAdapter.dll
!**\obj\**
!**\ref\**
platform: '$(buildPlatform)'
configuration: "$(buildConfiguration)"
searchFolder: "$(System.DefaultWorkingDirectory)"

- task: Windows Application Driver@0
displayName: Stop Windows Application Driver
inputs:
OperationType: "Stop"

- task: PublishPipelineArtifact@1
inputs:
targetPath: $(ob_outputDirectory)
artifact: 'drop_build_main_$(buildPlatform)_$(buildConfiguration)'
publishLocation: 'pipeline'


69 changes: 69 additions & 0 deletions .pipelines/WinUI-Gallery-SyncMirror.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Sync branches in a mirror repository to a base repo by running this pipeline
# from the mirror repo, and supplying the base repo as a parameter
name: $(BuildDefinitionName)_$(date:yyMMdd)$(rev:.r)

parameters:
- name: "SourceToTargetBranches"
type: object
default:
main: main
- name: "SourceRepository"
type: string
default: "https://github.com/microsoft/WinUI-Gallery.git"

resources:
repositories:
- repository: templates
type: git
name: OneBranch.Pipelines/GovernedTemplates
ref: refs/heads/main
- repository: InternalWinUIGallery
type: git
name: WinUI/WinUI-Gallery-Mirror
ref: refs/heads/main

jobs:
- job: SyncMirror
pool:
vmImage: "windows-2022"
strategy:
matrix:
${{ each branches in parameters.SourceToTargetBranches }}:
${{ branches.key }}:
SourceBranch: ${{ branches.key }}
TargetBranch: ${{ branches.value }}

dependsOn: []
steps:
- checkout: self
path: s/
persistCredentials: true

- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
Write-Host "SourceBranch " + "$(SourceBranch)"
Write-Host "TargetBranch " + "$(TargetBranch)"

$repo = "${{ parameters.SourceRepository }}"
git remote add sourcerepo $repo
git remote

$target = "$(TargetBranch)"
git fetch origin $target
git checkout $target
git pull origin $target

$source = "$(SourceBranch)"

git config --global user.email "ControlsGallery@microsoft.com"
git config --global user.name "Controls Gallery"

git fetch sourcerepo $source
git pull sourcerepo $source

- task: CmdLine@2
inputs:
script: |
git push
File renamed without changes.
2 changes: 1 addition & 1 deletion UITests/SessionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace UITests
[TestClass]
public class SessionManager
{
private const string WindowsApplicationDriverUrl = "http://127.0.0.1:4723";
private const string WindowsApplicationDriverUrl = "http://127.0.0.1:4724";
private static readonly string[] WinUIGalleryAppIDs = new string[]{
"Microsoft.WinUI3ControlsGallery.Debug_grv3cx5qrw0gp!App",
"Microsoft.WinUI3ControlsGallery_grv3cx5qrw0gp!App"
Expand Down
6 changes: 3 additions & 3 deletions nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<clear />
</disabledPackageSources>
<packageSources>
<!-- For more info, see https://docs.nuget.org/consume/nuget-config-file -->
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
<clear />
<add key="MUX-Dependencies" value="https://pkgs.dev.azure.com/shine-oss/microsoft-ui-xaml/_packaging/MUX-Dependencies/nuget/v3/index.json" />

<!-- a local directory to allow testing nupkg files without pushing to a remote feed -->
<add key="gallerystore" value="packagestore" />
<add key="packagestore" value="packagestore" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
Expand Down