Skip to content

Commit

Permalink
Adding new pipeline (#1372)
Browse files Browse the repository at this point in the history
* Updating pipeline

* Undo changes used in testing

* Remove more testing

* Fix benchmarks
  • Loading branch information
manodasanW authored Nov 11, 2023
1 parent 5d34730 commit 7116993
Show file tree
Hide file tree
Showing 20 changed files with 314 additions and 181 deletions.
21 changes: 12 additions & 9 deletions build/AzurePipelineTemplates/CsWinRT-Benchmarks-Steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,21 @@ steps:
- task: UseDotNet@2
displayName: Use .NET Core SDK 3.1
inputs:
packageType: runtime
version: 3.1.x
installationPath: C:\Users\VssAdministrator\AppData\Local\Microsoft\dotnet\
installationPath: $(LocalAppData)\Microsoft\dotnet\
performMultiLevelLookup: true

- task: UseDotNet@2
displayName: Use .NET Core SDK 3.1
inputs:
packageType: runtime
version: 3.1.x
installationPath: $(LocalAppData)\Microsoft\dotnet\x86\
performMultiLevelLookup: true
env:
PROCESSOR_ARCHITECTURE: x86

# Install .NET 6 SDK
- task: PowerShell@2
displayName: Install .NET 6 SDK
Expand Down Expand Up @@ -68,11 +79,3 @@ steps:
SourceFolder: $(Build.SourcesDirectory)\src\BenchmarkDotNet.Artifacts\results\
Contents: '*'
TargetFolder: $(Build.ArtifactStagingDirectory)\benchmarks

# Publish Results
- task: PublishBuildArtifacts@1
displayName: Publish Results
condition: always()
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)\benchmarks
ArtifactName: benchmarks
72 changes: 5 additions & 67 deletions build/AzurePipelineTemplates/CsWinRT-Build-Steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,17 @@ steps:
- task: UseDotNet@2
displayName: Use .NET Core SDK 3.1
inputs:
packageType: runtime
version: 3.1.x
installationPath: C:\Users\VssAdministrator\AppData\Local\Microsoft\dotnet\
installationPath: $(LocalAppData)\Microsoft\dotnet\
performMultiLevelLookup: true

- task: UseDotNet@2
displayName: Use .NET Core SDK 3.1
inputs:
packageType: runtime
version: 3.1.x
installationPath: C:\Users\VssAdministrator\AppData\Local\Microsoft\dotnet\x86
installationPath: $(LocalAppData)\Microsoft\dotnet\x86\
performMultiLevelLookup: true
env:
PROCESSOR_ARCHITECTURE: x86
Expand Down Expand Up @@ -189,32 +191,16 @@ steps:
Contents: cswinrt.binlog
TargetFolder: $(Build.ArtifactStagingDirectory)\binlog

# Publish BinLog
- task: PublishBuildArtifacts@1
displayName: Publish BinLog
condition: always()
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)\binlog
ArtifactName: $(BuildConfiguration)_$(BuildPlatform)_binlog

# Stage Windows projection
- task: ArchiveFiles@2
displayName: Stage Windows projection
enabled: False
condition: and(succeeded(), eq(variables['PublishGeneratedFiles'], 'true'))
inputs:
rootFolderOrFile: $(Build.SourcesDirectory)\Projections\Windows\Generated Files
includeRootFolder: false
sevenZipCompression: 5
archiveFile: $(Build.ArtifactStagingDirectory)\Windows\sources.zip

# Publish Windows projection
- task: PublishBuildArtifacts@1
displayName: Publish Windows projection
enabled: False
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)\Windows
ArtifactName: $(BuildConfiguration)_$(BuildPlatform)_Windows

# Stage CsWinRT
- task: CopyFiles@2
displayName: Stage CsWinRT
Expand Down Expand Up @@ -259,13 +245,6 @@ steps:
unittest.pdb
TargetFolder: $(Build.ArtifactStagingDirectory)\native

# Publish Native
- task: PublishBuildArtifacts@1
displayName: Publish Native
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)\native
ArtifactName: $(BuildConfiguration)_$(BuildPlatform)

# Stage NetStandard 2.0
- task: CopyFiles@2
displayName: Stage NetStandard 2.0
Expand All @@ -288,14 +267,6 @@ steps:
WinRT.SourceGenerator.pdb
TargetFolder: $(Build.ArtifactStagingDirectory)\release_netstandard2.0\

# Publish NetStandard 2.0
- task: PublishBuildArtifacts@1
displayName: Publish NetStandard 2.0
condition: and(succeeded(), eq(variables['BuildPlatform'], 'x86'), eq(variables['BuildConfiguration'], 'release'))
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)\release_netstandard2.0
ArtifactName: netstandard2.0

# Stage Net6.0
- task: CopyFiles@2
displayName: Stage Net6.0
Expand Down Expand Up @@ -386,36 +357,3 @@ steps:
Microsoft.CodeAnalysis.CSharp.dll
Microsoft.CodeAnalysis.dll
TargetFolder: $(Build.ArtifactStagingDirectory)\release_net6.0\CsWinMD

# Publish ResX
- task: PublishBuildArtifacts@1
displayName: Publish ResX files
condition: succeeded()
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)\resx
ArtifactName: ResX

# Publish Net6.0
- task: PublishBuildArtifacts@1
displayName: Publish Net6.0
condition: and(succeeded(), eq(variables['BuildPlatform'], 'x86'), eq(variables['BuildConfiguration'], 'release'))
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)\release_net6.0
ArtifactName: net6.0

# Generate SBOM
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
displayName: 'SBOM Generator Task'
condition: eq(variables['BuildConfiguration'],'Release')
inputs:
BuildDropPath: '$(Build.ArtifactStagingDirectory)'
PackageName: 'Microsoft.Windows.CsWinRT'
PackageVersion: '$(NugetVersion)'

# Stage SBOM
- task: PublishBuildArtifacts@1
displayName: 'Publish SBOM to build artifacts'
condition: eq(variables['BuildConfiguration'],'Release')
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)\_manifest'
ArtifactName: SBOM_$(BuildPlatform)
79 changes: 55 additions & 24 deletions build/AzurePipelineTemplates/CsWinRT-BuildAndTest-Stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ stages:
displayName: Build/Test Stage
jobs:
- job: BuildAndTest
pool:
vmImage: windows-latest
timeoutInMinutes: 180
# https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml#multi-job-configuration
strategy:
Expand Down Expand Up @@ -34,16 +32,16 @@ stages:
persistCredentials: true

# Build Steps
- template: CsWinRT-Build-Steps.yml
- template: CsWinRT-Build-Steps.yml@self

# Set Dotnet paths
- task: PowerShell@2
displayName: Set DotNet paths
inputs:
targetType: inline
script: |
Write-Host "##vso[task.setvariable variable=DOTNET_ROOT;]C:\Users\VssAdministrator\AppData\Local\Microsoft\dotnet\"
Write-Host "##vso[task.setvariable variable=DOTNET_ROOT(x86);]C:\Users\VssAdministrator\AppData\Local\Microsoft\dotnet\x86\"
Write-Host "##vso[task.setvariable variable=DOTNET_ROOT;]$env:LOCALAPPDATA\Microsoft\dotnet\"
Write-Host "##vso[task.setvariable variable=DOTNET_ROOT(x86);]$env:LOCALAPPDATA\Microsoft\dotnet\x86\"
# Run Unit Tests
- task: DotNetCoreCLI@2
Expand Down Expand Up @@ -73,22 +71,6 @@ stages:
testAssemblyVer2: Tests\ObjectLifetimeTests\bin\$(BuildPlatform)\$(BuildConfiguration)\net6.0-windows10.0.19041.0\win10-$(BuildPlatform)\ObjectLifetimeTests.Lifted.build.appxrecipe
searchFolder: $(Build.SourcesDirectory)\src

