Skip to content

Performance Optimization for Foundation Build Pipeline: Break down build and test stage per platform#5363

Merged
haonanttt merged 13 commits intomainfrom
user/haonanttt/testStageSeparation
Apr 30, 2025
Merged

Performance Optimization for Foundation Build Pipeline: Break down build and test stage per platform#5363
haonanttt merged 13 commits intomainfrom
user/haonanttt/testStageSeparation

Conversation

@haonanttt
Copy link
Copy Markdown
Contributor

@haonanttt haonanttt commented Apr 25, 2025

Original "Build" stage run x86, x64 and arm64 together. "Test" stage will start when all build finished.

This PR break down the "Build" stage and "Test" stage into platform specific stages. For each platform, test will only depend on specific platform's build - Test_x86 will only depend on Build_x86, etc.

//////////////
A microsoft employee must use /azp run to validate using the pipelines below.

WARNING:
Comments made by azure-pipelines bot maybe inaccurate.
Please see pipeline link to verify that the build is being ran.

For status checks on the main branch, please use TransportPackage-Foundation-PR
(https://microsoft.visualstudio.com/ProjectReunion/_build?definitionId=81063&_a=summary)
and run the build against your PR branch with the default parameters.

@haonanttt haonanttt changed the base branch from user/hnmy/pipelineModify to main April 25, 2025 02:59
@haonanttt haonanttt changed the title User/haonanttt/test stage separation Performance Optimization for Foundation Build Pipeline: Break down build and test stage per platform Apr 25, 2025
@haonanttt
Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@haonanttt haonanttt requested a review from Hong-Xiang April 25, 2025 06:32
Comment thread build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml
@haonanttt
Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Comment thread build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml Outdated
Comment thread build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml Outdated
@haonanttt
Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Comment thread build/AzurePipelinesTemplates/WindowsAppSDK-Test-Stage.yml Outdated
Comment thread build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml Outdated
Comment thread build/AzurePipelinesTemplates/WindowsAppSDK-Publish-Stage.yml Outdated
Comment thread build/AzurePipelinesTemplates/WindowsAppSDK-PackTransportPackage-Stage.yml Outdated
Haonan Tang (from Dev Box) added 2 commits April 27, 2025 14:47
@haonanttt
Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@yeelam-gordon yeelam-gordon requested a review from Copilot April 29, 2025 08:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR optimizes the build pipeline by breaking down the build and test stages into platform‐specific jobs, ensuring test jobs only run after their corresponding build stage has succeeded. Key changes include:

  • Injecting a test matrix parameter into multiple YAML definitions.
  • Splitting the unified test stage into Test_x86, Test_x64, and Test_arm64 stages.
  • Introducing a new build-per-platform template that replaces portions of the existing build stage.

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
build/WindowsAppSDK-Foundation-PR.yml Injects testMatrix parameter for test stage configuration.
build/WindowsAppSDK-Foundation-Official.yml Passes testMatrix parameter to the test stage.
build/WindowsAppSDK-Foundation-Nightly.yml Passes testMatrix parameter to the test stage.
build/ProjectReunion-BuildFoundation.yml Adds testMatrix parameter for platform-specific testing.
build/AzurePipelinesTemplates/WindowsAppSDK-Test-Stage.yml Splits the Test stage into three platform-specific stages using the new parameter.
build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml Updates the test job to use a filtered testMatrix keyed by platform.
build/AzurePipelinesTemplates/WindowsAppSDK-Publish-Stage.yml Adjusts dependencies to account for the new test stage splits.
build/AzurePipelinesTemplates/WindowsAppSDK-PackTransportPackage-Stage.yml Updates build dependencies to include new build stage names.
build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml Transitions build jobs to use the new per-platform build template.
build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml New template that defines build stages per platform with associated parameters.
Comments suppressed due to low confidence (2)

build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml:16

  • [nitpick] Ensure that the generated stage name using 'Build_{buildPlatform}' is consistent with all other pipeline references and related documentation for clarity.
stage: ${{ format('Build_{0}', parameters.buildPlatform) }}

build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml:67

  • Verify whether legacy job definitions (e.g. BuildFoundation_release_anycpu) are still required after transitioning to the new per-platform build template. Removing redundant jobs can help avoid duplicate builds.
# extract BuildFoundation and BuildMRT into WindowsAppSDK-Build-Stage-Per-Platform.yml.

dependsOn: FilterMatrix
strategy:
matrix: ${{ parameters.testMatrix }}
matrix: $[ dependencies.FilterMatrix.outputs['setFilteredMatrixStep.filteredMatrixJson'] ]
Copy link

Copilot AI Apr 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that the JSON output from the FilterMatrix step is correctly parsed as an object for the matrix. If the value is a JSON string, consider converting it to the proper object type so that the downstream job receives the expected structure.

Suggested change
matrix: $[ dependencies.FilterMatrix.outputs['setFilteredMatrixStep.filteredMatrixJson'] ]
matrix: $[ fromJson(dependencies.FilterMatrix.outputs['setFilteredMatrixStep.filteredMatrixJson']) ]

Copilot uses AI. Check for mistakes.
@haonanttt
Copy link
Copy Markdown
Contributor Author

haonanttt commented Apr 29, 2025

Copy link
Copy Markdown
Contributor

@yeelam-gordon yeelam-gordon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall.
This one will make the pipeline more resumable.
And with Muyuan's #5364, the performance is better.

md "C:\__t\NativeCompilerPrefast"
displayName: 'Creating C:\__t\NativeCompilerPrefast to prevent errors from Guardian PREfast'

- job: BuildFoundation_release_anycpu
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know what is this for int the past? Looks like no consumer for this result afterwards?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the reason is that we wanted to build Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj in AnyCPU.

It does seem like we have a consumer here

    Copy-Item -path "BuildOutput\$configurationForMrtAndAnyCPU\anycpu\Microsoft.WindowsAppRuntime.Bootstrap.Net\Microsoft.WindowsAppRuntime.Bootstrap.Net.dll"  -destination "$BasePath\lib\net6.0-windows10.0.17763.0"

in line 326 of
WindowsAppSDK\WindowsAppSDK\BuildAll.ps1

Comment thread build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml Outdated
@haonanttt
Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@haonanttt haonanttt merged commit 4e3e5ba into main Apr 30, 2025
30 checks passed
@haonanttt haonanttt deleted the user/haonanttt/testStageSeparation branch April 30, 2025 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants