diff --git a/.ado/templates/build-rnw.yml b/.ado/templates/build-rnw.yml index 2bbce3c21dc..052ebb81e6c 100644 --- a/.ado/templates/build-rnw.yml +++ b/.ado/templates/build-rnw.yml @@ -18,32 +18,14 @@ parameters: vsComponents: '' steps: - - task: CmdLine@2 - displayName: Modify package.json to use unforked RN - inputs: - script: node scripts/useUnForkedRN.js - workingDirectory: $(Build.SourcesDirectory)/vnext - condition: and(succeeded(), not('${{parameters.useRnFork}}')) - - - task: CmdLine@2 - displayName: yarn install (Using microsoft/react-native) - inputs: - script: yarn install --frozen-lockfile - condition: and(succeeded(), '${{parameters.useRnFork}}') - - # We can't use a frozen lockfile for both the fork and non-fork, since they install different dependencies - # We don't want to force devs to update/create two lock files on every change, so just don't freeze when - # using the non fork version. - - task: CmdLine@2 - displayName: yarn install (Using facebook/react-native) - inputs: - script: yarn install - condition: and(succeeded(), not('${{parameters.useRnFork}}')) - - - task: CmdLine@2 - displayName: yarn ${{ parameters.yarnBuildCmd }} - inputs: - script: yarn ${{ parameters.yarnBuildCmd }} + - template: prepare-env.yml + parameters: + useRnFork: ${{ parameters.useRnFork }} + vsInstallerUri: ${{ parameters.vsInstallerUri }} + vsComponents: ${{ parameters.vsComponents }} + yarnBuildCmd: ${{ parameters.yarnBuildCmd }} + debug: ${{ parameters.debug }} + forceVSDependencies: false - task: NuGetCommand@2 displayName: NuGet restore @@ -55,21 +37,6 @@ steps: restoreDirectory: packages/ verbosityRestore: Detailed # Options: quiet, normal, detailed - - template: install-SDK.yml - parameters: - sdkVersion: $(Win10Version) - - - task: PowerShell@2 - displayName: Install Visual Studio dependencies - inputs: - targetType: filePath - filePath: $(Build.SourcesDirectory)/vnext/Scripts/Tfs/Install-VsFeatures.ps1 - arguments: - -InstallerUri ${{ parameters.vsInstallerUri }} - -Components ${{ parameters.vsComponents }} - -Collect:$${{ parameters.debug }} - condition: and(ne('${{parameters.vsComponents}}', ''), eq(variables['VmImage'], 'windows-2019')) - - task: MSBuild@1 displayName: MSBuild ${{parameters.project}} inputs: diff --git a/.ado/templates/e2e-test-job.yml b/.ado/templates/e2e-test-job.yml index 64bbcaeb2e2..0e876a7ee7c 100644 --- a/.ado/templates/e2e-test-job.yml +++ b/.ado/templates/e2e-test-job.yml @@ -16,73 +16,23 @@ jobs: timeoutInMinutes: 60 # how long to run the job before automatically cancelling cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them steps: - - checkout: self # self represents the repo where the initial Pipelines YAML file was found - clean: true # whether to fetch clean each time - # fetchDepth: 2 # the depth of commits to ask Git to fetch - lfs: false # whether to download Git-LFS files - submodules: false # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules - persistCredentials: false # set to 'true' to leave the OAuth token in the Git config after the initial fetch - - - task: UseNode@1 - inputs: - version: '10.x' - - - task: PowerShell@2 - displayName: "Remove WebDriverIO Workaround" - inputs: - targetType: "inline" - script: '((Get-Content -path packages/E2ETest/package.json -Raw) -replace ".*webdriver.git.*","") | Set-Content -Path packages/E2ETest/package.json' + - checkout: self + clean: false + submodules: false + + - template: prepare-env.yml + parameters: + useRnFork: ${{ parameters.UseRNFork }} + vsComponents: ${{ parameters.vsComponents }} + yarnBuildCmd: build + vsInstallerUri: ${{ parameters.vsInstallerUri }} + forceVSDependencies: true - task: CmdLine@2 displayName: Install react-native-cli inputs: script: npm install -g react-native-cli - - task: CmdLine@2 - displayName: Modify package.json to use unforked RN - inputs: - script: node scripts/useUnForkedRN.js - workingDirectory: vnext - condition: and(succeeded(), eq('${{ parameters.UseRNFork }}', 'false')) - - - task: CmdLine@2 - displayName: yarn install (Using microsoft/react-native) - inputs: - script: yarn install --frozen-lockfile - condition: and(succeeded(), eq('${{ parameters.UseRNFork }}', 'true')) - - # We can't use a frozen lockfile for both the fork and non-fork, since they install different dependencies - # We don't want to force devs to update/create two lock files on every change, so just don't freeze when - # using the non fork version. - - task: CmdLine@2 - displayName: yarn install (Using facebook/react-native) - inputs: - script: yarn install - condition: and(succeeded(), eq('${{ parameters.UseRNFork }}', 'false')) - - - task: PowerShell@2 - displayName: "Patch WebDriverIO" - inputs: - targetType: "inline" - script: '((Get-Content -path node_modules/webdriver/build/utils.js -Raw) -replace "if \(!body .*","if (!body) {") | Set-Content -Path node_modules/webdriver/build/utils.js' - - - template: stop-packagers.yml - - - task: CmdLine@2 - displayName: yarn build - inputs: - script: yarn build - - - task: PowerShell@2 - displayName: Install Visual Studio dependencies - inputs: - targetType: filePath - filePath: $(Build.SourcesDirectory)/vnext/Scripts/Tfs/Install-VsFeatures.ps1 - arguments: - -InstallerUri ${{ parameters.vsInstallerUri }} - -Components ${{ parameters.vsComponents }} - condition: ne('${{parameters.vsComponents}}', '') - - task: NuGetCommand@2 displayName: NuGet restore - ReactUWPTestApp inputs: @@ -94,14 +44,14 @@ jobs: displayName: Install MUX framework package inputs: targetType: "inline" - script: Add-AppPackage -path $(Build.SourcesDirectory)/packages/E2ETest/windows/packages/Microsoft.UI.Xaml.2.3.191129002/tools/AppX/${{ parameters.BuildPlatform }}/Release/Microsoft.UI.Xaml.2.3.appx + script: Add-AppxPackage -path $(Build.SourcesDirectory)/packages/E2ETest/windows/packages/Microsoft.UI.Xaml.2.3.191129002/tools/AppX/${{ parameters.BuildPlatform }}/Release/Microsoft.UI.Xaml.2.3.appx - task: CmdLine@2 displayName: Create bundle inputs: script: yarn run bundle workingDirectory: packages/E2ETest - + - task: CmdLine@2 displayName: run-windows inputs: @@ -115,7 +65,22 @@ jobs: pathtoPublish: packages/E2ETest/msbuild.binlog artifactName: 'ReactUWPTestApp build log' publishLocation: 'Container' - + + - task: CopyFiles@2 + displayName: Copy ReactUWPTestApp artifacts + inputs: + sourceFolder: $(Build.SourcesDirectory)/packages/E2ETest/windows/ReactUWPTestApp + targetFolder: $(Build.StagingDirectory)/ReactUWPTestApp + contents: AppPackages\** + condition: succeededOrFailed() + + - task: PublishBuildArtifacts@1 + displayName: "Publish Artifact:ReactUWPTestApp" + inputs: + artifactName: ReactUWPTestApp + pathtoPublish: $(Build.StagingDirectory)/ReactUWPTestApp + condition: succeededOrFailed() + # Wait for app to launch. A workaround to avoid WinAppDriver error: Failed to locate opened application window with appId - task: PowerShell@2 displayName: Wait for app to launch @@ -142,20 +107,6 @@ jobs: testResultsFiles: "packages/E2ETest/reports/*.log" condition: succeededOrFailed() - - task: PowerShell@2 - displayName: "Show package.json" - inputs: - targetType: "inline" - script: "Get-Content packages/E2ETest/package.json | foreach {Write-Output $_}" - condition: failed() - - - task: PowerShell@2 - displayName: "Show node_modules/webdriver/build/utils.js" - inputs: - targetType: "inline" - script: "Get-Content node_modules/webdriver/build/utils.js | foreach {Write-Output $_}" - condition: failed() - - task: PowerShell@2 displayName: "Show appium log" inputs: diff --git a/.ado/templates/prepare-env.yml b/.ado/templates/prepare-env.yml new file mode 100644 index 00000000000..17be92e3c32 --- /dev/null +++ b/.ado/templates/prepare-env.yml @@ -0,0 +1,65 @@ +# Steps to checkout, install node_modules, yarn build, install SDK and install VS dependencies + +parameters: + useRnFork: true + yarnBuildCmd: build + debug: false + forceVSDependencies: false + + # Visual Studio Installer + vsInstallerUri: 'https://download.visualstudio.microsoft.com/download/pr/c4fef23e-cc45-4836-9544-70e213134bc8/1ee5717e9a1e05015756dff77eb27d554a79a6db91f2716d836df368381af9a1/vs_Enterprise.exe' + vsComponents: '' + +steps: + - task: UseNode@1 + inputs: + version: '10.x' + + - task: CmdLine@2 + displayName: Modify package.json to use unforked RN + inputs: + script: node scripts/useUnForkedRN.js + workingDirectory: $(Build.SourcesDirectory)/vnext + condition: and(succeeded(), not('${{parameters.useRnFork}}')) + + - task: CmdLine@2 + displayName: yarn install (Using microsoft/react-native) + inputs: + script: yarn install --frozen-lockfile + condition: and(succeeded(), '${{parameters.useRnFork}}') + + # We can't use a frozen lockfile for both the fork and non-fork, since they install different dependencies + # We don't want to force devs to update/create two lock files on every change, so just don't freeze when + # using the non fork version. + - task: CmdLine@2 + displayName: yarn install (Using facebook/react-native) + inputs: + script: yarn install + condition: and(succeeded(), not('${{parameters.useRnFork}}')) + + - task: CmdLine@2 + displayName: yarn ${{ parameters.yarnBuildCmd }} + inputs: + script: yarn ${{ parameters.yarnBuildCmd }} + + - template: install-SDK.yml + parameters: + sdkVersion: $(Win10Version) + + - task: PowerShell@2 + displayName: Install Visual Studio dependencies + inputs: + targetType: filePath + filePath: $(Build.SourcesDirectory)/vnext/Scripts/Tfs/Install-VsFeatures.ps1 + arguments: + -InstallerUri ${{ parameters.vsInstallerUri }} + -Components ${{ parameters.vsComponents }} + -Collect:$${{ parameters.debug }} + condition: and(ne('${{parameters.vsComponents}}', ''), or(eq(variables['VmImage'], 'windows-2019'), ${{ parameters.forceVSDependencies }})) + + - task: PowerShell@2 + displayName: List disksize by Get-WmiObject Win32_LogicalDisk + inputs: + targetType: inline # filePath | inline + script: | + Get-WmiObject Win32_LogicalDisk \ No newline at end of file diff --git a/.ado/windows-vs-pr.yml b/.ado/windows-vs-pr.yml index f9543164443..56083008256 100644 --- a/.ado/windows-vs-pr.yml +++ b/.ado/windows-vs-pr.yml @@ -31,17 +31,17 @@ jobs: BuildPlatform: x64 UseRNFork: true LayoutHeaders: true - X86Debug: - BuildConfiguration: Debug - BuildPlatform: x86 + X64Release: + BuildConfiguration: Release + BuildPlatform: x64 UseRNFork: true ArmDebug: BuildConfiguration: Debug BuildPlatform: arm UseRNFork: true - X64Release: - BuildConfiguration: Release - BuildPlatform: x64 + X86Debug: + BuildConfiguration: Debug + BuildPlatform: x86 UseRNFork: true X86Release: BuildConfiguration: Release @@ -65,10 +65,6 @@ jobs: clean: false submodules: false - - task: UseNode@1 - inputs: - version: '10.x' - - template: templates/build-rnw.yml parameters: useRnFork: $(UseRNFork) @@ -83,17 +79,35 @@ jobs: contents: | ReactUWP\** - - task: DeleteFiles@1 - displayName: Delete vnext/build folder - inputs: - SourceFolder: vnext/build - Contents: '**/*' + - job: RNWUniversalOtherProjectsPR + displayName: Universal Other Projects PR + dependsOn: Setup + condition: ne( dependencies.Setup.outputs['checkPayload.shouldSkipPRBuild'], 'True' ) + strategy: + matrix: + X86Debug: + BuildConfiguration: Debug + BuildPlatform: x86 + UseRNFork: true + X64Release: + BuildConfiguration: Release + BuildPlatform: x64 + UseRNFork: true + pool: + vmImage: $(VmImage) + timeoutInMinutes: 60 + cancelTimeoutInMinutes: 5 - - task: DeleteFiles@1 - displayName: Delete vnext/target folder - inputs: - SourceFolder: vnext/target - Contents: '**/*' + steps: + - checkout: self + clean: false + submodules: false + + - template: templates/prepare-env.yml + parameters: + useRnFork: $(UseRNFork) + vsComponents: $(VsComponents),Microsoft.VisualStudio.Component.VC.v141.ARM + yarnBuildCmd: buildci - task: NuGetCommand@2 displayName: NuGet restore - Playground @@ -158,6 +172,7 @@ jobs: workingDirectory: vnext condition: and(succeeded(), eq(variables['UseRNFork'], 'true')) + - job: RNWDesktopPR displayName: Desktop PR dependsOn: Setup @@ -190,10 +205,6 @@ jobs: clean: false submodules: false - - task: UseNode@1 - inputs: - version: '10.x' - - task: VisualStudioTestPlatformInstaller@1 inputs: testPlatformVersion: 16.3.0