Skip to content

Commit

Permalink
[0.74] Add builds and nugets for MS.RN Fabric and Fixed Microsoft.Rea…
Browse files Browse the repository at this point in the history
…ctNative.IntegrationTests and Mso.UnitTests to run with Fabric (#12919)

This PR backports #12900 and #12924 to 0.74.

From #12900:

## Description

This PR adds configurations for Microsoft.ReactNative with Fabric enabled to PR, CI, and Publish builds. This change will enable the publishing of new versions of the Microsoft.ReactNative NuGet with the `-Fabric` suffix to differentiate it from the current Paper NuGet.

This replicates the setup that Desktop has, where we create and publish versions of React Native Win32 nugets with the `-Fabric` suffix to indicate those versions are using Fabric.

### Type of Change
- New feature (non-breaking change which adds functionality)

### Why
We want the default new arch, new app / lib experience to *not* build RNW, but instead consume it via NuGets, see #12639. In order to get that started, we'll need NuGets built with fabric enabled.

### What
Updated CI/PR/Publish configurations.

## Screenshots
N/A

## Testing
Verified new configurations fired off existing tests in PR.

## Changelog
Should this change be included in the release notes: yes

[0.74] New Microsoft.ReactNative nugets with Fabric enabled

From #12924:

## Description

This PR makes Microsoft.ReactNative.IntegrationTests aware of Fabric requirements to use the WinAppSDK `DispatchQueueController`. This PR also fixes both that project and Mso.UnitTests to be able to consume self-contained WinAppSDK so they can run (the tests had code but were technically never exercising it).

Finally this PR also enables a fabric config in PR to make sure we catch test failures like this in the future.

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
See above.

Resolves #12923 

### What
See above.

## Screenshots
N/A

## Testing
Ran Microsoft.ReactNative.Integration tests locally.

## Changelog
Should this change be included in the release notes: _yes_

[0.74] Fixed Microsoft.ReactNative.IntegrationTests and Mso.UnitTests to run with Fabric
  • Loading branch information
jonthysell committed Apr 22, 2024
1 parent de6f880 commit a399157
Show file tree
Hide file tree
Showing 12 changed files with 338 additions and 126 deletions.
24 changes: 16 additions & 8 deletions .ado/jobs/desktop.yml
Expand Up @@ -24,16 +24,20 @@ parameters:
- Name: X86Debug
BuildConfiguration: Debug
BuildPlatform: x86
- Name: X86Release
BuildConfiguration: Release
BuildPlatform: x86
- Name: Arm64Debug
BuildConfiguration: Debug
BuildPlatform: ARM64
- Name: Arm64Release
BuildConfiguration: Release
BuildPlatform: ARM64
- Name: X86Release
BuildConfiguration: Release
BuildPlatform: x86
- Name: X86ReleaseFabric
- Name: X64DebugFabric
BuildConfiguration: Debug
BuildPlatform: x64
UseFabric: true
- Name: X86ReleaseFabric # Specifically built so binskim / tests get run on fabric
BuildConfiguration: Release
BuildPlatform: x86
UseFabric: true
Expand All @@ -54,16 +58,20 @@ parameters:
- Name: X86Debug
BuildConfiguration: Debug
BuildPlatform: x86
- Name: X86Release
BuildConfiguration: Release
BuildPlatform: x86
- Name: Arm64Debug
BuildConfiguration: Debug
BuildPlatform: ARM64
- Name: Arm64Release
BuildConfiguration: Release
BuildPlatform: ARM64
- Name: X86Release
BuildConfiguration: Release
BuildPlatform: x86
- Name: X86ReleaseFabric
- Name: X64DebugFabric
BuildConfiguration: Debug
BuildPlatform: x64
UseFabric: true
- Name: X86ReleaseFabric # Specifically built so binskim / tests get run on fabric
BuildConfiguration: Release
BuildPlatform: x86
UseFabric: true
Expand Down
85 changes: 69 additions & 16 deletions .ado/jobs/universal.yml
Expand Up @@ -13,52 +13,90 @@
default:
- BuildEnvironment: PullRequest
Matrix:
- Name: Arm64Debug
BuildConfiguration: Debug
BuildPlatform: ARM64
- Name: Arm64Release
BuildConfiguration: Release
BuildPlatform: ARM64
- Name: X64Debug
BuildConfiguration: Debug
BuildPlatform: x64
UseFabric: false
- Name: X64Release
BuildConfiguration: Release
BuildPlatform: x64
UseFabric: false
- Name: X86Debug
BuildConfiguration: Debug
BuildPlatform: x86
UseFabric: false
CreateApiDocs: true
- Name: X86Release
BuildConfiguration: Release
BuildPlatform: x86
- BuildEnvironment: Continuous
Matrix:
UseFabric: false
- Name: Arm64Debug
BuildConfiguration: Debug
BuildPlatform: ARM64
UseFabric: false
- Name: Arm64Release
BuildConfiguration: Release
BuildPlatform: ARM64
UseFabric: false
- Name: X64DebugFabric
BuildConfiguration: Debug
BuildPlatform: x64
UseFabric: true
- Name: X86ReleaseFabric # Specifically built so binskim / tests get run on fabric
BuildConfiguration: Release
BuildPlatform: x86
UseFabric: true
- BuildEnvironment: SecurePullRequest
Matrix:
- Name: X64DebugFabric
BuildConfiguration: Debug
BuildPlatform: x64
UseFabric: true
- Name: X86ReleaseFabric # Specifically built so binskim / tests get run on fabric
BuildConfiguration: Release
BuildPlatform: x86
UseFabric: true
- BuildEnvironment: Continuous
Matrix:
- Name: X64Debug
BuildConfiguration: Debug
BuildPlatform: x64
UseFabric: false
- Name: X64Release
BuildConfiguration: Release
BuildPlatform: x64
UseFabric: false
- Name: X86Debug
BuildConfiguration: Debug
BuildPlatform: x86
UseFabric: false
CreateApiDocs: true
- Name: X86Release
BuildConfiguration: Release
BuildPlatform: x86
UseFabric: false
- Name: Arm64Debug
BuildConfiguration: Debug
BuildPlatform: ARM64
UseFabric: false
- Name: Arm64Release
BuildConfiguration: Release
BuildPlatform: ARM64
UseFabric: false
- Name: X64DebugFabric
BuildConfiguration: Debug
BuildPlatform: x64
UseFabric: true
- Name: X86ReleaseFabric # Specifically built so binskim / tests get run on fabric
BuildConfiguration: Release
BuildPlatform: x86
UseFabric: true

jobs:
- ${{ each config in parameters.buildMatrix }}:
- ${{ if eq(config.BuildEnvironment, parameters.buildEnvironment) }}:
- ${{ each matrix in config.Matrix }}:
- job: UniversalBuild${{ matrix.BuildPlatform }}${{ matrix.BuildConfiguration }}
- job: UniversalBuild${{ matrix.Name }}
variables:
- template: ../variables/windows.yml
# Some tasks run on a different user (VssAdministrator) instead of the default user (AzDevOps).
Expand All @@ -83,10 +121,16 @@

- template: ../templates/apply-published-version-vars.yml

- ${{ if eq(matrix.UseFabric, true) }}:
- template: ../templates/enable-fabric-experimental-feature.yml

- template: ../templates/msbuild-sln.yml
parameters:
solutionDir: vnext
solutionName: Microsoft.ReactNative.sln
${{ if eq(matrix.UseFabric, true) }}:
solutionName: Microsoft.ReactNative.CppOnly.slnf
${{ else }}:
solutionName: Microsoft.ReactNative.sln
buildPlatform: ${{ matrix.BuildPlatform }}
buildConfiguration: ${{ matrix.BuildConfiguration }}

Expand Down Expand Up @@ -114,7 +158,10 @@

- template: ../templates/publish-build-artifacts.yml
parameters:
artifactName: ReactWindows
${{ if eq(matrix.UseFabric, true) }}:
artifactName: ReactWindowsFabric
${{ else }}:
artifactName: ReactWindows
buildPlatform: ${{ matrix.BuildPlatform }}
buildConfiguration: ${{ matrix.BuildConfiguration }}
contents: |
Expand All @@ -137,7 +184,7 @@
value: $(Agent.TempDirectory)/NuGetPackages
displayName: Universal Test ${{ matrix.Name }}
dependsOn:
- UniversalBuild${{ matrix.BuildPlatform }}${{ matrix.BuildConfiguration }}
- UniversalBuild${{ matrix.Name }}

pool: ${{ parameters.AgentPool.Medium }}
timeoutInMinutes: 60
Expand All @@ -162,10 +209,16 @@
arguments: -NoPrompt -Tags buildLab

- task: DownloadPipelineArtifact@1
displayName: Download "ReactWindows.${{ matrix.BuildPlatform }}.${{ matrix.BuildConfiguration }}"
${{ if eq(matrix.UseFabric, true) }}:
displayName: Download "ReactWindowsFabric.${{ matrix.BuildPlatform }}.${{ matrix.BuildConfiguration }}"
${{ else }}:
displayName: Download "ReactWindows.${{ matrix.BuildPlatform }}.${{ matrix.BuildConfiguration }}"
inputs:
targetPath: $(Build.SourcesDirectory)/vnext/target/${{ matrix.BuildPlatform }}/${{ matrix.BuildConfiguration }}
artifactName: ReactWindows.${{ matrix.BuildPlatform }}.${{ matrix.BuildConfiguration }}
${{ if eq(matrix.UseFabric, true) }}:
artifactName: ReactWindowsFabric.${{ matrix.BuildPlatform }}.${{ matrix.BuildConfiguration }}
${{ else }}:
artifactName: ReactWindows.${{ matrix.BuildPlatform }}.${{ matrix.BuildConfiguration }}

- task: BinSkim@4
displayName: Run Binskim Analysis
Expand Down Expand Up @@ -247,7 +300,7 @@
collectDumpOn: onAbortOnly
vsTestVersion: latest
failOnMinTestsNotRun: true
condition: and(succeeded(), not(eq('${{ matrix.BuildPlatform }}', 'ARM64')))
condition: and(succeeded(), not(eq('${{ matrix.BuildPlatform }}', 'ARM64')), eq('${{ matrix.UseFabric }}', 'false'))

- task: VSTest@2
displayName: Run Universal Unit Tests (NetCore)
Expand All @@ -265,4 +318,4 @@
collectDumpOn: onAbortOnly
vsTestVersion: latest
failOnMinTestsNotRun: true
condition: and(succeeded(), eq('${{ matrix.BuildPlatform }}', 'x64'))
condition: and(succeeded(), eq('${{ matrix.BuildPlatform }}', 'x64'), eq('${{ matrix.UseFabric }}', 'false'))

0 comments on commit a399157

Please sign in to comment.