# Publish Test Log
- task: PublishBuildArtifacts@1
displayName: Publish Test Log
condition: and(succeeded(), or(eq(variables['BuildPlatform'], 'x86'), eq(variables['BuildPlatform'], 'x64')))
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)\unittest
ArtifactName: $(BuildConfiguration)_$(BuildPlatform)_UnitTest

# Publish Embedded Test Log
- task: PublishBuildArtifacts@1
displayName: Publish Embedded Test Log
condition: and(succeeded(), or(eq(variables['BuildPlatform'], 'x86'), eq(variables['BuildPlatform'], 'x64')))
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)\unittestembedded
ArtifactName: $(BuildConfiguration)_$(BuildPlatform)_UnitTestEmbedded

# Run Host Tests
- task: CmdLine@2
displayName: Run Host Tests
Expand Down Expand Up @@ -122,13 +104,62 @@ stages:
script: |
set cswinrt_label=functionaltest
build.cmd $(BuildPlatform) $(BuildConfiguration) $(VersionNumber) $(Build.BuildNumber) $(WinRT.Runtime.AssemblyVersion)
templateContext:
outputs:
- output: pipelineArtifact
displayName: 'Publish Test Log'
condition: and(failed(), or(eq(variables['BuildPlatform'], 'x86'), eq(variables['BuildPlatform'], 'x64')))
targetPath: $(Build.ArtifactStagingDirectory)\unittest
artifactName: $(BuildConfiguration)_$(BuildPlatform)_UnitTest
- output: pipelineArtifact
displayName: 'Publish Embedded Test Log'
condition: and(failed(), or(eq(variables['BuildPlatform'], 'x86'), eq(variables['BuildPlatform'], 'x64')))
targetPath: $(Build.ArtifactStagingDirectory)\unittestembedded
artifactName: $(BuildConfiguration)_$(BuildPlatform)_UnitTestEmbedded
- output: pipelineArtifact
displayName: 'Publish BinLog'
condition: failed()
targetPath: $(Build.ArtifactStagingDirectory)\binlog
artifactName: $(BuildConfiguration)_$(BuildPlatform)_binlog
- output: pipelineArtifact
displayName: 'Publish Windows projection'
condition: and(succeeded(), eq(variables['PublishGeneratedFiles'], 'true'))
targetPath: $(Build.ArtifactStagingDirectory)\Windows
artifactName: $(BuildConfiguration)_$(BuildPlatform)_Windows
- output: pipelineArtifact
displayName: 'Publish Native'
condition: or(failed(), eq(variables['BuildConfiguration'], 'release'))
targetPath: $(Build.ArtifactStagingDirectory)\native
artifactName: $(BuildConfiguration)_$(BuildPlatform)
- output: pipelineArtifact
displayName: 'Publish NetStandard 2.0'
condition: and(succeeded(), eq(variables['BuildPlatform'], 'x86'), eq(variables['BuildConfiguration'], 'release'))
targetPath: $(Build.ArtifactStagingDirectory)\release_netstandard2.0
artifactName: netstandard2.0
- output: pipelineArtifact
displayName: 'Publish ResX files'
condition: and(succeeded(), eq(variables['BuildPlatform'], 'x86'), eq(variables['BuildConfiguration'], 'release'))
targetPath: $(Build.ArtifactStagingDirectory)\resx
artifactName: ResX
- output: pipelineArtifact
displayName: 'Publish Net6.0'
condition: and(succeeded(), eq(variables['BuildPlatform'], 'x86'), eq(variables['BuildConfiguration'], 'release'))
targetPath: $(Build.ArtifactStagingDirectory)\release_net6.0
artifactName: net6.0

- job: Benchmarks
displayName: Run Benchmarks
condition: or(eq(variables['_RunBenchmarks'],'true'), eq(variables['Build.Reason'],'Schedule'))
dependsOn: []
pool:
vmImage: windows-latest
timeoutInMinutes: 120
steps:
- template: CsWinRT-Benchmarks-Steps.yml
- template: CsWinRT-Benchmarks-Steps.yml@self

templateContext:
outputs:
- output: pipelineArtifact
displayName: 'Publish Results'
condition: always()
targetPath: $(Build.ArtifactStagingDirectory)\benchmarks
artifactName: benchmarks

19 changes: 14 additions & 5 deletions build/AzurePipelineTemplates/CsWinRT-BuildOnly-Stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,19 @@ stages:
displayName: Build for Release|x64
jobs:
- job: Build
pool:
vmImage: windows-2022
timeoutInMinutes: 90
# https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml#multi-job-configuration
templateContext:
outputs:
- output: pipelineArtifact
displayName: 'Publish Native'
condition: succeeded()
targetPath: $(Build.ArtifactStagingDirectory)\native
artifactName: release_x64
- output: pipelineArtifact
displayName: 'Publish ResX files'
condition: succeeded()
targetPath: $(Build.ArtifactStagingDirectory)\resx
artifactName: ResX
timeoutInMinutes: 180
strategy:
maxParallel: 10
matrix:
Expand All @@ -19,4 +28,4 @@ stages:
persistCredentials: true

# Build Steps
- template: CsWinRT-Build-Steps.yml
- template: CsWinRT-Build-Steps.yml@self
24 changes: 19 additions & 5 deletions build/AzurePipelineTemplates/CsWinRT-LocalizationPipeline.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
name: $(MajorVersion).$(MinorVersion).$(PatchVersion)$(PrereleaseVersion).$(date:yyMMdd)$(rev:.r)

variables:
- template: CsWinRT-Variables.yml
- template: CsWinRT-Variables.yml@self
- group: CsWinRT-TouchdownBuild-Secrets
- name: LocOutputDir
value: '$(Agent.TempDirectory)\Temp\LocOutput'

stages:
- template: CsWinRT-BuildOnly-Stage.yml

- template: CsWinRT-LocalizeResources-Stage.yml
resources:
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: windows-2022
os: windows
customBuildTags:
- ES365AIMigrationTooling
stages:
- template: CsWinRT-BuildOnly-Stage.yml@self
- template: CsWinRT-LocalizeResources-Stage.yml@self
25 changes: 11 additions & 14 deletions build/AzurePipelineTemplates/CsWinRT-LocalizeResources-Stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ stages:
displayName: Call TDBuild to Localize Resources
jobs:
- job: Localize
pool:
vmImage: windows-2022
timeoutInMinutes: 90
steps:
- checkout: self
Expand All @@ -17,22 +15,20 @@ stages:
git config --global user.name "TDBuild"
# Download x64
- task: DownloadBuildArtifacts@0
- task: DownloadPipelineArtifact@2
displayName: Download x64
inputs:
artifactName: release_x64
itemPattern: ''
downloadPath: $(Build.SourcesDirectory)
extractTars: false
targetPath: $(Build.SourcesDirectory)\release_x64

# Download RESX
- task: DownloadBuildArtifacts@0
- task: DownloadPipelineArtifact@2
displayName: Download ResX
inputs:
artifactName: ResX
itemPattern: ''
downloadPath: $(Build.SourcesDirectory)
extractTars: false
targetPath: $(Build.SourcesDirectory)\ResX

# Run TouchdownBuild
- task: TouchdownBuildTask@1
Expand Down Expand Up @@ -114,9 +110,10 @@ stages:
TargetFolder: $(Build.ArtifactStagingDirectory)\loc

# Publish TDBuild Output
- task: PublishBuildArtifacts@1
displayName: Publish TouchdownBuild Output
condition: succeeded()
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)\loc
ArtifactName: LocalizedResources
templateContext:
outputs:
- output: pipelineArtifact
displayName: 'Publish TouchdownBuild Output'
condition: succeeded()
targetPath: $(Build.ArtifactStagingDirectory)\loc
artifactName: LocalizedResources
Loading

0 comments on commit 7116993

Please sign in to comment.