From 18ef8241414a0f4aed429cf19ada929a2c475ea6 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Wed, 21 Feb 2024 11:15:07 -0800 Subject: [PATCH 01/36] [ci] Migrate to the 1ES template Context: https://aka.ms/1espt The build pipeline has been updated to extend the 1ES pipeline template, which will keep the pipeline up to date with the latest compliance and security requirements. Compliance tasks and scans will run automatically as part of artifact upload steps. --- .../automation/azure-pipelines-nightly.yaml | 12 - build-tools/automation/azure-pipelines.yaml | 1171 ++++++++--------- .../yaml-templates/apk-instrumentation.yaml | 35 +- .../yaml-templates/build-linux.yaml | 36 +- .../yaml-templates/build-macos.yaml | 36 +- .../yaml-templates/build-windows.yaml | 22 +- .../yaml-templates/commercial-build.yaml | 14 +- .../yaml-templates/plots-to-appinsights.yaml | 62 - .../yaml-templates/publish-artifact.yaml | 2 +- .../yaml-templates/run-designer-tests.yml | 79 -- .../yaml-templates/run-emulator-tests.yaml | 11 +- .../yaml-templates/run-installer.yaml | 40 - .../yaml-templates/run-msbuild-tests.yaml | 15 +- .../yaml-templates/run-nunit-tests.yaml | 66 +- .../run-sliced-nunit-tests.yaml | 4 +- .../yaml-templates/run-xaprepare.yaml | 3 +- .../setup-test-environment.yaml | 30 +- .../yaml-templates/setup-ubuntu.yaml | 36 +- .../stage-msbuild-emulator-tests.yaml | 29 +- .../yaml-templates/stage-msbuild-tests.yaml | 4 +- .../yaml-templates/upload-results.yaml | 6 +- .../yaml-templates/use-dot-net.yaml | 1 - .../automation/yaml-templates/variables.yaml | 4 + 23 files changed, 657 insertions(+), 1061 deletions(-) delete mode 100644 build-tools/automation/yaml-templates/plots-to-appinsights.yaml delete mode 100644 build-tools/automation/yaml-templates/run-designer-tests.yml delete mode 100644 build-tools/automation/yaml-templates/run-installer.yaml diff --git a/build-tools/automation/azure-pipelines-nightly.yaml b/build-tools/automation/azure-pipelines-nightly.yaml index 69ac75c87e6..84611f455db 100644 --- a/build-tools/automation/azure-pipelines-nightly.yaml +++ b/build-tools/automation/azure-pipelines-nightly.yaml @@ -118,9 +118,6 @@ stages: steps: - template: yaml-templates/setup-test-environment.yaml parameters: - installLegacyDotNet: false - restoreNUnitConsole: false - updateMono: false xaprepareScenario: EmulatorTestDependencies jdkTestFolder: $(JAVA_HOME_11_X64) @@ -200,9 +197,6 @@ stages: - template: yaml-templates/setup-test-environment.yaml parameters: installTestSlicer: true - installLegacyDotNet: false - restoreNUnitConsole: false - updateMono: false xaprepareScenario: EmulatorTestDependencies jdkTestFolder: $HOME/android-toolchain/jdk-17 @@ -258,9 +252,6 @@ stages: - template: yaml-templates/setup-test-environment.yaml parameters: installTestSlicer: true - installLegacyDotNet: false - restoreNUnitConsole: false - updateMono: false xaprepareScenario: EmulatorTestDependencies jdkTestFolder: $HOME/android-toolchain/jdk-17 @@ -303,9 +294,6 @@ stages: - template: yaml-templates/setup-test-environment.yaml parameters: installApkDiff: false - installLegacyDotNet: false - restoreNUnitConsole: false - updateMono: false - task: DownloadPipelineArtifact@2 displayName: Download binutils pdbs diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 7a77f691e7c..afb97df628f 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -11,10 +11,14 @@ trigger: # External sources, scripts, tests, and yaml template files. resources: repositories: + - repository: 1esPipelines + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release - repository: yaml-templates type: github name: xamarin/yaml-templates - ref: refs/heads/main + ref: refs/heads/dev/pjc/1es-nuget-convert endpoint: xamarin - repository: sdk-insertions type: github @@ -39,6 +43,8 @@ resources: parameters: - name: macTestAgentsUseCleanImages # Test agents we do not need to clean up when finished because they are not reused default: true +- name: Skip1ESComplianceTasks + default: false # Global variables variables: @@ -58,11 +64,7 @@ variables: - name: MacBuildPoolName value: Azure Pipelines - name: MacBuildPoolImage - value: internal-macos12 - - name: LinuxBuildPoolName - value: android-devdiv-ubuntu-vmss - - name: LinuxBuildPoolImage - value: '' + value: macOS-13 - ${{ if or(and(ne(variables['Build.DefinitionName'],'Xamarin.Android'), ne(variables['Build.DefinitionName'], 'Xamarin.Android-Private')), eq(variables['Build.Reason'], 'PullRequest')) }}: - name: MicroBuildSignType value: Test @@ -70,647 +72,556 @@ variables: value: VSEng-Xamarin-RedmondMac-Android-Untrusted - name: MacBuildPoolImage value: '' - - name: LinuxBuildPoolName - value: android-devdiv-ubuntu-vmss-pr - - name: LinuxBuildPoolImage - value: '' - name: DisablePipelineConfigDetector value: true -# Stage and Job "display names" are shortened because they are combined to form the name of the corresponding GitHub check. -stages: -- template: yaml-templates/build-macos.yaml - -- template: yaml-templates/build-windows.yaml - -# Check - "Xamarin.Android (Linux > Build)" -- template: yaml-templates/build-linux.yaml - -- stage: smoke_tests - displayName: Package Tests - dependsOn: mac_build - jobs: - # Check - "Xamarin.Android (macOS > Tests > APKs .NET)" - - job: mac_apk_tests_net - displayName: macOS > Tests > APKs .NET - pool: - vmImage: $(HostedMacImage) - timeoutInMinutes: 180 - workspace: - clean: all - steps: - - template: yaml-templates/setup-test-environment.yaml - parameters: - provisionClassic: false - installLegacyDotNet: false - restoreNUnitConsole: false - updateMono: false - xaprepareScenario: EmulatorTestDependencies - - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: $(TestAssembliesArtifactName) - downloadPath: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration) - - # Set up dependencies to run tests in both debug and release configurations - - task: DotNetCoreCLI@2 - displayName: build Xamarin.Android.Tools.BootstrapTasks.csproj - inputs: - projects: $(System.DefaultWorkingDirectory)/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj - arguments: -c Debug -bl:$(System.DefaultWorkingDirectory)/bin/TestDebug/BootstrapTasks.binlog - - - template: yaml-templates/run-dotnet-preview.yaml - parameters: - project: Xamarin.Android.sln - arguments: >- - -t:PrepareJavaInterop -c Debug --no-restore - -p:DotNetPreviewTool=$(System.DefaultWorkingDirectory)/bin/$(XA.Build.Configuration)/dotnet/dotnet - displayName: prepare java.interop Debug - continueOnError: false - - - template: yaml-templates/run-dotnet-preview.yaml - parameters: - project: Xamarin.Android.sln - arguments: -t:PrepareJavaInterop -c $(XA.Build.Configuration) --no-restore - displayName: prepare java.interop $(XA.Build.Configuration) - continueOnError: false - - template: yaml-templates/start-stop-emulator.yaml +extends: + ${{ if eq(variables['MicroBuildSignType'], 'Real') }}: + template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines + ${{ else }}: + template: v1/1ES.Unofficial.PipelineTemplate.yml@1esPipelines + parameters: + sdl: + ${{ if eq('${{ parameters.Skip1ESComplianceTasks }}', 'true') }}: + enableAllTools: false + codeql: + runSourceLanguagesInSourceAnalysis: true + suppression: + suppressionFile: $(Build.SourcesDirectory)\build-tools\automation\guardian\source.gdnsuppress + sourceAnalysisPool: + name: AzurePipelines-EO + image: $(WindowsPoolImage1ESPT) + os: windows + # Stage and Job "display names" are shortened because they are combined to form the name of the corresponding GitHub check. + stages: + - template: yaml-templates/build-macos.yaml@self + + - template: yaml-templates/build-windows.yaml@self + + # Check - "Xamarin.Android (Linux > Build)" + - template: yaml-templates/build-linux.yaml@self + + - stage: smoke_tests + displayName: Package Tests + dependsOn: mac_build + jobs: + # Check - "Xamarin.Android (macOS > Tests > APKs .NET)" + - job: mac_apk_tests_net + displayName: macOS > Tests > APKs .NET + pool: + vmImage: $(HostedMacImage) + timeoutInMinutes: 180 + workspace: + clean: all + steps: + - template: yaml-templates/setup-test-environment.yaml@self + parameters: + xaprepareScenario: EmulatorTestDependencies - - template: yaml-templates/apk-instrumentation.yaml - parameters: - configuration: $(XA.Build.Configuration) - testName: Mono.Android.NET_Tests-$(XA.Build.Configuration) - project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj - testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration).xml - artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab - artifactFolder: $(DotNetTargetFramework)-$(XA.Build.Configuration) - - - template: yaml-templates/apk-instrumentation.yaml - parameters: - buildConfiguration: $(XA.Build.Configuration) - configuration: Debug - testName: Mono.Android.NET_Tests-Debug - project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj - testResultsFiles: TestResult-Mono.Android.NET_Tests-Debug.xml - artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.apk - artifactFolder: $(DotNetTargetFramework)-Debug - - - template: yaml-templates/apk-instrumentation.yaml - parameters: - configuration: $(XA.Build.Configuration) - testName: Mono.Android.NET_Tests-NoAab - project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj - testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)NoAab.xml - extraBuildArgs: -p:TestsFlavor=NoAab -p:AndroidPackageFormat=apk - artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.apk - artifactFolder: $(DotNetTargetFramework)-NoAab - - - template: yaml-templates/apk-instrumentation.yaml - parameters: - configuration: $(XA.Build.Configuration) - testName: Mono.Android.NET_Tests-Interpreter - project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj - testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)Interpreter.xml - extraBuildArgs: -p:TestsFlavor=Interpreter -p:UseInterpreter=True - artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab - artifactFolder: $(DotNetTargetFramework)-Interpreter - - - template: yaml-templates/apk-instrumentation.yaml - parameters: - configuration: $(XA.Build.Configuration) - testName: Mono.Android.NET_Tests-NoAot - project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj - testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)NoAot.xml - extraBuildArgs: -p:TestsFlavor=NoAot -p:RunAOTCompilation=false - artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab - artifactFolder: $(DotNetTargetFramework)-NoAot - - - template: yaml-templates/apk-instrumentation.yaml - parameters: - configuration: $(XA.Build.Configuration) - testName: Mono.Android.NET_Tests-AotLlvm - project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj - testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)AotLlvm.xml - extraBuildArgs: -p:TestsFlavor=AotLlvm -p:EnableLLVM=true -p:AndroidEnableProfiledAot=false - artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab - artifactFolder: $(DotNetTargetFramework)-AotLlvm - - - template: yaml-templates/apk-instrumentation.yaml - parameters: - configuration: $(XA.Build.Configuration) - testName: Xamarin.Android.JcwGen_Tests - project: tests/CodeGen-Binding/Xamarin.Android.JcwGen-Tests/Xamarin.Android.JcwGen-Tests.csproj - testResultsFiles: TestResult-Xamarin.Android.JcwGen_Tests-$(XA.Build.Configuration).xml - artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Xamarin.Android.JcwGen_Tests-Signed.apk - artifactFolder: $(DotNetTargetFramework)-Default - - - template: yaml-templates/apk-instrumentation.yaml - parameters: - configuration: $(XA.Build.Configuration) - testName: Xamarin.Android.JcwGen_Tests_FastDev - project: tests/CodeGen-Binding/Xamarin.Android.JcwGen-Tests/Xamarin.Android.JcwGen-Tests.csproj - testResultsFiles: TestResult-Xamarin.Android.JcwGen_Tests-$(XA.Build.Configuration).xml - artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Xamarin.Android.JcwGen_Tests-Signed.apk - artifactFolder: $(DotNetTargetFramework)-FastDev_Assemblies_Dexes - extraBuildArgs: /p:AndroidFastDeploymentType=Assemblies:Dexes - - - template: yaml-templates/run-nunit-tests.yaml - parameters: - testRunTitle: Xamarin.Android.Tools.Aidl-Tests - macOS - testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Tools.Aidl-Tests.dll - testResultsFile: TestResult-Aidl-Tests-macOS-$(XA.Build.Configuration).xml - - - task: ShellScript@2 - displayName: Test dotnet-local.sh - inputs: - scriptPath: dotnet-local.sh - args: build samples/HelloWorld/HelloWorld/HelloWorld.DotNet.csproj - - - ${{ if ne(parameters.macTestAgentsUseCleanImages, true) }}: - - template: yaml-templates/start-stop-emulator.yaml - parameters: - command: stop + - task: DownloadPipelineArtifact@2 + inputs: + artifactName: $(TestAssembliesArtifactName) + downloadPath: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration) - - template: yaml-templates/upload-results.yaml - parameters: - artifactName: Test Results - APKs .NET $(XA.Build.Configuration) - macOS + # Set up dependencies to run tests in both debug and release configurations + - task: DotNetCoreCLI@2 + displayName: build Xamarin.Android.Tools.BootstrapTasks.csproj + inputs: + projects: $(System.DefaultWorkingDirectory)/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj + arguments: -c Debug -bl:$(System.DefaultWorkingDirectory)/bin/TestDebug/BootstrapTasks.binlog + + - template: yaml-templates/run-dotnet-preview.yaml@self + parameters: + project: Xamarin.Android.sln + arguments: >- + -t:PrepareJavaInterop -c Debug --no-restore + -p:DotNetPreviewTool=$(System.DefaultWorkingDirectory)/bin/$(XA.Build.Configuration)/dotnet/dotnet + displayName: prepare java.interop Debug + continueOnError: false + + - template: yaml-templates/run-dotnet-preview.yaml@self + parameters: + project: Xamarin.Android.sln + arguments: -t:PrepareJavaInterop -c $(XA.Build.Configuration) --no-restore + displayName: prepare java.interop $(XA.Build.Configuration) + continueOnError: false + + - template: yaml-templates/start-stop-emulator.yaml@self + + - template: yaml-templates/apk-instrumentation.yaml@self + parameters: + configuration: $(XA.Build.Configuration) + testName: Mono.Android.NET_Tests-$(XA.Build.Configuration) + project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj + testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration).xml + artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab + artifactFolder: $(DotNetTargetFramework)-$(XA.Build.Configuration) + + - template: yaml-templates/apk-instrumentation.yaml@self + parameters: + buildConfiguration: $(XA.Build.Configuration) + configuration: Debug + testName: Mono.Android.NET_Tests-Debug + project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj + testResultsFiles: TestResult-Mono.Android.NET_Tests-Debug.xml + artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.apk + artifactFolder: $(DotNetTargetFramework)-Debug + + - template: yaml-templates/apk-instrumentation.yaml@self + parameters: + configuration: $(XA.Build.Configuration) + testName: Mono.Android.NET_Tests-NoAab + project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj + testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)NoAab.xml + extraBuildArgs: -p:TestsFlavor=NoAab -p:AndroidPackageFormat=apk + artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.apk + artifactFolder: $(DotNetTargetFramework)-NoAab + + - template: yaml-templates/apk-instrumentation.yaml@self + parameters: + configuration: $(XA.Build.Configuration) + testName: Mono.Android.NET_Tests-Interpreter + project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj + testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)Interpreter.xml + extraBuildArgs: -p:TestsFlavor=Interpreter -p:UseInterpreter=True + artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab + artifactFolder: $(DotNetTargetFramework)-Interpreter + + - template: yaml-templates/apk-instrumentation.yaml@self + parameters: + configuration: $(XA.Build.Configuration) + testName: Mono.Android.NET_Tests-NoAot + project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj + testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)NoAot.xml + extraBuildArgs: -p:TestsFlavor=NoAot -p:RunAOTCompilation=false + artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab + artifactFolder: $(DotNetTargetFramework)-NoAot + + - template: yaml-templates/apk-instrumentation.yaml@self + parameters: + configuration: $(XA.Build.Configuration) + testName: Mono.Android.NET_Tests-AotLlvm + project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj + testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)AotLlvm.xml + extraBuildArgs: -p:TestsFlavor=AotLlvm -p:EnableLLVM=true -p:AndroidEnableProfiledAot=false + artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab + artifactFolder: $(DotNetTargetFramework)-AotLlvm + + - template: yaml-templates/apk-instrumentation.yaml@self + parameters: + configuration: $(XA.Build.Configuration) + testName: Xamarin.Android.JcwGen_Tests + project: tests/CodeGen-Binding/Xamarin.Android.JcwGen-Tests/Xamarin.Android.JcwGen-Tests.csproj + testResultsFiles: TestResult-Xamarin.Android.JcwGen_Tests-$(XA.Build.Configuration).xml + artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Xamarin.Android.JcwGen_Tests-Signed.apk + artifactFolder: $(DotNetTargetFramework)-Default + + - template: yaml-templates/apk-instrumentation.yaml@self + parameters: + configuration: $(XA.Build.Configuration) + testName: Xamarin.Android.JcwGen_Tests_FastDev + project: tests/CodeGen-Binding/Xamarin.Android.JcwGen-Tests/Xamarin.Android.JcwGen-Tests.csproj + testResultsFiles: TestResult-Xamarin.Android.JcwGen_Tests-$(XA.Build.Configuration).xml + artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Xamarin.Android.JcwGen_Tests-Signed.apk + artifactFolder: $(DotNetTargetFramework)-FastDev_Assemblies_Dexes + extraBuildArgs: /p:AndroidFastDeploymentType=Assemblies:Dexes + + - template: yaml-templates/run-nunit-tests.yaml@self + parameters: + testRunTitle: Xamarin.Android.Tools.Aidl-Tests - macOS + testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Tools.Aidl-Tests.dll + testResultsFile: TestResult-Aidl-Tests-macOS-$(XA.Build.Configuration).xml + + - task: ShellScript@2 + displayName: Test dotnet-local.sh + inputs: + scriptPath: dotnet-local.sh + args: build samples/HelloWorld/HelloWorld/HelloWorld.DotNet.csproj + + - ${{ if ne(parameters.macTestAgentsUseCleanImages, true) }}: + - template: yaml-templates/start-stop-emulator.yaml@self + parameters: + command: stop + + - template: yaml-templates/upload-results.yaml@self + parameters: + artifactName: Test Results - APKs .NET $(XA.Build.Configuration) - macOS + + - template: yaml-templates/upload-results.yaml@self + parameters: + artifactName: Test Results - APKs .NET Debug - macOS + configuration: Debug + + - template: yaml-templates/fail-on-issue.yaml@self + + - stage: linux_tests + displayName: Linux Tests + dependsOn: + - mac_build + - linux_build + jobs: + # Check - "Xamarin.Android (Linux > Tests > MSBuild)" + - job: linux_tests_smoke + displayName: Linux > Tests > MSBuild + pool: + name: android-devdiv-ubuntu-vmss-pr + timeoutInMinutes: 180 + workspace: + clean: all + steps: + - template: yaml-templates/setup-ubuntu.yaml@self + + - template: yaml-templates/setup-test-environment.yaml@self - - template: yaml-templates/upload-results.yaml - parameters: - artifactName: Test Results - APKs .NET Debug - macOS - configuration: Debug - - - template: yaml-templates/fail-on-issue.yaml - -- stage: linux_tests - displayName: Linux Tests - dependsOn: - - mac_build - - linux_build - jobs: - # Check - "Xamarin.Android (Linux > Tests > MSBuild)" - - job: linux_tests_smoke - displayName: Linux > Tests > MSBuild - pool: - name: android-devdiv-ubuntu-vmss-pr - timeoutInMinutes: 180 - workspace: - clean: all - steps: - - template: yaml-templates/setup-ubuntu.yaml - - - template: yaml-templates/setup-test-environment.yaml - - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: $(TestAssembliesArtifactName) - downloadPath: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration) - - - template: yaml-templates/run-nunit-tests.yaml - parameters: - testRunTitle: Xamarin.Android.Build.Tests - Linux BuildTest - testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll - dotNetTestExtraArgs: --filter "Name = BuildTest" - testResultsFile: TestResult-BuildTest-Linux-$(XA.Build.Configuration).xml + - task: DownloadPipelineArtifact@2 + inputs: + artifactName: $(TestAssembliesArtifactName) + downloadPath: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration) + + - template: yaml-templates/run-nunit-tests.yaml@self + parameters: + testRunTitle: Xamarin.Android.Build.Tests - Linux BuildTest + testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll + dotNetTestExtraArgs: --filter "Name = BuildTest" + testResultsFile: TestResult-BuildTest-Linux-$(XA.Build.Configuration).xml + + - template: yaml-templates/run-nunit-tests.yaml@self + parameters: + testRunTitle: Xamarin.Android.Build.Tests - Linux PackagingTest + testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll + dotNetTestExtraArgs: --filter "Name = PackagingTest" + testResultsFile: TestResult-PackagingTest-Linux-$(XA.Build.Configuration).xml + + - template: yaml-templates/run-nunit-tests.yaml@self + parameters: + testRunTitle: Xamarin.Android.Build.Tests - Linux XASdkTests + testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll + dotNetTestExtraArgs: --filter "Name = XASdkTests & Name != XamarinLegacySdk" + testResultsFile: TestResult-XASdkTests-Linux-$(XA.Build.Configuration).xml + + - template: yaml-templates/run-nunit-tests.yaml@self + parameters: + testRunTitle: Xamarin.Android.Build.Tests - Linux AndroidDependenciesTests + testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll + dotNetTestExtraArgs: --filter "Name = AndroidDependenciesTests" + testResultsFile: TestResult-AndroidDependenciesTests-Linux-$(XA.Build.Configuration).xml + + - task: ShellScript@2 + displayName: Test dotnet-local.sh + inputs: + scriptPath: dotnet-local.sh + args: build samples/HelloWorld/HelloWorld/HelloWorld.DotNet.csproj - - template: yaml-templates/run-nunit-tests.yaml - parameters: - testRunTitle: Xamarin.Android.Build.Tests - Linux PackagingTest - testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll - dotNetTestExtraArgs: --filter "Name = PackagingTest" - testResultsFile: TestResult-PackagingTest-Linux-$(XA.Build.Configuration).xml + - template: yaml-templates/upload-results.yaml@self + parameters: + configuration: $(XA.Build.Configuration) + artifactName: Test Results - MSBuild - Linux - - template: yaml-templates/run-nunit-tests.yaml - parameters: - testRunTitle: Xamarin.Android.Build.Tests - Linux XASdkTests - testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll - dotNetTestExtraArgs: --filter "Name = XASdkTests & Name != XamarinLegacySdk" - testResultsFile: TestResult-XASdkTests-Linux-$(XA.Build.Configuration).xml + - template: yaml-templates/fail-on-issue.yaml@self - - template: yaml-templates/run-nunit-tests.yaml - parameters: - testRunTitle: Xamarin.Android.Build.Tests - Linux AndroidDependenciesTests - testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll - dotNetTestExtraArgs: --filter "Name = AndroidDependenciesTests" - testResultsFile: TestResult-AndroidDependenciesTests-Linux-$(XA.Build.Configuration).xml - - - task: ShellScript@2 - displayName: Test dotnet-local.sh - inputs: - scriptPath: dotnet-local.sh - args: build samples/HelloWorld/HelloWorld/HelloWorld.DotNet.csproj - - - template: yaml-templates/upload-results.yaml + - template: yaml-templates/stage-msbuild-tests.yaml@self + + - template: yaml-templates/stage-msbuild-emulator-tests.yaml@self parameters: - configuration: $(XA.Build.Configuration) - artifactName: Test Results - MSBuild - Linux + usesCleanImages: ${{ parameters.macTestAgentsUseCleanImages }} + + - stage: maui_tests + displayName: MAUI Tests + dependsOn: mac_build + condition: and(eq(dependencies.mac_build.result, 'Succeeded'), eq(variables['System.PullRequest.TargetBranch'], 'main')) + jobs: + # Check - "Xamarin.Android (MAUI Tests MAUI Integration)" + - job: maui_tests_integration + displayName: MAUI Integration + pool: $(1ESWindowsPool) + timeoutInMinutes: 180 + workspace: + clean: all + variables: + BuildVersion: $(Build.BuildId) + steps: + - checkout: maui + clean: true + submodules: recursive + path: s/maui + persistCredentials: true + + - template: yaml-templates/setup-test-environment.yaml@self + parameters: + xaSourcePath: $(Build.SourcesDirectory)/xamarin-android + androidSdkPlatforms: $(DefaultTestSdkPlatforms) + + - task: NuGetAuthenticate@1 + displayName: authenticate with azure artifacts + inputs: + forceReinstallCredentialProvider: true - - template: yaml-templates/fail-on-issue.yaml + - script: | + echo ##vso[task.setvariable variable=JI_JAVA_HOME]%JAVA_HOME_17_X64% + echo ##vso[task.setvariable variable=JAVA_HOME]%JAVA_HOME_17_X64% + displayName: set JI_JAVA_HOME, JAVA_HOME to $(JAVA_HOME_17_X64) -- template: yaml-templates/stage-msbuild-tests.yaml + - task: DownloadPipelineArtifact@2 + inputs: + artifactName: $(NuGetArtifactName) + downloadPath: $(Build.StagingDirectory)/android-packs + + - pwsh: | + $searchPath = Join-Path $(Build.StagingDirectory) android-packs + $wlmanPack = Get-ChildItem $searchPath -Filter *Android*Manifest*.nupkg | Select-Object -First 1 + $dest = Join-Path $searchPath "tmp-wlman" "$($wlmanPack.BaseName)" + Expand-Archive -LiteralPath $wlmanPack -DestinationPath $dest + $wlmanJsonPath = Join-Path $dest "data" "WorkloadManifest.json" + $json = Get-Content $wlmanJsonPath | ConvertFrom-Json -AsHashtable + Write-Host "Setting variable ANDROID_PACK_VERSION = $($json["version"])" + Write-Host "##vso[task.setvariable variable=ANDROID_PACK_VERSION;]$($json["version"])" + displayName: Set ANDROID_PACK_VERSION + + - pwsh: >- + $(Build.SourcesDirectory)/maui/eng/scripts/update-version-props.ps1 + -xmlFileName "$(Build.SourcesDirectory)/maui/eng/Versions.props" + -androidVersion $(ANDROID_PACK_VERSION) + displayName: Update MAUI's Android dependency + + - task: DotNetCoreCLI@2 + displayName: Update Android SDK band in Workloads.csproj + inputs: + projects: $(Build.SourcesDirectory)/xamarin-android/Xamarin.Android.sln + arguments: -t:UpdateMauiWorkloadsProj -c $(XA.Build.Configuration) --no-restore -v:n -bl:$(Build.StagingDirectory)/logs/update-maui-workloadsproj.binlog -- template: yaml-templates/stage-msbuild-emulator-tests.yaml - parameters: - usesCleanImages: ${{ parameters.macTestAgentsUseCleanImages }} - -- stage: maui_tests - displayName: MAUI Tests - dependsOn: mac_build - condition: and(eq(dependencies.mac_build.result, 'Succeeded'), eq(variables['System.PullRequest.TargetBranch'], 'main')) - jobs: - # Check - "Xamarin.Android (MAUI Tests MAUI Integration)" - - job: maui_tests_integration - displayName: MAUI Integration - pool: $(1ESWindowsPool) - timeoutInMinutes: 180 - workspace: - clean: all - variables: - BuildVersion: $(Build.BuildId) - steps: - - checkout: maui - clean: true - submodules: recursive - path: s/maui - persistCredentials: true - - - template: yaml-templates/setup-test-environment.yaml - parameters: - xaSourcePath: $(Build.SourcesDirectory)/xamarin-android - provisionClassic: false - installLegacyDotNet: false - restoreNUnitConsole: false - updateMono: false - androidSdkPlatforms: $(DefaultTestSdkPlatforms) - - - task: NuGetAuthenticate@1 - displayName: authenticate with azure artifacts - inputs: - forceReinstallCredentialProvider: true - - - script: | - echo ##vso[task.setvariable variable=JI_JAVA_HOME]%JAVA_HOME_17_X64% - echo ##vso[task.setvariable variable=JAVA_HOME]%JAVA_HOME_17_X64% - displayName: set JI_JAVA_HOME, JAVA_HOME to $(JAVA_HOME_17_X64) - - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: $(NuGetArtifactName) - downloadPath: $(Build.StagingDirectory)/android-packs - - - pwsh: | - $searchPath = Join-Path $(Build.StagingDirectory) android-packs - $wlmanPack = Get-ChildItem $searchPath -Filter *Android*Manifest*.nupkg | Select-Object -First 1 - $dest = Join-Path $searchPath "tmp-wlman" "$($wlmanPack.BaseName)" - Expand-Archive -LiteralPath $wlmanPack -DestinationPath $dest - $wlmanJsonPath = Join-Path $dest "data" "WorkloadManifest.json" - $json = Get-Content $wlmanJsonPath | ConvertFrom-Json -AsHashtable - Write-Host "Setting variable ANDROID_PACK_VERSION = $($json["version"])" - Write-Host "##vso[task.setvariable variable=ANDROID_PACK_VERSION;]$($json["version"])" - displayName: Set ANDROID_PACK_VERSION - - - pwsh: >- - $(Build.SourcesDirectory)/maui/eng/scripts/update-version-props.ps1 - -xmlFileName "$(Build.SourcesDirectory)/maui/eng/Versions.props" - -androidVersion $(ANDROID_PACK_VERSION) - displayName: Update MAUI's Android dependency - - - task: DotNetCoreCLI@2 - displayName: Update Android SDK band in Workloads.csproj - inputs: - projects: $(Build.SourcesDirectory)/xamarin-android/Xamarin.Android.sln - arguments: -t:UpdateMauiWorkloadsProj -c $(XA.Build.Configuration) --no-restore -v:n -bl:$(Build.StagingDirectory)/logs/update-maui-workloadsproj.binlog - - - pwsh: ./build.ps1 --target=dotnet --configuration="$(XA.Build.Configuration)" --nugetsource="$(Build.StagingDirectory)\android-packs" --verbosity=diagnostic - displayName: Install .NET - retryCountOnTaskFailure: 3 - workingDirectory: $(Build.SourcesDirectory)/maui - - - pwsh: ./build.ps1 --target=dotnet-pack --configuration="$(XA.Build.Configuration)" --nugetsource="$(Build.StagingDirectory)\android-packs" --verbosity=diagnostic - displayName: Pack .NET Maui - workingDirectory: $(Build.SourcesDirectory)/maui - - - task: DotNetCoreCLI@2 - displayName: Install MAUI workload packs - retryCountOnTaskFailure: 3 - inputs: - projects: $(Build.SourcesDirectory)/xamarin-android/Xamarin.Android.sln - arguments: -t:InstallMaui -p:MauiUseLocalPacks=true -p:MauiWorkloadToInstall=maui -c $(XA.Build.Configuration) --no-restore -v:n -bl:$(Build.StagingDirectory)/logs/install-maui.binlog - - - template: yaml-templates/run-dotnet-preview.yaml - parameters: - command: new - arguments: maui -o $(Build.StagingDirectory)/MauiTestProj - xaSourcePath: $(Build.SourcesDirectory)/xamarin-android - displayName: Create MAUI template - continueOnError: false - - - powershell: | - $project = '$(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj' - [xml] $xml = Get-Content $project - $node = $xml.SelectSingleNode('/Project/PropertyGroup/TargetFrameworks') - $node.InnerText = '$(DotNetTargetFramework)-android' - $xml.Save($project) - displayName: set TargetFrameworks to Android-only - - - template: yaml-templates/run-dotnet-preview.yaml - parameters: - project: $(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj - arguments: >- - -f $(DotNetTargetFramework)-android -c Debug - --configfile $(Build.SourcesDirectory)/maui/NuGet.config - -bl:$(Build.StagingDirectory)/logs/MauiTestProj-Debug.binlog - xaSourcePath: $(Build.SourcesDirectory)/xamarin-android - displayName: Build MAUI template - Debug - - - template: yaml-templates/run-dotnet-preview.yaml - parameters: - project: $(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj - arguments: >- - -f $(DotNetTargetFramework)-android -c Release - --configfile $(Build.SourcesDirectory)/maui/NuGet.config - -bl:$(Build.StagingDirectory)/logs/MauiTestProj-Release.binlog - xaSourcePath: $(Build.SourcesDirectory)/xamarin-android - displayName: Build MAUI template - Release - - - task: CopyFiles@2 - displayName: copy build logs - condition: always() - inputs: - Contents: | - $(Build.SourcesDirectory)/maui/artifacts/logs/** - TargetFolder: $(Build.StagingDirectory)/logs - flattenFolders: true - - - template: yaml-templates/publish-artifact.yaml - parameters: - displayName: upload build and test results - artifactName: Test Results - MAUI Integration - targetPath: $(Build.StagingDirectory)/logs - condition: or(ne(variables['Agent.JobStatus'], 'Succeeded'), eq(variables['XA.PublishAllLogs'], 'true')) - - - template: yaml-templates/fail-on-issue.yaml - - -- stage: dotnet_prepare_release - displayName: Prepare .NET Release - dependsOn: - - mac_build - - linux_build - condition: and(eq(dependencies.mac_build.result, 'Succeeded'), eq(dependencies.linux_build.result, 'Succeeded'), eq(variables['MicroBuildSignType'], 'Real')) - jobs: - # Check - "Xamarin.Android (Prepare .NET Release Sign Archives)" - - template: sign-artifacts/jobs/v2.yml@yaml-templates - parameters: - name: sign_net_mac_win - poolName: $(VSEngMicroBuildPool) - artifactName: $(NuGetArtifactName) - signType: $(MicroBuildSignType) - signedArtifactName: nuget-signed - usePipelineArtifactTasks: true - - # Check - "Xamarin.Android (Prepare .NET Release Sign Linux Archive)" - - template: sign-artifacts/jobs/v2.yml@yaml-templates - parameters: - name: sign_net_linux - displayName: Sign Linux Archive - poolName: $(VSEngMicroBuildPool) - artifactName: $(LinuxNuGetArtifactName) - signType: $(MicroBuildSignType) - signedArtifactName: nuget-linux-signed - usePipelineArtifactTasks: true - - # Check - "Xamarin.Android (Prepare .NET Release Convert NuGet to MSI)" - - template: nuget-msi-convert/job/v3.yml@yaml-templates - parameters: - yamlResourceName: yaml-templates - dependsOn: sign_net_mac_win - artifactName: nuget-signed - artifactPatterns: | - !*Darwin* - propsArtifactName: $(NuGetArtifactName) - signType: $(MicroBuildSignType) - postConvertSteps: - - task: DownloadPipelineArtifact@2 - inputs: + - pwsh: ./build.ps1 --target=dotnet --configuration="$(XA.Build.Configuration)" --nugetsource="$(Build.StagingDirectory)\android-packs" --verbosity=diagnostic + displayName: Install .NET + retryCountOnTaskFailure: 3 + workingDirectory: $(Build.SourcesDirectory)/maui + + - pwsh: ./build.ps1 --target=dotnet-pack --configuration="$(XA.Build.Configuration)" --nugetsource="$(Build.StagingDirectory)\android-packs" --verbosity=diagnostic + displayName: Pack .NET Maui + workingDirectory: $(Build.SourcesDirectory)/maui + + - task: DotNetCoreCLI@2 + displayName: Install MAUI workload packs + retryCountOnTaskFailure: 3 + inputs: + projects: $(Build.SourcesDirectory)/xamarin-android/Xamarin.Android.sln + arguments: -t:InstallMaui -p:MauiUseLocalPacks=true -p:MauiWorkloadToInstall=maui -c $(XA.Build.Configuration) --no-restore -v:n -bl:$(Build.StagingDirectory)/logs/install-maui.binlog + + - template: yaml-templates/run-dotnet-preview.yaml@self + parameters: + command: new + arguments: maui -o $(Build.StagingDirectory)/MauiTestProj + xaSourcePath: $(Build.SourcesDirectory)/xamarin-android + displayName: Create MAUI template + continueOnError: false + + - powershell: | + $project = '$(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj' + [xml] $xml = Get-Content $project + $node = $xml.SelectSingleNode('/Project/PropertyGroup/TargetFrameworks') + $node.InnerText = '$(DotNetTargetFramework)-android' + $xml.Save($project) + displayName: set TargetFrameworks to Android-only + + - template: yaml-templates/run-dotnet-preview.yaml@self + parameters: + project: $(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj + arguments: >- + -f $(DotNetTargetFramework)-android -c Debug + --configfile $(Build.SourcesDirectory)/maui/NuGet.config + -bl:$(Build.StagingDirectory)/logs/MauiTestProj-Debug.binlog + xaSourcePath: $(Build.SourcesDirectory)/xamarin-android + displayName: Build MAUI template - Debug + + - template: yaml-templates/run-dotnet-preview.yaml@self + parameters: + project: $(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj + arguments: >- + -f $(DotNetTargetFramework)-android -c Release + --configfile $(Build.SourcesDirectory)/maui/NuGet.config + -bl:$(Build.StagingDirectory)/logs/MauiTestProj-Release.binlog + xaSourcePath: $(Build.SourcesDirectory)/xamarin-android + displayName: Build MAUI template - Release + + - task: CopyFiles@2 + displayName: copy build logs + condition: always() + inputs: + Contents: | + $(Build.SourcesDirectory)/maui/artifacts/logs/** + TargetFolder: $(Build.StagingDirectory)/logs + flattenFolders: true + + - template: yaml-templates/publish-artifact.yaml@self + parameters: + displayName: upload build and test results + artifactName: Test Results - MAUI Integration + targetPath: $(Build.StagingDirectory)/logs + condition: or(ne(variables['Agent.JobStatus'], 'Succeeded'), eq(variables['XA.PublishAllLogs'], 'true')) + + - template: yaml-templates/fail-on-issue.yaml@self + + + - stage: dotnet_prepare_release + displayName: Prepare .NET Release + dependsOn: + - mac_build + - linux_build + condition: and(eq(dependencies.mac_build.result, 'Succeeded'), eq(dependencies.linux_build.result, 'Succeeded'), eq(variables['MicroBuildSignType'], 'Real')) + jobs: + # Check - "Xamarin.Android (Prepare .NET Release Sign Archives)" + - template: sign-artifacts/jobs/v2.yml@yaml-templates + parameters: + name: sign_net_mac_win + poolName: $(VSEngMicroBuildPool) artifactName: $(NuGetArtifactName) - downloadPath: $(Build.StagingDirectory)\sign-verify - patterns: | - **/SignVerifyIgnore.txt - - - task: MicroBuildCodesignVerify@3 - displayName: verify signed msi content - inputs: - TargetFolders: | - $(Build.ArtifactStagingDirectory)\bin\manifests - $(Build.ArtifactStagingDirectory)\bin\manifests-multitarget - ExcludeSNVerify: true - ApprovalListPathForCerts: $(Build.StagingDirectory)\sign-verify\SignVerifyIgnore.txt - - # Check - "Xamarin.Android (Prepare .NET Release Push Internal)" - - job: push_signed_nugets - displayName: Push Internal - dependsOn: - - nuget_convert - - sign_net_linux - condition: and(eq(dependencies.nuget_convert.result, 'Succeeded'), eq(dependencies.sign_net_linux.result, 'Succeeded')) - timeoutInMinutes: 60 - pool: $(VSEngMicroBuildPool) - workspace: - clean: all - variables: - - ${{ if eq(variables['MicroBuildSignType'], 'Real') }}: - - group: Publish-Build-Assets - steps: - - checkout: self - - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: nuget-signed - downloadPath: $(Build.StagingDirectory)\nuget-signed - - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: nuget-linux-signed - downloadPath: $(Build.StagingDirectory)\nuget-signed - - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: vs-msi-nugets - downloadPath: $(Build.StagingDirectory)\nuget-signed - - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: $(WindowsToolchainPdbArtifactName) - downloadPath: $(Build.StagingDirectory)\nuget-signed - - - task: NuGetCommand@2 - displayName: push nupkgs - inputs: - command: push - packagesToPush: $(Build.StagingDirectory)\nuget-signed\*.nupkg - nuGetFeedType: external - publishFeedCredentials: $(DotNetFeedCredential) - condition: and(succeeded(), eq(variables['PushXAPackages'], 'true')) - - - template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions - parameters: - githubToken: $(GitHub.Token) - githubContext: $(NupkgCommitStatusName) - blobName: $(NupkgCommitStatusName) - packagePrefix: xamarin-android - artifactsPath: $(Build.StagingDirectory)\nuget-signed - yamlResourceName: yaml-templates - - - template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions - parameters: - githubToken: $(GitHub.Token) - githubContext: $(VSDropCommitStatusName) - blobName: $(VSDropCommitStatusName) - packagePrefix: xamarin-android - artifactsPath: $(Build.StagingDirectory)\$(VSDropCommitStatusName) - yamlResourceName: yaml-templates - downloadSteps: + signType: $(MicroBuildSignType) + signedArtifactName: nuget-signed + usePipelineArtifactTasks: true + + # Check - "Xamarin.Android (Prepare .NET Release Sign Linux Archive)" + - template: sign-artifacts/jobs/v2.yml@yaml-templates + parameters: + name: sign_net_linux + displayName: Sign Linux Archive + poolName: $(VSEngMicroBuildPool) + artifactName: $(LinuxNuGetArtifactName) + signType: $(MicroBuildSignType) + signedArtifactName: nuget-linux-signed + usePipelineArtifactTasks: true + use1ESTemplate: true + + # Check - "Xamarin.Android (Prepare .NET Release Convert NuGet to MSI)" + - template: nuget-msi-convert/job/v3.yml@yaml-templates + parameters: + yamlResourceName: yaml-templates + dependsOn: sign_net_mac_win + artifactName: nuget-signed + artifactPatterns: | + !*Darwin* + propsArtifactName: $(NuGetArtifactName) + signType: $(MicroBuildSignType) + use1ESTemplate: true + postConvertSteps: + - task: DownloadPipelineArtifact@2 + inputs: + artifactName: $(NuGetArtifactName) + downloadPath: $(Build.StagingDirectory)\sign-verify + patterns: | + **/SignVerifyIgnore.txt + + - task: MicroBuildCodesignVerify@3 + displayName: verify signed msi content + inputs: + TargetFolders: | + $(Build.ArtifactStagingDirectory)\bin\manifests + $(Build.ArtifactStagingDirectory)\bin\manifests-multitarget + ExcludeSNVerify: true + ApprovalListPathForCerts: $(Build.StagingDirectory)\sign-verify\SignVerifyIgnore.txt + + # Check - "Xamarin.Android (Prepare .NET Release Push Internal)" + - job: push_signed_nugets + displayName: Push Internal + dependsOn: + - nuget_convert + - sign_net_linux + condition: and(eq(dependencies.nuget_convert.result, 'Succeeded'), eq(dependencies.sign_net_linux.result, 'Succeeded')) + timeoutInMinutes: 60 + pool: $(VSEngMicroBuildPool) + workspace: + clean: all + variables: + - ${{ if eq(variables['MicroBuildSignType'], 'Real') }}: + - group: Publish-Build-Assets + steps: + - checkout: self + - task: DownloadPipelineArtifact@2 inputs: - artifactName: vsdrop-signed - downloadPath: $(Build.StagingDirectory)\$(VSDropCommitStatusName) + artifactName: nuget-signed + downloadPath: $(Build.StagingDirectory)\nuget-signed - - template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions - parameters: - githubToken: $(GitHub.Token) - githubContext: $(MultiTargetVSDropCommitStatusName) - blobName: $(MultiTargetVSDropCommitStatusName) - packagePrefix: xamarin-android - artifactsPath: $(Build.StagingDirectory)\$(MultiTargetVSDropCommitStatusName) - yamlResourceName: yaml-templates - downloadSteps: - task: DownloadPipelineArtifact@2 inputs: - artifactName: vsdrop-multitarget-signed - downloadPath: $(Build.StagingDirectory)\$(MultiTargetVSDropCommitStatusName) - - - powershell: >- - & dotnet build -v:n -c $(XA.Build.Configuration) - -t:PushManifestToBuildAssetRegistry - -p:BuildAssetRegistryToken=$(MaestroAccessToken) - -p:OutputPath=$(Build.StagingDirectory)\nuget-signed\ - $(System.DefaultWorkingDirectory)\build-tools\create-packs\Microsoft.Android.Sdk.proj - -bl:$(System.DefaultWorkingDirectory)\bin\Build$(XA.Build.Configuration)\push-bar-manifest.binlog - displayName: generate and publish BAR manifest - condition: and(succeeded(), eq(variables['PushXAPackageInfoToMaestro'], 'true')) - - - powershell: | - $versionEndpoint = 'https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16' - $darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content - $arcadeServicesSource = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' - & dotnet tool update microsoft.dotnet.darc --version "$darcVersion" --add-source "$arcadeServicesSource" --tool-path $(Agent.ToolsDirectory)\darc -v n - & $(Agent.ToolsDirectory)\darc\darc add-build-to-channel --default-channels --id $(BARBuildId) --publishing-infra-version 3 --skip-assets-publishing --password $(MaestroAccessToken) --azdev-pat $(publishing-dnceng-devdiv-code-r-build-re) - displayName: add build to default darc channel - condition: and(succeeded(), eq(variables['PushXAPackageInfoToMaestro'], 'true')) - - - template: yaml-templates\upload-results.yaml - parameters: - xaSourcePath: $(System.DefaultWorkingDirectory) - artifactName: Prepare Release - Push Internal - includeBuildResults: true - - -- stage: post_build - displayName: Post Build - dependsOn: - - dotnet_prepare_release - condition: and(eq(variables['MicroBuildSignType'], 'Real'), eq(dependencies.dotnet_prepare_release.result, 'Succeeded')) - jobs: - - job: sbom - displayName: Generate SBOM - timeoutInMinutes: 60 - pool: - name: AzurePipelines-EO - demands: - - ImageOverride -equals AzurePipelinesWindows2022compliant - variables: - Packaging.EnableSBOMSigning: true - workspace: - clean: all - steps: - - checkout: self - submodules: recursive - - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: nuget-signed - downloadPath: $(Build.StagingDirectory)\packages - patterns: '*.nupkg' - - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: nuget-linux-signed - downloadPath: $(Build.StagingDirectory)\packages - patterns: '*.nupkg' - - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: $(WindowsToolchainPdbArtifactName) - downloadPath: $(Build.StagingDirectory)\packages - - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: vs-msi-nugets - downloadPath: $(Build.StagingDirectory)\packages - patterns: '*.nupkg' - - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: vsdrop-signed - downloadPath: $(Build.StagingDirectory)\packages - patterns: '*.msi' - - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: vsdrop-multitarget-signed - downloadPath: $(Build.StagingDirectory)\packages - patterns: '*.msi' - - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: sbom-components-macos - downloadPath: $(Build.StagingDirectory)\sbom\components-macos - - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: sbom-components-linux - downloadPath: $(Build.StagingDirectory)\sbom\components-linux - - - template: compliance/sbom/scan.v1.yml@yaml-templates - parameters: - dropDirectory: $(Build.StagingDirectory)\packages - componentsDirectory: $(Build.StagingDirectory)\sbom - manifestDirectory: $(Build.StagingDirectory)\sbom - packageName: .NET Android - packageVersionRegex: '(?i)^Microsoft.*\.(?\d+\.\d+\.\d+(-.*)?\.\d+).nupkg$' - -# Check - "Xamarin.Android (Compliance)" -- template: security/full/v0.yml@yaml-templates - parameters: - stageDependsOn: [] - credScanSuppressionFile: $(Build.SourcesDirectory)\build-tools\automation\guardian\CredScanSuppressions.json - sourceGdnSuppressionFile: $(Build.SourcesDirectory)\build-tools\automation\guardian\source.gdnsuppress - tsaConfigFile: $(Build.SourcesDirectory)\build-tools\automation\guardian\tsaoptions-v2.json - policheckLocScanEnabled: true - policheckExclusionFilesFolder: $(Build.SourcesDirectory)\build-tools\automation\guardian - policheckGdnSuppressionFilesFolder: $(Build.SourcesDirectory)\build-tools\automation\guardian - policheckChsScanFolder: $(Build.SourcesDirectory)\Localize\loc\zh-Hans - policheckChtScanFolder: $(Build.SourcesDirectory)\Localize\loc\zh-Hant - policheckCsyScanFolder: $(Build.SourcesDirectory)\Localize\loc\cs - policheckDeuScanFolder: $(Build.SourcesDirectory)\Localize\loc\de - policheckEsnScanFolder: $(Build.SourcesDirectory)\Localize\loc\es - policheckFraScanFolder: $(Build.SourcesDirectory)\Localize\loc\fr - policheckItaScanFolder: $(Build.SourcesDirectory)\Localize\loc\it - policheckJpnScanFolder: $(Build.SourcesDirectory)\Localize\loc\ja - policheckKorScanFolder: $(Build.SourcesDirectory)\Localize\loc\ko - policheckPlkScanFolder: $(Build.SourcesDirectory)\Localize\loc\pl - policheckPtbScanFolder: $(Build.SourcesDirectory)\Localize\loc\pt-BR - policheckRusScanFolder: $(Build.SourcesDirectory)\Localize\loc\ru - policheckTrkScanFolder: $(Build.SourcesDirectory)\Localize\loc\tr + artifactName: nuget-linux-signed + downloadPath: $(Build.StagingDirectory)\nuget-signed + + - task: DownloadPipelineArtifact@2 + inputs: + artifactName: vs-msi-nugets + downloadPath: $(Build.StagingDirectory)\nuget-signed + + - task: DownloadPipelineArtifact@2 + inputs: + artifactName: $(WindowsToolchainPdbArtifactName) + downloadPath: $(Build.StagingDirectory)\nuget-signed + + - task: NuGetCommand@2 + displayName: push nupkgs + inputs: + command: push + packagesToPush: $(Build.StagingDirectory)\nuget-signed\*.nupkg + nuGetFeedType: external + publishFeedCredentials: $(DotNetFeedCredential) + condition: and(succeeded(), eq(variables['PushXAPackages'], 'true')) + + - template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions + parameters: + githubToken: $(GitHub.Token) + githubContext: $(NupkgCommitStatusName) + blobName: $(NupkgCommitStatusName) + packagePrefix: xamarin-android + artifactsPath: $(Build.StagingDirectory)\nuget-signed + yamlResourceName: yaml-templates + + - template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions + parameters: + githubToken: $(GitHub.Token) + githubContext: $(VSDropCommitStatusName) + blobName: $(VSDropCommitStatusName) + packagePrefix: xamarin-android + artifactsPath: $(Build.StagingDirectory)\$(VSDropCommitStatusName) + yamlResourceName: yaml-templates + downloadSteps: + - task: DownloadPipelineArtifact@2 + inputs: + artifactName: vsdrop-signed + downloadPath: $(Build.StagingDirectory)\$(VSDropCommitStatusName) + + - template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions + parameters: + githubToken: $(GitHub.Token) + githubContext: $(MultiTargetVSDropCommitStatusName) + blobName: $(MultiTargetVSDropCommitStatusName) + packagePrefix: xamarin-android + artifactsPath: $(Build.StagingDirectory)\$(MultiTargetVSDropCommitStatusName) + yamlResourceName: yaml-templates + downloadSteps: + - task: DownloadPipelineArtifact@2 + inputs: + artifactName: vsdrop-multitarget-signed + downloadPath: $(Build.StagingDirectory)\$(MultiTargetVSDropCommitStatusName) + + - powershell: >- + & dotnet build -v:n -c $(XA.Build.Configuration) + -t:PushManifestToBuildAssetRegistry + -p:BuildAssetRegistryToken=$(MaestroAccessToken) + -p:OutputPath=$(Build.StagingDirectory)\nuget-signed\ + $(System.DefaultWorkingDirectory)\build-tools\create-packs\Microsoft.Android.Sdk.proj + -bl:$(System.DefaultWorkingDirectory)\bin\Build$(XA.Build.Configuration)\push-bar-manifest.binlog + displayName: generate and publish BAR manifest + condition: and(succeeded(), eq(variables['PushXAPackageInfoToMaestro'], 'true')) + + - powershell: | + $versionEndpoint = 'https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16' + $darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content + $arcadeServicesSource = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' + & dotnet tool update microsoft.dotnet.darc --version "$darcVersion" --add-source "$arcadeServicesSource" --tool-path $(Agent.ToolsDirectory)\darc -v n + & $(Agent.ToolsDirectory)\darc\darc add-build-to-channel --default-channels --id $(BARBuildId) --publishing-infra-version 3 --skip-assets-publishing --password $(MaestroAccessToken) --azdev-pat $(publishing-dnceng-devdiv-code-r-build-re) + displayName: add build to default darc channel + condition: and(succeeded(), eq(variables['PushXAPackageInfoToMaestro'], 'true')) + + - template: yaml-templates\upload-results.yaml@self + parameters: + xaSourcePath: $(System.DefaultWorkingDirectory) + artifactName: Prepare Release - Push Internal + includeBuildResults: true diff --git a/build-tools/automation/yaml-templates/apk-instrumentation.yaml b/build-tools/automation/yaml-templates/apk-instrumentation.yaml index 7f8b03133bf..e533f6af2ab 100644 --- a/build-tools/automation/yaml-templates/apk-instrumentation.yaml +++ b/build-tools/automation/yaml-templates/apk-instrumentation.yaml @@ -9,41 +9,24 @@ parameters: testResultsFormat: NUnit artifactSource: "" artifactFolder: "" - useDotNet: true condition: succeeded() retryCountOnTaskFailure: 1 steps: -- ${{ if eq(parameters.useDotNet, false) }}: - - task: MSBuild@1 +- template: run-dotnet-preview.yaml@self + parameters: + configuration: ${{ parameters.buildConfiguration }} + xaSourcePath: ${{ parameters.xaSourcePath }} displayName: run ${{ parameters.testName }} - inputs: - solution: ${{ parameters.project }} - configuration: ${{ parameters.configuration }} - msbuildArguments: >- - /restore - /t:RunTestApp - /bl:${{ parameters.xaSourcePath }}/bin/Test${{ parameters.configuration }}/run-${{ parameters.testName }}.binlog - ${{ parameters.extraBuildArgs }} + project: ${{ parameters.project }} + arguments: >- + -t:RunTestApp + -bl:${{ parameters.xaSourcePath }}/bin/Test${{ parameters.configuration }}/run-${{ parameters.testName }}.binlog + -v:n -c ${{ parameters.configuration }} ${{ parameters.extraBuildArgs }} condition: ${{ parameters.condition }} continueOnError: true retryCountOnTaskFailure: ${{ parameters.retryCountOnTaskFailure }} -- ${{ if eq(parameters.useDotNet, true) }}: - - template: run-dotnet-preview.yaml - parameters: - configuration: ${{ parameters.buildConfiguration }} - xaSourcePath: ${{ parameters.xaSourcePath }} - displayName: run ${{ parameters.testName }} - project: ${{ parameters.project }} - arguments: >- - -t:RunTestApp - -bl:${{ parameters.xaSourcePath }}/bin/Test${{ parameters.configuration }}/run-${{ parameters.testName }}.binlog - -v:n -c ${{ parameters.configuration }} ${{ parameters.extraBuildArgs }} - condition: ${{ parameters.condition }} - continueOnError: true - retryCountOnTaskFailure: ${{ parameters.retryCountOnTaskFailure }} - - script: > DEST="$(Build.StagingDirectory)/Test${{ parameters.configuration }}/${{ parameters.artifactFolder }}/" && mkdir -p "$DEST" && diff --git a/build-tools/automation/yaml-templates/build-linux.yaml b/build-tools/automation/yaml-templates/build-linux.yaml index ba399bdfd3b..6d9f03fc4c2 100644 --- a/build-tools/automation/yaml-templates/build-linux.yaml +++ b/build-tools/automation/yaml-templates/build-linux.yaml @@ -1,6 +1,4 @@ parameters: - buildPoolName: $(LinuxBuildPoolName) - buildPoolImage: $(LinuxBuildPoolImage) buildResultArtifactName: Build Results - Linux checkoutCommit: '' checkoutPath: 's/xamarin-android' @@ -24,8 +22,9 @@ stages: - job: ${{ parameters.jobName }} displayName: ${{ parameters.jobDisplayName }} pool: - name: ${{ parameters.buildPoolName }} - vmImage: ${{ parameters.buildPoolImage }} + name: AzurePipelines-EO + vmImage: $(LinuxPoolImage1ESPT) + os: linux timeoutInMinutes: 180 workspace: clean: all @@ -44,7 +43,7 @@ stages: # https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops#checkout-path - checkout: maui - - template: setup-ubuntu.yaml + - template: setup-ubuntu.yaml@self - ${{ if ne(variables['System.PullRequest.IsFork'], 'True') }}: - checkout: monodroid @@ -90,33 +89,10 @@ stages: artifactName: ${{ parameters.nugetArtifactName }} targetPath: $(System.DefaultWorkingDirectory)/xamarin-android/bin/Build$(XA.Build.Configuration)/nuget-linux - - powershell: | - [IO.Directory]::CreateDirectory("$(Build.StagingDirectory)/empty") - [IO.Directory]::CreateDirectory("$(Build.StagingDirectory)/sbom-components") - displayName: create SBOM directories - condition: and(succeeded(), eq(variables['MicroBuildSignType'], 'Real')) - - - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 - displayName: generate components SBOM - condition: and(succeeded(), eq(variables['MicroBuildSignType'], 'Real')) - inputs: - BuildDropPath: $(Build.StagingDirectory)/empty - BuildComponentPath: $(System.DefaultWorkingDirectory)/xamarin-android - ManifestDirPath: $(Build.StagingDirectory)/sbom-components - PackageName: .NET Android - Verbosity: Verbose - - - task: PublishBuildArtifacts@1 - displayName: publish components SBOM - condition: and(succeeded(), eq(variables['MicroBuildSignType'], 'Real')) - inputs: - artifactName: sbom-components-linux - pathToPublish: $(Build.StagingDirectory)/sbom-components - - - template: upload-results.yaml + - template: upload-results.yaml@self parameters: xaSourcePath: $(System.DefaultWorkingDirectory)/xamarin-android artifactName: ${{ parameters.buildResultArtifactName }} includeBuildResults: true - - template: fail-on-issue.yaml + - template: fail-on-issue.yaml@self diff --git a/build-tools/automation/yaml-templates/build-macos.yaml b/build-tools/automation/yaml-templates/build-macos.yaml index abdb0103a09..d974d13d44d 100644 --- a/build-tools/automation/yaml-templates/build-macos.yaml +++ b/build-tools/automation/yaml-templates/build-macos.yaml @@ -1,6 +1,4 @@ parameters: - buildPoolName: $(MacBuildPoolName) - buildPoolImage: $(MacBuildPoolImage) buildResultArtifactName: Build Results - macOS checkoutCommit: '' checkoutPath: 's/xamarin-android' @@ -28,9 +26,10 @@ stages: - job: ${{ parameters.jobName }} displayName: ${{ parameters.jobDisplayName }} pool: - name: ${{ parameters.buildPoolName }} - vmImage: ${{ parameters.buildPoolImage }} - ${{ if or(and(ne(variables['Build.DefinitionName'],'Xamarin.Android'), ne(variables['Build.DefinitionName'], 'Xamarin.Android-Private'), ne(variables['Build.DefinitionName'], 'xamarin.megapipeline')), eq(variables['Build.Reason'], 'PullRequest')) }}: + name: $(MacBuildPoolName) + vmImage: $(MacBuildPoolImage) + os: macOS + ${{ if ne(variables['MicroBuildSignType'], 'Real') }}: demands: macOS.Name -equals Monterey timeoutInMinutes: 240 cancelTimeoutInMinutes: 5 @@ -44,37 +43,14 @@ stages: path: ${{ parameters.checkoutPath }} persistCredentials: ${{ parameters.checkoutPersistCredentials }} - - template: commercial-build.yaml + - template: commercial-build.yaml@self parameters: installerArtifactName: ${{ parameters.installerArtifactName }} nugetArtifactName: ${{ parameters.nugetArtifactName }} testAssembliesArtifactName: ${{ parameters.testAssembliesArtifactName }} windowsToolchainPdbArtifactName: ${{ parameters.windowsToolchainPdbArtifactName }} - - powershell: | - [IO.Directory]::CreateDirectory("$(Build.StagingDirectory)/empty") - [IO.Directory]::CreateDirectory("$(Build.StagingDirectory)/sbom-components") - displayName: create SBOM directories - condition: and(succeeded(), eq(variables['MicroBuildSignType'], 'Real')) - - - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 - displayName: generate components SBOM - condition: and(succeeded(), eq(variables['MicroBuildSignType'], 'Real')) - inputs: - BuildDropPath: $(Build.StagingDirectory)/empty - BuildComponentPath: $(System.DefaultWorkingDirectory)/xamarin-android - ManifestDirPath: $(Build.StagingDirectory)/sbom-components - PackageName: .NET Android - Verbosity: Verbose - - - task: PublishBuildArtifacts@1 - displayName: publish components SBOM - condition: and(succeeded(), eq(variables['MicroBuildSignType'], 'Real')) - inputs: - artifactName: sbom-components-macos - pathToPublish: $(Build.StagingDirectory)/sbom-components - - - template: upload-results.yaml + - template: upload-results.yaml@self parameters: xaSourcePath: $(System.DefaultWorkingDirectory)/xamarin-android artifactName: ${{ parameters.buildResultArtifactName }} diff --git a/build-tools/automation/yaml-templates/build-windows.yaml b/build-tools/automation/yaml-templates/build-windows.yaml index a2c03bfcb79..c933b2ae39e 100644 --- a/build-tools/automation/yaml-templates/build-windows.yaml +++ b/build-tools/automation/yaml-templates/build-windows.yaml @@ -1,5 +1,4 @@ parameters: - buildPool: $(1ESWindowsPool) buildResultArtifactName: Build Results - Windows checkoutCommit: '' checkoutPath: '' @@ -23,7 +22,10 @@ stages: # Check - "Xamarin.Android (Windows > Build & Smoke Test)" - job: ${{ parameters.jobName }} displayName: ${{ parameters.jobDisplayName }} - pool: ${{ parameters.buildPool }} + pool: + name: AzurePipelines-EO + image: $(WindowsPoolImage1ESPT) + os: windows timeoutInMinutes: 360 steps: - template: sdk-unified/steps/checkout/v1.yml@yaml-templates @@ -33,15 +35,15 @@ stages: path: ${{ parameters.checkoutPath }} persistCredentials: ${{ parameters.checkoutPersistCredentials }} - - template: kill-processes.yaml + - template: kill-processes.yaml@self - - template: clean.yaml + - template: clean.yaml@self - script: | echo ##vso[task.setvariable variable=JI_JAVA_HOME]%JAVA_HOME_17_X64% displayName: set JI_JAVA_HOME to $(JAVA_HOME_17_X64) - - template: use-dot-net.yaml + - template: use-dot-net.yaml@self parameters: remove_dotnet: true @@ -52,7 +54,7 @@ stages: arguments: '-c $(XA.Build.Configuration) -t:Prepare --no-restore -p:AutoProvision=true -bl:$(System.DefaultWorkingDirectory)\bin\Build$(XA.Build.Configuration)\dotnet-build-prepare.binlog' # Build, pack .nupkgs, and extract workload packs to dotnet preview test directory - - template: run-dotnet-preview.yaml + - template: run-dotnet-preview.yaml@self parameters: project: Xamarin.Android.sln arguments: >- @@ -61,12 +63,12 @@ stages: displayName: Build Solution continueOnError: false - - template: install-global-tool.yaml + - template: install-global-tool.yaml@self parameters: toolName: apkdiff version: $(ApkDiffToolVersion) - - template: run-nunit-tests.yaml + - template: run-nunit-tests.yaml@self parameters: testRunTitle: Smoke MSBuild Tests - Windows Dotnet Build testAssembly: $(System.DefaultWorkingDirectory)\bin\Test$(XA.Build.Configuration)\$(DotNetStableTargetFramework)\Xamarin.Android.Build.Tests.dll @@ -79,9 +81,9 @@ stages: filename: dotnet-local.cmd arguments: build samples\HelloWorld\HelloWorld\HelloWorld.DotNet.csproj - - template: upload-results.yaml + - template: upload-results.yaml@self parameters: artifactName: ${{ parameters.buildResultArtifactName }} includeBuildResults: true - - template: fail-on-issue.yaml + - template: fail-on-issue.yaml@self diff --git a/build-tools/automation/yaml-templates/commercial-build.yaml b/build-tools/automation/yaml-templates/commercial-build.yaml index b2713654661..b1dbbb2f6ab 100644 --- a/build-tools/automation/yaml-templates/commercial-build.yaml +++ b/build-tools/automation/yaml-templates/commercial-build.yaml @@ -10,7 +10,7 @@ steps: - script: echo "##vso[task.setvariable variable=JI_JAVA_HOME]$HOME/android-toolchain/jdk-17" displayName: set JI_JAVA_HOME -- template: use-dot-net.yaml +- template: use-dot-net.yaml@self parameters: remove_dotnet: true @@ -72,7 +72,7 @@ steps: displayName: CodeQL 3000 Finalize condition: and(succeededOrFailed(), eq(variables['Codeql.Enabled'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/main')) -- template: install-microbuild-tooling.yaml +- template: install-microbuild-tooling.yaml@self parameters: condition: and(succeeded(), eq(variables['MicroBuildSignType'], 'Real')) @@ -121,7 +121,7 @@ steps: /p:MicroBuildOverridePluginDirectory=$(Build.StagingDirectory)/MicroBuild/Plugins /bl:${{ parameters.xaSourcePath }}/bin/Build$(XA.Build.Configuration)/sign-bu-ex.binlog -- template: remove-microbuild-tooling.yaml +- template: remove-microbuild-tooling.yaml@self parameters: condition: and(succeededOrFailed(), eq(variables['MicroBuildSignType'], 'Real')) @@ -129,13 +129,13 @@ steps: workingDirectory: ${{ parameters.xaSourcePath }} displayName: make create-installers -- task: PublishPipelineArtifact@1 +- task: 1ES.PublishPipelineArtifact@1 displayName: upload nupkgs inputs: artifactName: ${{ parameters.nugetArtifactName }} targetPath: ${{ parameters.xaSourcePath }}/bin/Build$(XA.Build.Configuration)/nuget-unsigned -- task: PublishPipelineArtifact@1 +- task: 1ES.PublishPipelineArtifact@1 displayName: upload test assemblies inputs: artifactName: ${{ parameters.testAssembliesArtifactName }} @@ -148,13 +148,13 @@ steps: workingDirectory: ${{ parameters.xaSourcePath }} displayName: zip Windows toolchain pdb files -- task: PublishPipelineArtifact@1 +- task: 1ES.PublishPipelineArtifact@1 displayName: upload Windows toolchain pdb files inputs: artifactName: ${{ parameters.windowsToolchainPdbArtifactName }} targetPath: ${{ parameters.xaSourcePath }}/bin/Build$(XA.Build.Configuration)/windows-toolchain-pdb -- task: PublishPipelineArtifact@1 +- task: 1ES.PublishPipelineArtifact@1 displayName: upload build tools inventory inputs: artifactName: AndroidBuildToolsInventory diff --git a/build-tools/automation/yaml-templates/plots-to-appinsights.yaml b/build-tools/automation/yaml-templates/plots-to-appinsights.yaml deleted file mode 100644 index b141919bc1a..00000000000 --- a/build-tools/automation/yaml-templates/plots-to-appinsights.yaml +++ /dev/null @@ -1,62 +0,0 @@ -parameters: - configuration: '' - environment: Production - buildSystem: Azure DevOps - buildRepo: $(Build.Repository.Name) - buildReason: $(Build.Reason) - buildPipelineName: $(Build.DefinitionName) - buildId: $(Build.BuildId) - buildNumber: $(Build.BuildNumber) - buildUrl: $(Build.BuildUri) - buildCommit: $(Build.SourceVersion) - plotGroup: '' - plotTitle: '' - plotPathAndFilename: '' - appInsightsTelemetryKey: $(XA.Plots.AppInsightsTelemetryKey) # Defined as a hidden variable on the Xamarin.Android CI build definition: https://devdiv.visualstudio.com/DevDiv/_apps/hub/ms.vss-ciworkflow.build-ci-hub?_a=edit-build-definition&id=11410&view=Tab_Variables - condition: succeeded() - -steps: -- powershell: | - Write-Host "Current directory" - Get-Location - - Write-Host "Input parameters:" - Write-Host " configuration ${{ parameters.configuration }}" - Write-Host " environment ${{ parameters.environment }}" - Write-Host " buildSystem ${{ parameters.buildSystem }}" - Write-Host " buildRepo ${{ parameters.buildRepo }}" - Write-Host " buildReason ${{ parameters.buildReason }}" - Write-Host " buildPipelineName ${{ parameters.buildPipelineName }}" - Write-Host " buildId ${{ parameters.buildId }}" - Write-Host " buildNumber ${{ parameters.buildNumber }}" - Write-Host " buildUrl ${{ parameters.buildUrl }}" - Write-Host " buildCommit ${{ parameters.buildCommit }}" - Write-Host " plotGroup ${{ parameters.plotGroup }}" - Write-Host " plotTitle ${{ parameters.plotTitle }}" - Write-Host " plotPathAndFilename ${{ parameters.plotPathAndFilename }}" - - $buildReason = "${{ parameters.buildReason }}" - - # https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#build-variables - $buildType = [string]::Empty - switch ($buildReason) { - 'Manual' { $buildType = 'Manual' } - 'IndividualCI' { $buildType = 'CI' } - 'PullRequest' { $buildType = 'PR' } - default { $buildType = 'Unknown' } - } - - if ($buildType -eq 'CI' -Or $buildType -eq 'Manual') { - $azureTimestampFormatUtc = 'yyyy-MM-ddTHH:mm:ss.fffffffZ' - $buildTime = [DateTime]::UtcNow.ToString($azureTimestampFormatUtc) - Write-Host $buildTime - Write-Host "Sending plot telemtry" - mono "$(System.DefaultWorkingDirectory)/build-tools/plots-to-appinsights/bin/${{ parameters.configuration }}/ProcessPlotCSVFile.exe" -d:"${buildTime}" -e:"${{ parameters.environment }}" -r:"${{ parameters.buildRepo }}" -t:"${buildType}" -p:"${{ parameters.buildPipelineName }}" -c:${{ parameters.buildCommit }} -i:${{ parameters.buildId }} -n:"${{ parameters.buildNumber }}" -u:"${{ parameters.buildUrl }}" -pg:"${{ parameters.plotGroup }}" -pt:"${{ parameters.plotTitle }}" -k:"${{ parameters.appInsightsTelemetryKey }}" "${{ parameters.plotPathAndFilename }}" - } else { - Write-Host "WARNING: Plot telmemetry not sent. Plot telemetry is only sent for continuous integration (CI) or manual builds. buildType: ${buildType}" - } - errorActionPreference: silentlyContinue - continueOnError: true - ignoreLASTEXITCODE: true - displayName: 'Plots to AppInsights: ${{ parameters.plotTitle }}' - condition: ${{ parameters.condition }} \ No newline at end of file diff --git a/build-tools/automation/yaml-templates/publish-artifact.yaml b/build-tools/automation/yaml-templates/publish-artifact.yaml index 5bfb098624e..4144c3473db 100644 --- a/build-tools/automation/yaml-templates/publish-artifact.yaml +++ b/build-tools/automation/yaml-templates/publish-artifact.yaml @@ -12,7 +12,7 @@ steps: displayName: Set upload artifact name condition: ${{ parameters.condition }} -- task: PublishPipelineArtifact@1 +- task: 1ES.PublishPipelineArtifact@1 displayName: ${{ parameters.displayName }} inputs: artifactName: ${{ parameters.artifactName }} $(UploadAttemptSuffix) diff --git a/build-tools/automation/yaml-templates/run-designer-tests.yml b/build-tools/automation/yaml-templates/run-designer-tests.yml deleted file mode 100644 index f6a63f5adc6..00000000000 --- a/build-tools/automation/yaml-templates/run-designer-tests.yml +++ /dev/null @@ -1,79 +0,0 @@ -parameters: - designerSourcePath: $(System.DefaultWorkingDirectory) - nunitConsoleVersion: '3.9.0' - runAddinTests: true - testResultArtifactName: Test Results - Designer - Windows - -steps: -- task: DeleteFiles@1 - displayName: Delete Test Outputs - inputs: - SourceFolder: ${{ parameters.designerSourcePath }}/Xamarin.Designer.Android/Xamarin.AndroidDesigner.Tests - Contents: | - CustomControlsOutput - AndroidCustomControlsClass/obj - AndroidCustomControlsBinding/obj - AndroidCustomControls/obj - AndroidCustomControlsClass/bin - AndroidCustomControlsBinding/bin - AndroidCustomControls/bin - -- task: NuGetCommand@2 - displayName: Install NUnit.Console ${{ parameters.nunitConsoleVersion }} - inputs: - command: custom - arguments: install NUnit.Console -version ${{ parameters.nunitConsoleVersion }} -OutputDirectory ${{ parameters.designerSourcePath }}/packages - -- powershell: | - $nunitConsole = [IO.Path]::Combine("${{ parameters.designerSourcePath }}", "packages", "NUnit.ConsoleRunner.${{ parameters.nunitConsoleVersion }}", "tools", "nunit3-console.exe") - if ([Environment]::OSVersion.Platform -eq "Unix") - { - mono64 "$nunitConsole" "-labels=All" "-result=TestResult_AndroidDesignerUnitTests.xml" "Xamarin.AndroidDesigner.UnitTests.dll" - } - else - { - ."$nunitConsole" "-labels=All" "-result=TestResult_AndroidDesignerUnitTests.xml" "Xamarin.AndroidDesigner.UnitTests.dll" - } - displayName: Run Unit Tests - workingDirectory: ${{ parameters.designerSourcePath }}/Xamarin.Designer.Android/Xamarin.AndroidDesigner.Tests/bin-tests/Debug - -- powershell: | - if ([Environment]::OSVersion.Platform -eq "Unix") - { - mono64 "--debug" "GuiUnit.exe" "-labels=All" "-result=TestResult_AndroidDesigner.xml" "Xamarin.AndroidDesigner.Tests.dll" - } - else - { - .\GuiUnit.exe "-labels=All" "-result=TestResult_AndroidDesigner.xml" "Xamarin.AndroidDesigner.Tests.dll" - } - displayName: Run GUI Tests - workingDirectory: ${{ parameters.designerSourcePath }}/Xamarin.Designer.Android/Xamarin.AndroidDesigner.Tests/bin/Debug - condition: false # https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1583237 - -- task: PublishTestResults@2 - displayName: Publish Core Unit Test Results - inputs: - testResultsFormat: NUnit - testResultsFiles: ${{ parameters.designerSourcePath }}/Xamarin.Designer.Android/Xamarin.AndroidDesigner.Tests/**/TestResult_*.xml - testRunTitle: Xamarin.AndroidDesigner.Tests - condition: succeededOrFailed() - -- task: CopyFiles@2 - displayName: 'Copy binlogs' - inputs: - sourceFolder: ${{ parameters.designerSourcePath }}/Xamarin.Designer.Android - contents: | - **/*.binlog - **/hs*.log - **/hs*.mdmp - targetFolder: $(Build.ArtifactStagingDirectory)/designer-binlogs - overWrite: true - flattenFolders: true - condition: ne(variables['Agent.JobStatus'], 'Succeeded') - -- template: publish-artifact.yaml - parameters: - displayName: upload designer binlogs - artifactName: ${{ parameters.testResultArtifactName }} - targetPath: $(Build.ArtifactStagingDirectory)/designer-binlogs - condition: ne(variables['Agent.JobStatus'], 'Succeeded') diff --git a/build-tools/automation/yaml-templates/run-emulator-tests.yaml b/build-tools/automation/yaml-templates/run-emulator-tests.yaml index e3484dd5c5b..9032300b894 100644 --- a/build-tools/automation/yaml-templates/run-emulator-tests.yaml +++ b/build-tools/automation/yaml-templates/run-emulator-tests.yaml @@ -25,11 +25,8 @@ jobs: echo "##vso[task.setvariable variable=JAVA_HOME]${{ parameters.jdkTestFolder }}" displayName: set JAVA_HOME to ${{ parameters.jdkTestFolder }} - - template: setup-test-environment.yaml + - template: setup-test-environment.yaml@self parameters: - installLegacyDotNet: false - restoreNUnitConsole: false - updateMono: false xaprepareScenario: EmulatorTestDependencies jdkTestFolder: ${{ parameters.jdkTestFolder }} @@ -38,14 +35,14 @@ jobs: artifactName: $(TestAssembliesArtifactName) downloadPath: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration) - - template: start-stop-emulator.yaml + - template: start-stop-emulator.yaml@self parameters: emulatorMSBuildArgs: ${{ parameters.emulatorMSBuildArgs }} - ${{ parameters.testSteps }} - - template: upload-results.yaml + - template: upload-results.yaml@self parameters: artifactName: Test Results - ${{ parameters.jobName }} With Emulator - macOS - - template: fail-on-issue.yaml + - template: fail-on-issue.yaml@self diff --git a/build-tools/automation/yaml-templates/run-installer.yaml b/build-tools/automation/yaml-templates/run-installer.yaml deleted file mode 100644 index b66b0209ada..00000000000 --- a/build-tools/automation/yaml-templates/run-installer.yaml +++ /dev/null @@ -1,40 +0,0 @@ -parameters: - provisionExtraArgs: -vv -f - -steps: -- task: DownloadPipelineArtifact@2 - inputs: - artifactName: $(InstallerArtifactName) - downloadPath: $(System.DefaultWorkingDirectory) - patterns: xamarin.android*.pkg - condition: and(succeeded(), eq(variables['agent.os'], 'Darwin')) - -- task: DownloadPipelineArtifact@2 - inputs: - artifactName: $(InstallerArtifactName) - downloadPath: $(System.DefaultWorkingDirectory) - patterns: Xamarin.Android*.vsix - condition: and(succeeded(), eq(variables['agent.os'], 'Windows_NT')) - -- powershell: | - $itemPattern = "*.vsix" - if ([Environment]::OSVersion.Platform -eq "Unix") { - $itemPattern = "*.pkg" - } - $searchDir = [System.IO.Path]::Combine("$(System.DefaultWorkingDirectory)", "*") - $installer = Get-ChildItem -Path "$searchDir" -Include "$itemPattern" -File - if (![System.IO.File]::Exists($installer)) { - throw [System.IO.FileNotFoundException] "Installer not found in $artifactDirectory." - } - Write-Host "##vso[task.setvariable variable=XA.Provisionator.Args]$installer" - displayName: find installer and set provisionator variable - condition: and(succeeded(), ne(variables['agent.os'], 'Linux')) - -- task: provisionator@2 - inputs: - provisionator_uri: $(provisionator-uri) - github_token: $(GitHub.Token) - provisioning_script: $(XA.Provisionator.Args) - provisioning_extra_args: ${{ parameters.provisionExtraArgs }} - # Disabled on Windows on .NET release branches - condition: and(succeeded(), ne(variables['System.PullRequest.IsFork'], 'True'), ne(variables['agent.os'], 'Linux'), or(eq(variables.IsRelOrTargetingRel, 'False'), eq(variables['agent.os'], 'Darwin'))) diff --git a/build-tools/automation/yaml-templates/run-msbuild-tests.yaml b/build-tools/automation/yaml-templates/run-msbuild-tests.yaml index 6d5193a5f87..55300a0ccd1 100644 --- a/build-tools/automation/yaml-templates/run-msbuild-tests.yaml +++ b/build-tools/automation/yaml-templates/run-msbuild-tests.yaml @@ -25,17 +25,14 @@ jobs: - ${{ if eq(parameters.testOS, 'Windows') }}: - script: netsh int ipv4 set global sourceroutingbehavior=drop - - template: kill-processes.yaml + - template: kill-processes.yaml@self - - template: clean.yaml + - template: clean.yaml@self - - template: setup-test-environment.yaml + - template: setup-test-environment.yaml@self parameters: installTestSlicer: true - installLegacyDotNet: false installLegacyXamarinAndroid: true - restoreNUnitConsole: false - updateMono: false xaSourcePath: ${{ parameters.xaSourcePath }} repositoryAlias: ${{ parameters.repositoryAlias }} commit: ${{ parameters.commit }} @@ -45,7 +42,7 @@ jobs: artifactName: $(TestAssembliesArtifactName) downloadPath: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration) - - template: run-sliced-nunit-tests.yaml + - template: run-sliced-nunit-tests.yaml@self parameters: testAssembly: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll testFilter: ${{ parameters.testFilter }} @@ -53,11 +50,11 @@ jobs: retryFailedTests: false xaSourcePath: ${{ parameters.xaSourcePath }} - - template: upload-results.yaml + - template: upload-results.yaml@self parameters: artifactName: Test Results - MSBuild - ${{ parameters.testOS }}-$(System.JobPositionInPhase) xaSourcePath: ${{ parameters.xaSourcePath }} - - template: fail-on-issue.yaml + - template: fail-on-issue.yaml@self parameters: condition: ${{ parameters.shouldFailOnIssue }} diff --git a/build-tools/automation/yaml-templates/run-nunit-tests.yaml b/build-tools/automation/yaml-templates/run-nunit-tests.yaml index 95d49d08506..d3c89c454e4 100644 --- a/build-tools/automation/yaml-templates/run-nunit-tests.yaml +++ b/build-tools/automation/yaml-templates/run-nunit-tests.yaml @@ -1,67 +1,29 @@ parameters: - configuration: $(XA.Build.Configuration) - xaSourcePath: $(System.DefaultWorkingDirectory) testRunTitle: Xamarin Android Tests testAssembly: '' testResultsFile: TestResult.xml - nunitConsoleExtraArgs: '' dotNetTestExtraArgs: '' - useDotNet: true - useDotNetPreview: false workers: $(NUnit.NumberOfTestWorkers) condition: succeeded() timeoutInMinutes: 0 retryCountOnTaskFailure: 0 steps: -- ${{ if and(eq(parameters.useDotNet, false), eq(parameters.useDotNetPreview, false)) }}: - - powershell: | - Write-Host '##vso[task.setvariable variable=TestResultsFormat]NUnit' - if ([Environment]::OSVersion.Platform -eq "Unix") { - & ${{ parameters.xaSourcePath }}/build-tools/scripts/nunit3-console ${{ parameters.testAssembly }} --result ${{ parameters.testResultsFile }} --workers=${{ parameters.workers }} ${{ parameters.nunitConsoleExtraArgs }} - } else { - & cmd /c '${{ parameters.xaSourcePath }}\build-tools\scripts\nunit3-console.cmd' ${{ parameters.testAssembly }} --result ${{ parameters.testResultsFile }} --workers=${{ parameters.workers }} ${{ parameters.nunitConsoleExtraArgs }} - } - if ($LASTEXITCODE -ne 0) { - Write-Host "##vso[task.logissue type=error]Test suite had $LASTEXITCODE failure(s)." - Write-Host "##vso[task.complete result=Failed;]" - exit 0 - } - displayName: run ${{ parameters.testRunTitle }} - condition: ${{ parameters.condition }} - continueOnError: true - -- ${{ if and(eq(parameters.useDotNet, true), eq(parameters.useDotNetPreview, true)) }}: - - powershell: Write-Host '##vso[task.setvariable variable=TestResultsFormat]VSTest' - - template: run-dotnet-preview.yaml - parameters: - configuration: ${{ parameters.configuration }} - xaSourcePath: ${{ parameters.xaSourcePath }} - command: test - project: ${{ parameters.testAssembly }} - useExitCodeForErrors: true - arguments: >- - --results-directory . --logger "trx;LogFileName=${{ parameters.testResultsFile }}" - ${{ parameters.dotNetTestExtraArgs }} -- NUnit.NumberOfTestWorkers=${{ parameters.workers }} - displayName: run ${{ parameters.testRunTitle }} - condition: ${{ parameters.condition }} - -- ${{ if and(eq(parameters.useDotNet, true), eq(parameters.useDotNetPreview, false)) }}: - - task: DotNetCoreCLI@2 - inputs: - command: test - projects: ${{ parameters.testAssembly }} - arguments: >- - ${{ parameters.dotNetTestExtraArgs }} -- NUnit.NumberOfTestWorkers=${{ parameters.workers }} - publishTestResults: true - testRunTitle: ${{ parameters.testRunTitle }} - displayName: run ${{ parameters.testRunTitle }} - condition: ${{ parameters.condition }} - continueOnError: true - timeoutInMinutes: ${{ parameters.timeoutInMinutes }} - retryCountOnTaskFailure: ${{ parameters.retryCountOnTaskFailure }} +- task: DotNetCoreCLI@2 + inputs: + command: test + projects: ${{ parameters.testAssembly }} + arguments: >- + ${{ parameters.dotNetTestExtraArgs }} -- NUnit.NumberOfTestWorkers=${{ parameters.workers }} + publishTestResults: true + testRunTitle: ${{ parameters.testRunTitle }} + displayName: run ${{ parameters.testRunTitle }} + condition: ${{ parameters.condition }} + continueOnError: true + timeoutInMinutes: ${{ parameters.timeoutInMinutes }} + retryCountOnTaskFailure: ${{ parameters.retryCountOnTaskFailure }} -- template: kill-processes.yaml +- template: kill-processes.yaml@self - task: PublishTestResults@2 inputs: diff --git a/build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml b/build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml index 5e44373d5dd..c725875ce93 100644 --- a/build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml +++ b/build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml @@ -28,7 +28,7 @@ steps: - ${{ if eq(parameters.retryFailedTests, 'false') }}: # If we aren't using auto-retry logic, then this is just a simple template call - - template: run-nunit-tests.yaml + - template: run-nunit-tests.yaml@self parameters: testRunTitle: ${{ parameters.testRunTitle }}-$(System.JobPositionInPhase) testAssembly: ${{ parameters.testAssembly }} @@ -70,7 +70,7 @@ steps: custom: build-server arguments: shutdown - - template: run-nunit-tests.yaml + - template: run-nunit-tests.yaml@self parameters: testRunTitle: ${{ parameters.testRunTitle }}-$(System.JobPositionInPhase) (Auto-Retry) testAssembly: ${{ parameters.testAssembly }} diff --git a/build-tools/automation/yaml-templates/run-xaprepare.yaml b/build-tools/automation/yaml-templates/run-xaprepare.yaml index 1136cbec6e1..209aab8219d 100644 --- a/build-tools/automation/yaml-templates/run-xaprepare.yaml +++ b/build-tools/automation/yaml-templates/run-xaprepare.yaml @@ -3,7 +3,6 @@ parameters: name: configuration: $(XA.Build.Configuration) xaSourcePath: $(System.DefaultWorkingDirectory) - framework: $(DotNetStableTargetFramework) condition: succeeded() arguments: @@ -15,4 +14,4 @@ steps: inputs: command: run projects: ${{ parameters.xaSourcePath }}/build-tools/xaprepare/xaprepare/xaprepare.csproj - arguments: -f ${{ parameters.framework }} -c ${{ parameters.configuration }} -- ${{ parameters.arguments }} --no-emoji --run-mode=CI + arguments: -f $(DotNetStableTargetFramework) -c ${{ parameters.configuration }} -- ${{ parameters.arguments }} --no-emoji --run-mode=CI diff --git a/build-tools/automation/yaml-templates/setup-test-environment.yaml b/build-tools/automation/yaml-templates/setup-test-environment.yaml index bcd91d29145..9628b164e63 100644 --- a/build-tools/automation/yaml-templates/setup-test-environment.yaml +++ b/build-tools/automation/yaml-templates/setup-test-environment.yaml @@ -5,17 +5,15 @@ parameters: remove_dotnet: false installTestSlicer: false installApkDiff: true - installLegacyDotNet: true + installLegacyDotNet: false installLegacyXamarinAndroid: false - restoreNUnitConsole: true - updateMono: true + updateMono: false androidSdkPlatforms: $(DefaultTestSdkPlatforms) repositoryAlias: 'self' commit: '' xaprepareScenario: AndroidTestDependencies # Use 'EmulatorTestDependencies' for agents that need the emulator installed steps: - - template: sdk-unified/steps/checkout/v1.yml@yaml-templates parameters: resource: ${{ parameters.repositoryAlias }} @@ -37,14 +35,14 @@ steps: # Install .NET 6 for legacy tests - ${{ if eq(parameters.installLegacyDotNet, true) }}: - - template: use-dot-net.yaml + - template: use-dot-net.yaml@self parameters: version: 6.0 quality: GA remove_dotnet: ${{ parameters.remove_dotnet }} # Install latest .NET -- template: use-dot-net.yaml +- template: use-dot-net.yaml@self - task: DotNetCoreCLI@2 displayName: shut down existing build daemons @@ -54,7 +52,7 @@ steps: arguments: shutdown - ${{ if eq(parameters.updateMono, true) }}: - - template: run-xaprepare.yaml + - template: run-xaprepare.yaml@self parameters: displayName: run xaprepare-UpdateMono arguments: --s=UpdateMono --auto-provision=yes --auto-provision-uses-sudo=yes @@ -62,7 +60,7 @@ steps: xaSourcePath: ${{ parameters.xaSourcePath }} - ${{ if eq(parameters.installLegacyXamarinAndroid, true) }}: - - template: install-global-tool.yaml + - template: install-global-tool.yaml@self parameters: toolName: boots version: $(BootsToolVersion) @@ -70,21 +68,11 @@ steps: - powershell: boots --stable Xamarin.Android displayName: install Xamarin.Android stable -- template: run-xaprepare.yaml +- template: run-xaprepare.yaml@self parameters: arguments: --s=${{ parameters.xaprepareScenario }} --android-sdk-platforms="${{ parameters.androidSdkPlatforms }}" xaSourcePath: ${{ parameters.xaSourcePath }} -- ${{ if eq(parameters.restoreNUnitConsole, true) }}: - - task: DotNetCoreCLI@2 - displayName: restore NUnit.Console - inputs: - command: restore - projects: ${{ parameters.xaSourcePath }}/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Xamarin.ProjectTools.csproj - restoreArguments: -bl:${{ parameters.xaSourcePath }}/bin/Test${{ parameters.configuration }}/restore-Xamarin.ProjectTools.binlog - nugetConfigPath: ${{ parameters.xaSourcePath }}/NuGet.config - feedsToUse: config - - task: DotNetCoreCLI@2 displayName: build Xamarin.Android.Tools.BootstrapTasks.csproj inputs: @@ -110,13 +98,13 @@ steps: arguments: -t:ExtractWorkloadPacks -c ${{ parameters.configuration }} -v:n -bl:${{ parameters.xaSourcePath }}/bin/Test${{ parameters.configuration }}/extract-workloads.binlog - ${{ if eq(parameters.installApkDiff, true) }}: - - template: install-global-tool.yaml + - template: install-global-tool.yaml@self parameters: toolName: apkdiff version: $(ApkDiffToolVersion) - ${{ if eq(parameters.installTestSlicer, true) }}: - - template: install-global-tool.yaml + - template: install-global-tool.yaml@self parameters: toolName: dotnet-test-slicer version: $(TestSlicerToolVersion) diff --git a/build-tools/automation/yaml-templates/setup-ubuntu.yaml b/build-tools/automation/yaml-templates/setup-ubuntu.yaml index 4dd8d7062b5..cc41cdb2a49 100644 --- a/build-tools/automation/yaml-templates/setup-ubuntu.yaml +++ b/build-tools/automation/yaml-templates/setup-ubuntu.yaml @@ -1,23 +1,23 @@ steps: +- script: echo skip +#- script: sudo rm /etc/apt/sources.list.d/treasure-data.list || true +# displayName: remove invalid treasure-data source -- script: sudo rm /etc/apt/sources.list.d/treasure-data.list || true - displayName: remove invalid treasure-data source +#- script: echo "##vso[task.setvariable variable=XDG_CONFIG_HOME]$HOME/.config" +# displayName: update XDG_CONFIG_HOME -- script: echo "##vso[task.setvariable variable=XDG_CONFIG_HOME]$HOME/.config" - displayName: update XDG_CONFIG_HOME +#- script: > +# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && +# echo "deb https://download.mono-project.com/repo/ubuntu preview-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-preview.list && +# sudo apt update && +# sudo apt install -y --no-install-recommends mono-complete nuget msbuild +# displayName: install mono preview -- script: > - sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && - echo "deb https://download.mono-project.com/repo/ubuntu preview-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-preview.list && - sudo apt update && - sudo apt install -y --no-install-recommends mono-complete nuget msbuild - displayName: install mono preview +#- template: use-dot-net.yaml@self +# parameters: +# remove_dotnet: true -- template: use-dot-net.yaml - parameters: - remove_dotnet: true - -- task: NuGetToolInstaller@1 - displayName: Use NuGet 5.x - inputs: - versionSpec: 5.x +#- task: NuGetToolInstaller@1 +# displayName: Use NuGet 5.x +# inputs: +# versionSpec: 5.x diff --git a/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml b/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml index 4ad16662861..216bf28b972 100644 --- a/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml +++ b/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml @@ -31,13 +31,11 @@ stages: workspace: clean: all steps: - - template: setup-test-environment.yaml + - template: setup-test-environment.yaml@self parameters: installTestSlicer: true installApkDiff: false - installLegacyDotNet: false installLegacyXamarinAndroid: true - restoreNUnitConsole: false updateMono: true xaSourcePath: ${{ parameters.xaSourcePath }} repositoryAlias: ${{ parameters.repositoryAlias }} @@ -49,29 +47,29 @@ stages: artifactName: $(TestAssembliesArtifactName) downloadPath: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration) - - template: start-stop-emulator.yaml + - template: start-stop-emulator.yaml@self parameters: xaSourcePath: ${{ parameters.xaSourcePath }} startContinueOnError: ${{ parameters.emulatorStartContinueOnError }} - - template: run-sliced-nunit-tests.yaml + - template: run-sliced-nunit-tests.yaml@self parameters: testAssembly: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration)/MSBuildDeviceIntegration/$(DotNetStableTargetFramework)/MSBuildDeviceIntegration.dll testFilter: $(ExcludedNightlyNUnitCategories) testRunTitle: MSBuildDeviceIntegration On Device - macOS - ${{ if ne(parameters.usesCleanImages, true) }}: - - template: start-stop-emulator.yaml + - template: start-stop-emulator.yaml@self parameters: command: stop xaSourcePath: ${{ parameters.xaSourcePath }} - - template: upload-results.yaml + - template: upload-results.yaml@self parameters: artifactName: Test Results - MSBuild With Emulator - macOS-$(System.JobPositionInPhase) xaSourcePath: ${{ parameters.xaSourcePath }} - - template: fail-on-issue.yaml + - template: fail-on-issue.yaml@self parameters: condition: ${{ parameters.shouldFailOnIssue }} @@ -92,13 +90,10 @@ stages: workspace: clean: all steps: - - template: setup-test-environment.yaml + - template: setup-test-environment.yaml@self parameters: installTestSlicer: true installApkDiff: false - installLegacyDotNet: false - restoreNUnitConsole: false - updateMono: false xaSourcePath: ${{ parameters.xaSourcePath }} repositoryAlias: ${{ parameters.repositoryAlias }} commit: ${{ parameters.commit }} @@ -109,7 +104,7 @@ stages: artifactName: $(TestAssembliesArtifactName) downloadPath: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration) - - template: start-stop-emulator.yaml + - template: start-stop-emulator.yaml@self parameters: specificImage: true deviceName: $(deviceName) @@ -119,7 +114,7 @@ stages: xaSourcePath: ${{ parameters.xaSourcePath }} startContinueOnError: ${{ parameters.emulatorStartContinueOnError }} - - template: run-sliced-nunit-tests.yaml + - template: run-sliced-nunit-tests.yaml@self parameters: testRunTitle: WearOS On Device - macOS testAssembly: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration)/MSBuildDeviceIntegration/$(DotNetStableTargetFramework)/MSBuildDeviceIntegration.dll @@ -127,7 +122,7 @@ stages: xaSourcePath: ${{ parameters.xaSourcePath }} - ${{ if ne(parameters.usesCleanImages, true) }}: - - template: start-stop-emulator.yaml + - template: start-stop-emulator.yaml@self parameters: command: stop specificImage: true @@ -137,12 +132,12 @@ stages: avdType: $(avdType) xaSourcePath: ${{ parameters.xaSourcePath }} - - template: upload-results.yaml + - template: upload-results.yaml@self parameters: configuration: $(XA.Build.Configuration) artifactName: Test Results - Emulator $(avdApiLevel)-$(avdAbi)-$(avdType) - macOS xaSourcePath: ${{ parameters.xaSourcePath }} - - template: fail-on-issue.yaml + - template: fail-on-issue.yaml@self parameters: condition: ${{ parameters.shouldFailOnIssue }} diff --git a/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml b/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml index 9b4745c543c..b68c63d84dc 100644 --- a/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml +++ b/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml @@ -16,7 +16,7 @@ stages: dependsOn: ${{ parameters.dependsOn }} condition: ${{ parameters.stageCondition }} jobs: - - template: run-msbuild-tests.yaml + - template: run-msbuild-tests.yaml@self parameters: testOS: macOS jobName: mac_msbuild_tests @@ -27,7 +27,7 @@ stages: commit: ${{ parameters.commit }} shouldFailOnIssue: ${{ parameters.shouldFailOnIssue }} - - template: run-msbuild-tests.yaml + - template: run-msbuild-tests.yaml@self parameters: testOS: Windows jobName: win_msbuild_tests diff --git a/build-tools/automation/yaml-templates/upload-results.yaml b/build-tools/automation/yaml-templates/upload-results.yaml index ed782a58d4d..9749dd185d7 100644 --- a/build-tools/automation/yaml-templates/upload-results.yaml +++ b/build-tools/automation/yaml-templates/upload-results.yaml @@ -6,7 +6,7 @@ parameters: condition: or(ne(variables['Agent.JobStatus'], 'Succeeded'), eq(variables['XA.PublishAllLogs'], 'true')) steps: -- template: run-xaprepare.yaml +- template: run-xaprepare.yaml@self parameters: configuration: ${{ parameters.configuration }} arguments: --s=CopyExtraResultFilesForCI --verbosity v @@ -15,7 +15,7 @@ steps: condition: ${{ parameters.condition }} - ${{ if eq(parameters.includeBuildResults, false) }}: - - template: publish-artifact.yaml + - template: publish-artifact.yaml@self parameters: displayName: upload test results artifactName: ${{ parameters.artifactName }} @@ -30,7 +30,7 @@ steps: targetFolder: $(Build.StagingDirectory)/Test${{ parameters.configuration }}/Build${{ parameters.configuration }} condition: ${{ parameters.condition }} - - template: publish-artifact.yaml + - template: publish-artifact.yaml@self parameters: displayName: upload build and test results artifactName: ${{ parameters.artifactName }} diff --git a/build-tools/automation/yaml-templates/use-dot-net.yaml b/build-tools/automation/yaml-templates/use-dot-net.yaml index 41fdfad874a..7480ddc8176 100644 --- a/build-tools/automation/yaml-templates/use-dot-net.yaml +++ b/build-tools/automation/yaml-templates/use-dot-net.yaml @@ -8,7 +8,6 @@ parameters: retryCountOnTaskFailure: 3 steps: - - pwsh: | $ErrorActionPreference = 'Stop' $ProgressPreference = 'SilentlyContinue' diff --git a/build-tools/automation/yaml-templates/variables.yaml b/build-tools/automation/yaml-templates/variables.yaml index 07b09b01c8a..523f53d7747 100644 --- a/build-tools/automation/yaml-templates/variables.yaml +++ b/build-tools/automation/yaml-templates/variables.yaml @@ -35,6 +35,10 @@ variables: value: windows-2022 - name: 1ESWindowsPool value: android-win-2022 +- name: WindowsPoolImage1ESPT + value: 1ESPT-Windows2022 +- name: LinuxPoolImage1ESPT + value: 1ESPT-Ubuntu22.04 - name: VSEngMicroBuildPool value: VSEngSS-MicroBuild2022-1ES - name: TeamName From 2de0a12315b93718e4ac2e9f6c72dfb5d7f00fa6 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Wed, 21 Feb 2024 11:22:22 -0800 Subject: [PATCH 02/36] Try to fix variable import --- build-tools/automation/azure-pipelines.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index afb97df628f..138dc410513 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -48,7 +48,7 @@ parameters: # Global variables variables: -- template: yaml-templates/variables.yaml +- template: yaml-templates/variables.yaml@self - template: templates/common/vs-release-vars.yml@sdk-insertions - ${{ if eq(variables['Build.DefinitionName'], 'Xamarin.Android-Private') }}: - group: AzureDevOps-Artifact-Feeds-Pats @@ -75,7 +75,6 @@ variables: - name: DisablePipelineConfigDetector value: true - extends: ${{ if eq(variables['MicroBuildSignType'], 'Real') }}: template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines From b9eff078166d283411fdf3b24ab08a9e8afb1503 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Wed, 21 Feb 2024 11:41:27 -0800 Subject: [PATCH 03/36] Use rooted template paths --- build-tools/automation/azure-pipelines.yaml | 76 +++++++++---------- .../yaml-templates/apk-instrumentation.yaml | 2 +- .../yaml-templates/build-linux.yaml | 6 +- .../yaml-templates/build-macos.yaml | 4 +- .../yaml-templates/build-windows.yaml | 16 ++-- .../yaml-templates/commercial-build.yaml | 6 +- .../yaml-templates/run-emulator-tests.yaml | 8 +- .../yaml-templates/run-msbuild-tests.yaml | 12 +-- .../yaml-templates/run-nunit-tests.yaml | 2 +- .../run-sliced-nunit-tests.yaml | 4 +- .../setup-test-environment.yaml | 14 ++-- .../yaml-templates/setup-ubuntu.yaml | 2 +- .../stage-msbuild-emulator-tests.yaml | 22 +++--- .../yaml-templates/stage-msbuild-tests.yaml | 4 +- .../yaml-templates/upload-results.yaml | 6 +- 15 files changed, 92 insertions(+), 92 deletions(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 138dc410513..61170d8e64a 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -48,7 +48,7 @@ parameters: # Global variables variables: -- template: yaml-templates/variables.yaml@self +- template: build-tools/automation/yaml-templates/variables.yaml@self - template: templates/common/vs-release-vars.yml@sdk-insertions - ${{ if eq(variables['Build.DefinitionName'], 'Xamarin.Android-Private') }}: - group: AzureDevOps-Artifact-Feeds-Pats @@ -94,12 +94,12 @@ extends: os: windows # Stage and Job "display names" are shortened because they are combined to form the name of the corresponding GitHub check. stages: - - template: yaml-templates/build-macos.yaml@self + - template: build-tools/automation/yaml-templates/build-macos.yaml@self - - template: yaml-templates/build-windows.yaml@self + - template: build-tools/automation/yaml-templates/build-windows.yaml@self # Check - "Xamarin.Android (Linux > Build)" - - template: yaml-templates/build-linux.yaml@self + - template: build-tools/automation/yaml-templates/build-linux.yaml@self - stage: smoke_tests displayName: Package Tests @@ -114,7 +114,7 @@ extends: workspace: clean: all steps: - - template: yaml-templates/setup-test-environment.yaml@self + - template: build-tools/automation/yaml-templates/setup-test-environment.yaml@self parameters: xaprepareScenario: EmulatorTestDependencies @@ -130,7 +130,7 @@ extends: projects: $(System.DefaultWorkingDirectory)/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj arguments: -c Debug -bl:$(System.DefaultWorkingDirectory)/bin/TestDebug/BootstrapTasks.binlog - - template: yaml-templates/run-dotnet-preview.yaml@self + - template: build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self parameters: project: Xamarin.Android.sln arguments: >- @@ -139,16 +139,16 @@ extends: displayName: prepare java.interop Debug continueOnError: false - - template: yaml-templates/run-dotnet-preview.yaml@self + - template: build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self parameters: project: Xamarin.Android.sln arguments: -t:PrepareJavaInterop -c $(XA.Build.Configuration) --no-restore displayName: prepare java.interop $(XA.Build.Configuration) continueOnError: false - - template: yaml-templates/start-stop-emulator.yaml@self + - template: build-tools/automation/yaml-templates/start-stop-emulator.yaml@self - - template: yaml-templates/apk-instrumentation.yaml@self + - template: build-tools/automation/yaml-templates/apk-instrumentation.yaml@self parameters: configuration: $(XA.Build.Configuration) testName: Mono.Android.NET_Tests-$(XA.Build.Configuration) @@ -157,7 +157,7 @@ extends: artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab artifactFolder: $(DotNetTargetFramework)-$(XA.Build.Configuration) - - template: yaml-templates/apk-instrumentation.yaml@self + - template: build-tools/automation/yaml-templates/apk-instrumentation.yaml@self parameters: buildConfiguration: $(XA.Build.Configuration) configuration: Debug @@ -167,7 +167,7 @@ extends: artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.apk artifactFolder: $(DotNetTargetFramework)-Debug - - template: yaml-templates/apk-instrumentation.yaml@self + - template: build-tools/automation/yaml-templates/apk-instrumentation.yaml@self parameters: configuration: $(XA.Build.Configuration) testName: Mono.Android.NET_Tests-NoAab @@ -177,7 +177,7 @@ extends: artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.apk artifactFolder: $(DotNetTargetFramework)-NoAab - - template: yaml-templates/apk-instrumentation.yaml@self + - template: build-tools/automation/yaml-templates/apk-instrumentation.yaml@self parameters: configuration: $(XA.Build.Configuration) testName: Mono.Android.NET_Tests-Interpreter @@ -187,7 +187,7 @@ extends: artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab artifactFolder: $(DotNetTargetFramework)-Interpreter - - template: yaml-templates/apk-instrumentation.yaml@self + - template: build-tools/automation/yaml-templates/apk-instrumentation.yaml@self parameters: configuration: $(XA.Build.Configuration) testName: Mono.Android.NET_Tests-NoAot @@ -197,7 +197,7 @@ extends: artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab artifactFolder: $(DotNetTargetFramework)-NoAot - - template: yaml-templates/apk-instrumentation.yaml@self + - template: build-tools/automation/yaml-templates/apk-instrumentation.yaml@self parameters: configuration: $(XA.Build.Configuration) testName: Mono.Android.NET_Tests-AotLlvm @@ -207,7 +207,7 @@ extends: artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab artifactFolder: $(DotNetTargetFramework)-AotLlvm - - template: yaml-templates/apk-instrumentation.yaml@self + - template: build-tools/automation/yaml-templates/apk-instrumentation.yaml@self parameters: configuration: $(XA.Build.Configuration) testName: Xamarin.Android.JcwGen_Tests @@ -216,7 +216,7 @@ extends: artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Xamarin.Android.JcwGen_Tests-Signed.apk artifactFolder: $(DotNetTargetFramework)-Default - - template: yaml-templates/apk-instrumentation.yaml@self + - template: build-tools/automation/yaml-templates/apk-instrumentation.yaml@self parameters: configuration: $(XA.Build.Configuration) testName: Xamarin.Android.JcwGen_Tests_FastDev @@ -226,7 +226,7 @@ extends: artifactFolder: $(DotNetTargetFramework)-FastDev_Assemblies_Dexes extraBuildArgs: /p:AndroidFastDeploymentType=Assemblies:Dexes - - template: yaml-templates/run-nunit-tests.yaml@self + - template: build-tools/automation/yaml-templates/run-nunit-tests.yaml@self parameters: testRunTitle: Xamarin.Android.Tools.Aidl-Tests - macOS testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Tools.Aidl-Tests.dll @@ -239,20 +239,20 @@ extends: args: build samples/HelloWorld/HelloWorld/HelloWorld.DotNet.csproj - ${{ if ne(parameters.macTestAgentsUseCleanImages, true) }}: - - template: yaml-templates/start-stop-emulator.yaml@self + - template: build-tools/automation/yaml-templates/start-stop-emulator.yaml@self parameters: command: stop - - template: yaml-templates/upload-results.yaml@self + - template: build-tools/automation/yaml-templates/upload-results.yaml@self parameters: artifactName: Test Results - APKs .NET $(XA.Build.Configuration) - macOS - - template: yaml-templates/upload-results.yaml@self + - template: build-tools/automation/yaml-templates/upload-results.yaml@self parameters: artifactName: Test Results - APKs .NET Debug - macOS configuration: Debug - - template: yaml-templates/fail-on-issue.yaml@self + - template: build-tools/automation/yaml-templates/fail-on-issue.yaml@self - stage: linux_tests displayName: Linux Tests @@ -269,37 +269,37 @@ extends: workspace: clean: all steps: - - template: yaml-templates/setup-ubuntu.yaml@self + - template: build-tools/automation/yaml-templates/setup-ubuntu.yaml@self - - template: yaml-templates/setup-test-environment.yaml@self + - template: build-tools/automation/yaml-templates/setup-test-environment.yaml@self - task: DownloadPipelineArtifact@2 inputs: artifactName: $(TestAssembliesArtifactName) downloadPath: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration) - - template: yaml-templates/run-nunit-tests.yaml@self + - template: build-tools/automation/yaml-templates/run-nunit-tests.yaml@self parameters: testRunTitle: Xamarin.Android.Build.Tests - Linux BuildTest testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll dotNetTestExtraArgs: --filter "Name = BuildTest" testResultsFile: TestResult-BuildTest-Linux-$(XA.Build.Configuration).xml - - template: yaml-templates/run-nunit-tests.yaml@self + - template: build-tools/automation/yaml-templates/run-nunit-tests.yaml@self parameters: testRunTitle: Xamarin.Android.Build.Tests - Linux PackagingTest testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll dotNetTestExtraArgs: --filter "Name = PackagingTest" testResultsFile: TestResult-PackagingTest-Linux-$(XA.Build.Configuration).xml - - template: yaml-templates/run-nunit-tests.yaml@self + - template: build-tools/automation/yaml-templates/run-nunit-tests.yaml@self parameters: testRunTitle: Xamarin.Android.Build.Tests - Linux XASdkTests testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll dotNetTestExtraArgs: --filter "Name = XASdkTests & Name != XamarinLegacySdk" testResultsFile: TestResult-XASdkTests-Linux-$(XA.Build.Configuration).xml - - template: yaml-templates/run-nunit-tests.yaml@self + - template: build-tools/automation/yaml-templates/run-nunit-tests.yaml@self parameters: testRunTitle: Xamarin.Android.Build.Tests - Linux AndroidDependenciesTests testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll @@ -312,16 +312,16 @@ extends: scriptPath: dotnet-local.sh args: build samples/HelloWorld/HelloWorld/HelloWorld.DotNet.csproj - - template: yaml-templates/upload-results.yaml@self + - template: build-tools/automation/yaml-templates/upload-results.yaml@self parameters: configuration: $(XA.Build.Configuration) artifactName: Test Results - MSBuild - Linux - - template: yaml-templates/fail-on-issue.yaml@self + - template: build-tools/automation/yaml-templates/fail-on-issue.yaml@self - - template: yaml-templates/stage-msbuild-tests.yaml@self + - template: build-tools/automation/yaml-templates/stage-msbuild-tests.yaml@self - - template: yaml-templates/stage-msbuild-emulator-tests.yaml@self + - template: build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml@self parameters: usesCleanImages: ${{ parameters.macTestAgentsUseCleanImages }} @@ -346,7 +346,7 @@ extends: path: s/maui persistCredentials: true - - template: yaml-templates/setup-test-environment.yaml@self + - template: build-tools/automation/yaml-templates/setup-test-environment.yaml@self parameters: xaSourcePath: $(Build.SourcesDirectory)/xamarin-android androidSdkPlatforms: $(DefaultTestSdkPlatforms) @@ -405,7 +405,7 @@ extends: projects: $(Build.SourcesDirectory)/xamarin-android/Xamarin.Android.sln arguments: -t:InstallMaui -p:MauiUseLocalPacks=true -p:MauiWorkloadToInstall=maui -c $(XA.Build.Configuration) --no-restore -v:n -bl:$(Build.StagingDirectory)/logs/install-maui.binlog - - template: yaml-templates/run-dotnet-preview.yaml@self + - template: build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self parameters: command: new arguments: maui -o $(Build.StagingDirectory)/MauiTestProj @@ -421,7 +421,7 @@ extends: $xml.Save($project) displayName: set TargetFrameworks to Android-only - - template: yaml-templates/run-dotnet-preview.yaml@self + - template: build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self parameters: project: $(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj arguments: >- @@ -431,7 +431,7 @@ extends: xaSourcePath: $(Build.SourcesDirectory)/xamarin-android displayName: Build MAUI template - Debug - - template: yaml-templates/run-dotnet-preview.yaml@self + - template: build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self parameters: project: $(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj arguments: >- @@ -450,14 +450,14 @@ extends: TargetFolder: $(Build.StagingDirectory)/logs flattenFolders: true - - template: yaml-templates/publish-artifact.yaml@self + - template: build-tools/automation/yaml-templates/publish-artifact.yaml@self parameters: displayName: upload build and test results artifactName: Test Results - MAUI Integration targetPath: $(Build.StagingDirectory)/logs condition: or(ne(variables['Agent.JobStatus'], 'Succeeded'), eq(variables['XA.PublishAllLogs'], 'true')) - - template: yaml-templates/fail-on-issue.yaml@self + - template: build-tools/automation/yaml-templates/fail-on-issue.yaml@self - stage: dotnet_prepare_release @@ -619,7 +619,7 @@ extends: displayName: add build to default darc channel condition: and(succeeded(), eq(variables['PushXAPackageInfoToMaestro'], 'true')) - - template: yaml-templates\upload-results.yaml@self + - template: build-tools\automation\yaml-templates\upload-results.yaml@self parameters: xaSourcePath: $(System.DefaultWorkingDirectory) artifactName: Prepare Release - Push Internal diff --git a/build-tools/automation/yaml-templates/apk-instrumentation.yaml b/build-tools/automation/yaml-templates/apk-instrumentation.yaml index e533f6af2ab..acff28b13ef 100644 --- a/build-tools/automation/yaml-templates/apk-instrumentation.yaml +++ b/build-tools/automation/yaml-templates/apk-instrumentation.yaml @@ -13,7 +13,7 @@ parameters: retryCountOnTaskFailure: 1 steps: -- template: run-dotnet-preview.yaml@self +- template: build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self parameters: configuration: ${{ parameters.buildConfiguration }} xaSourcePath: ${{ parameters.xaSourcePath }} diff --git a/build-tools/automation/yaml-templates/build-linux.yaml b/build-tools/automation/yaml-templates/build-linux.yaml index 6d9f03fc4c2..da1ba2219fc 100644 --- a/build-tools/automation/yaml-templates/build-linux.yaml +++ b/build-tools/automation/yaml-templates/build-linux.yaml @@ -43,7 +43,7 @@ stages: # https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops#checkout-path - checkout: maui - - template: setup-ubuntu.yaml@self + - template: build-tools/automation/yaml-templates/setup-ubuntu.yaml@self - ${{ if ne(variables['System.PullRequest.IsFork'], 'True') }}: - checkout: monodroid @@ -89,10 +89,10 @@ stages: artifactName: ${{ parameters.nugetArtifactName }} targetPath: $(System.DefaultWorkingDirectory)/xamarin-android/bin/Build$(XA.Build.Configuration)/nuget-linux - - template: upload-results.yaml@self + - template: build-tools/automation/yaml-templates/upload-results.yaml@self parameters: xaSourcePath: $(System.DefaultWorkingDirectory)/xamarin-android artifactName: ${{ parameters.buildResultArtifactName }} includeBuildResults: true - - template: fail-on-issue.yaml@self + - template: build-tools/automation/yaml-templates/fail-on-issue.yaml@self diff --git a/build-tools/automation/yaml-templates/build-macos.yaml b/build-tools/automation/yaml-templates/build-macos.yaml index d974d13d44d..cbffc4e23fe 100644 --- a/build-tools/automation/yaml-templates/build-macos.yaml +++ b/build-tools/automation/yaml-templates/build-macos.yaml @@ -43,14 +43,14 @@ stages: path: ${{ parameters.checkoutPath }} persistCredentials: ${{ parameters.checkoutPersistCredentials }} - - template: commercial-build.yaml@self + - template: build-tools/automation/yaml-templates/commercial-build.yaml@self parameters: installerArtifactName: ${{ parameters.installerArtifactName }} nugetArtifactName: ${{ parameters.nugetArtifactName }} testAssembliesArtifactName: ${{ parameters.testAssembliesArtifactName }} windowsToolchainPdbArtifactName: ${{ parameters.windowsToolchainPdbArtifactName }} - - template: upload-results.yaml@self + - template: build-tools/automation/yaml-templates/upload-results.yaml@self parameters: xaSourcePath: $(System.DefaultWorkingDirectory)/xamarin-android artifactName: ${{ parameters.buildResultArtifactName }} diff --git a/build-tools/automation/yaml-templates/build-windows.yaml b/build-tools/automation/yaml-templates/build-windows.yaml index c933b2ae39e..d921b539a67 100644 --- a/build-tools/automation/yaml-templates/build-windows.yaml +++ b/build-tools/automation/yaml-templates/build-windows.yaml @@ -35,15 +35,15 @@ stages: path: ${{ parameters.checkoutPath }} persistCredentials: ${{ parameters.checkoutPersistCredentials }} - - template: kill-processes.yaml@self + - template: build-tools/automation/yaml-templates/kill-processes.yaml@self - - template: clean.yaml@self + - template: build-tools/automation/yaml-templates/clean.yaml@self - script: | echo ##vso[task.setvariable variable=JI_JAVA_HOME]%JAVA_HOME_17_X64% displayName: set JI_JAVA_HOME to $(JAVA_HOME_17_X64) - - template: use-dot-net.yaml@self + - template: build-tools/automation/yaml-templates/use-dot-net.yaml@self parameters: remove_dotnet: true @@ -54,7 +54,7 @@ stages: arguments: '-c $(XA.Build.Configuration) -t:Prepare --no-restore -p:AutoProvision=true -bl:$(System.DefaultWorkingDirectory)\bin\Build$(XA.Build.Configuration)\dotnet-build-prepare.binlog' # Build, pack .nupkgs, and extract workload packs to dotnet preview test directory - - template: run-dotnet-preview.yaml@self + - template: build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self parameters: project: Xamarin.Android.sln arguments: >- @@ -63,12 +63,12 @@ stages: displayName: Build Solution continueOnError: false - - template: install-global-tool.yaml@self + - template: build-tools/automation/yaml-templates/install-global-tool.yaml@self parameters: toolName: apkdiff version: $(ApkDiffToolVersion) - - template: run-nunit-tests.yaml@self + - template: build-tools/automation/yaml-templates/run-nunit-tests.yaml@self parameters: testRunTitle: Smoke MSBuild Tests - Windows Dotnet Build testAssembly: $(System.DefaultWorkingDirectory)\bin\Test$(XA.Build.Configuration)\$(DotNetStableTargetFramework)\Xamarin.Android.Build.Tests.dll @@ -81,9 +81,9 @@ stages: filename: dotnet-local.cmd arguments: build samples\HelloWorld\HelloWorld\HelloWorld.DotNet.csproj - - template: upload-results.yaml@self + - template: build-tools/automation/yaml-templates/upload-results.yaml@self parameters: artifactName: ${{ parameters.buildResultArtifactName }} includeBuildResults: true - - template: fail-on-issue.yaml@self + - template: build-tools/automation/yaml-templates/fail-on-issue.yaml@self diff --git a/build-tools/automation/yaml-templates/commercial-build.yaml b/build-tools/automation/yaml-templates/commercial-build.yaml index b1dbbb2f6ab..6f4639f9772 100644 --- a/build-tools/automation/yaml-templates/commercial-build.yaml +++ b/build-tools/automation/yaml-templates/commercial-build.yaml @@ -10,7 +10,7 @@ steps: - script: echo "##vso[task.setvariable variable=JI_JAVA_HOME]$HOME/android-toolchain/jdk-17" displayName: set JI_JAVA_HOME -- template: use-dot-net.yaml@self +- template: build-tools/automation/yaml-templates/use-dot-net.yaml@self parameters: remove_dotnet: true @@ -72,7 +72,7 @@ steps: displayName: CodeQL 3000 Finalize condition: and(succeededOrFailed(), eq(variables['Codeql.Enabled'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/main')) -- template: install-microbuild-tooling.yaml@self +- template: build-tools/automation/yaml-templates/install-microbuild-tooling.yaml@self parameters: condition: and(succeeded(), eq(variables['MicroBuildSignType'], 'Real')) @@ -121,7 +121,7 @@ steps: /p:MicroBuildOverridePluginDirectory=$(Build.StagingDirectory)/MicroBuild/Plugins /bl:${{ parameters.xaSourcePath }}/bin/Build$(XA.Build.Configuration)/sign-bu-ex.binlog -- template: remove-microbuild-tooling.yaml@self +- template: build-tools/automation/yaml-templates/remove-microbuild-tooling.yaml@self parameters: condition: and(succeededOrFailed(), eq(variables['MicroBuildSignType'], 'Real')) diff --git a/build-tools/automation/yaml-templates/run-emulator-tests.yaml b/build-tools/automation/yaml-templates/run-emulator-tests.yaml index 9032300b894..3b959e904aa 100644 --- a/build-tools/automation/yaml-templates/run-emulator-tests.yaml +++ b/build-tools/automation/yaml-templates/run-emulator-tests.yaml @@ -25,7 +25,7 @@ jobs: echo "##vso[task.setvariable variable=JAVA_HOME]${{ parameters.jdkTestFolder }}" displayName: set JAVA_HOME to ${{ parameters.jdkTestFolder }} - - template: setup-test-environment.yaml@self + - template: build-tools/automation/yaml-templates/setup-test-environment.yaml@self parameters: xaprepareScenario: EmulatorTestDependencies jdkTestFolder: ${{ parameters.jdkTestFolder }} @@ -35,14 +35,14 @@ jobs: artifactName: $(TestAssembliesArtifactName) downloadPath: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration) - - template: start-stop-emulator.yaml@self + - template: build-tools/automation/yaml-templates/start-stop-emulator.yaml@self parameters: emulatorMSBuildArgs: ${{ parameters.emulatorMSBuildArgs }} - ${{ parameters.testSteps }} - - template: upload-results.yaml@self + - template: build-tools/automation/yaml-templates/upload-results.yaml@self parameters: artifactName: Test Results - ${{ parameters.jobName }} With Emulator - macOS - - template: fail-on-issue.yaml@self + - template: build-tools/automation/yaml-templates/fail-on-issue.yaml@self diff --git a/build-tools/automation/yaml-templates/run-msbuild-tests.yaml b/build-tools/automation/yaml-templates/run-msbuild-tests.yaml index 55300a0ccd1..d932d4d7128 100644 --- a/build-tools/automation/yaml-templates/run-msbuild-tests.yaml +++ b/build-tools/automation/yaml-templates/run-msbuild-tests.yaml @@ -25,11 +25,11 @@ jobs: - ${{ if eq(parameters.testOS, 'Windows') }}: - script: netsh int ipv4 set global sourceroutingbehavior=drop - - template: kill-processes.yaml@self + - template: build-tools/automation/yaml-templates/kill-processes.yaml@self - - template: clean.yaml@self + - template: build-tools/automation/yaml-templates/clean.yaml@self - - template: setup-test-environment.yaml@self + - template: build-tools/automation/yaml-templates/setup-test-environment.yaml@self parameters: installTestSlicer: true installLegacyXamarinAndroid: true @@ -42,7 +42,7 @@ jobs: artifactName: $(TestAssembliesArtifactName) downloadPath: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration) - - template: run-sliced-nunit-tests.yaml@self + - template: build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml@self parameters: testAssembly: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll testFilter: ${{ parameters.testFilter }} @@ -50,11 +50,11 @@ jobs: retryFailedTests: false xaSourcePath: ${{ parameters.xaSourcePath }} - - template: upload-results.yaml@self + - template: build-tools/automation/yaml-templates/upload-results.yaml@self parameters: artifactName: Test Results - MSBuild - ${{ parameters.testOS }}-$(System.JobPositionInPhase) xaSourcePath: ${{ parameters.xaSourcePath }} - - template: fail-on-issue.yaml@self + - template: build-tools/automation/yaml-templates/fail-on-issue.yaml@self parameters: condition: ${{ parameters.shouldFailOnIssue }} diff --git a/build-tools/automation/yaml-templates/run-nunit-tests.yaml b/build-tools/automation/yaml-templates/run-nunit-tests.yaml index d3c89c454e4..e49b0ecd4f8 100644 --- a/build-tools/automation/yaml-templates/run-nunit-tests.yaml +++ b/build-tools/automation/yaml-templates/run-nunit-tests.yaml @@ -23,7 +23,7 @@ steps: timeoutInMinutes: ${{ parameters.timeoutInMinutes }} retryCountOnTaskFailure: ${{ parameters.retryCountOnTaskFailure }} -- template: kill-processes.yaml@self +- template: build-tools/automation/yaml-templates/kill-processes.yaml@self - task: PublishTestResults@2 inputs: diff --git a/build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml b/build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml index c725875ce93..24ef5f16ebf 100644 --- a/build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml +++ b/build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml @@ -28,7 +28,7 @@ steps: - ${{ if eq(parameters.retryFailedTests, 'false') }}: # If we aren't using auto-retry logic, then this is just a simple template call - - template: run-nunit-tests.yaml@self + - template: build-tools/automation/yaml-templates/run-nunit-tests.yaml@self parameters: testRunTitle: ${{ parameters.testRunTitle }}-$(System.JobPositionInPhase) testAssembly: ${{ parameters.testAssembly }} @@ -70,7 +70,7 @@ steps: custom: build-server arguments: shutdown - - template: run-nunit-tests.yaml@self + - template: build-tools/automation/yaml-templates/run-nunit-tests.yaml@self parameters: testRunTitle: ${{ parameters.testRunTitle }}-$(System.JobPositionInPhase) (Auto-Retry) testAssembly: ${{ parameters.testAssembly }} diff --git a/build-tools/automation/yaml-templates/setup-test-environment.yaml b/build-tools/automation/yaml-templates/setup-test-environment.yaml index 9628b164e63..35c42a053ad 100644 --- a/build-tools/automation/yaml-templates/setup-test-environment.yaml +++ b/build-tools/automation/yaml-templates/setup-test-environment.yaml @@ -35,14 +35,14 @@ steps: # Install .NET 6 for legacy tests - ${{ if eq(parameters.installLegacyDotNet, true) }}: - - template: use-dot-net.yaml@self + - template: build-tools/automation/yaml-templates/use-dot-net.yaml@self parameters: version: 6.0 quality: GA remove_dotnet: ${{ parameters.remove_dotnet }} # Install latest .NET -- template: use-dot-net.yaml@self +- template: build-tools/automation/yaml-templates/use-dot-net.yaml@self - task: DotNetCoreCLI@2 displayName: shut down existing build daemons @@ -52,7 +52,7 @@ steps: arguments: shutdown - ${{ if eq(parameters.updateMono, true) }}: - - template: run-xaprepare.yaml@self + - template: build-tools/automation/yaml-templates/run-xaprepare.yaml@self parameters: displayName: run xaprepare-UpdateMono arguments: --s=UpdateMono --auto-provision=yes --auto-provision-uses-sudo=yes @@ -60,7 +60,7 @@ steps: xaSourcePath: ${{ parameters.xaSourcePath }} - ${{ if eq(parameters.installLegacyXamarinAndroid, true) }}: - - template: install-global-tool.yaml@self + - template: build-tools/automation/yaml-templates/install-global-tool.yaml@self parameters: toolName: boots version: $(BootsToolVersion) @@ -68,7 +68,7 @@ steps: - powershell: boots --stable Xamarin.Android displayName: install Xamarin.Android stable -- template: run-xaprepare.yaml@self +- template: build-tools/automation/yaml-templates/run-xaprepare.yaml@self parameters: arguments: --s=${{ parameters.xaprepareScenario }} --android-sdk-platforms="${{ parameters.androidSdkPlatforms }}" xaSourcePath: ${{ parameters.xaSourcePath }} @@ -98,13 +98,13 @@ steps: arguments: -t:ExtractWorkloadPacks -c ${{ parameters.configuration }} -v:n -bl:${{ parameters.xaSourcePath }}/bin/Test${{ parameters.configuration }}/extract-workloads.binlog - ${{ if eq(parameters.installApkDiff, true) }}: - - template: install-global-tool.yaml@self + - template: build-tools/automation/yaml-templates/install-global-tool.yaml@self parameters: toolName: apkdiff version: $(ApkDiffToolVersion) - ${{ if eq(parameters.installTestSlicer, true) }}: - - template: install-global-tool.yaml@self + - template: build-tools/automation/yaml-templates/install-global-tool.yaml@self parameters: toolName: dotnet-test-slicer version: $(TestSlicerToolVersion) diff --git a/build-tools/automation/yaml-templates/setup-ubuntu.yaml b/build-tools/automation/yaml-templates/setup-ubuntu.yaml index cc41cdb2a49..067208b6401 100644 --- a/build-tools/automation/yaml-templates/setup-ubuntu.yaml +++ b/build-tools/automation/yaml-templates/setup-ubuntu.yaml @@ -13,7 +13,7 @@ steps: # sudo apt install -y --no-install-recommends mono-complete nuget msbuild # displayName: install mono preview -#- template: use-dot-net.yaml@self +#- template: build-tools/automation/yaml-templates/use-dot-net.yaml@self # parameters: # remove_dotnet: true diff --git a/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml b/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml index 216bf28b972..37ff1735d98 100644 --- a/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml +++ b/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml @@ -31,7 +31,7 @@ stages: workspace: clean: all steps: - - template: setup-test-environment.yaml@self + - template: build-tools/automation/yaml-templates/setup-test-environment.yaml@self parameters: installTestSlicer: true installApkDiff: false @@ -47,12 +47,12 @@ stages: artifactName: $(TestAssembliesArtifactName) downloadPath: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration) - - template: start-stop-emulator.yaml@self + - template: build-tools/automation/yaml-templates/start-stop-emulator.yaml@self parameters: xaSourcePath: ${{ parameters.xaSourcePath }} startContinueOnError: ${{ parameters.emulatorStartContinueOnError }} - - template: run-sliced-nunit-tests.yaml@self + - template: build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml@self parameters: testAssembly: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration)/MSBuildDeviceIntegration/$(DotNetStableTargetFramework)/MSBuildDeviceIntegration.dll testFilter: $(ExcludedNightlyNUnitCategories) @@ -64,12 +64,12 @@ stages: command: stop xaSourcePath: ${{ parameters.xaSourcePath }} - - template: upload-results.yaml@self + - template: build-tools/automation/yaml-templates/upload-results.yaml@self parameters: artifactName: Test Results - MSBuild With Emulator - macOS-$(System.JobPositionInPhase) xaSourcePath: ${{ parameters.xaSourcePath }} - - template: fail-on-issue.yaml@self + - template: build-tools/automation/yaml-templates/fail-on-issue.yaml@self parameters: condition: ${{ parameters.shouldFailOnIssue }} @@ -90,7 +90,7 @@ stages: workspace: clean: all steps: - - template: setup-test-environment.yaml@self + - template: build-tools/automation/yaml-templates/setup-test-environment.yaml@self parameters: installTestSlicer: true installApkDiff: false @@ -104,7 +104,7 @@ stages: artifactName: $(TestAssembliesArtifactName) downloadPath: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration) - - template: start-stop-emulator.yaml@self + - template: build-tools/automation/yaml-templates/start-stop-emulator.yaml@self parameters: specificImage: true deviceName: $(deviceName) @@ -114,7 +114,7 @@ stages: xaSourcePath: ${{ parameters.xaSourcePath }} startContinueOnError: ${{ parameters.emulatorStartContinueOnError }} - - template: run-sliced-nunit-tests.yaml@self + - template: build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml@self parameters: testRunTitle: WearOS On Device - macOS testAssembly: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration)/MSBuildDeviceIntegration/$(DotNetStableTargetFramework)/MSBuildDeviceIntegration.dll @@ -122,7 +122,7 @@ stages: xaSourcePath: ${{ parameters.xaSourcePath }} - ${{ if ne(parameters.usesCleanImages, true) }}: - - template: start-stop-emulator.yaml@self + - template: build-tools/automation/yaml-templates/start-stop-emulator.yaml@self parameters: command: stop specificImage: true @@ -132,12 +132,12 @@ stages: avdType: $(avdType) xaSourcePath: ${{ parameters.xaSourcePath }} - - template: upload-results.yaml@self + - template: build-tools/automation/yaml-templates/upload-results.yaml@self parameters: configuration: $(XA.Build.Configuration) artifactName: Test Results - Emulator $(avdApiLevel)-$(avdAbi)-$(avdType) - macOS xaSourcePath: ${{ parameters.xaSourcePath }} - - template: fail-on-issue.yaml@self + - template: build-tools/automation/yaml-templates/fail-on-issue.yaml@self parameters: condition: ${{ parameters.shouldFailOnIssue }} diff --git a/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml b/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml index b68c63d84dc..04e74493290 100644 --- a/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml +++ b/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml @@ -16,7 +16,7 @@ stages: dependsOn: ${{ parameters.dependsOn }} condition: ${{ parameters.stageCondition }} jobs: - - template: run-msbuild-tests.yaml@self + - template: build-tools/automation/yaml-templates/run-msbuild-tests.yaml@self parameters: testOS: macOS jobName: mac_msbuild_tests @@ -27,7 +27,7 @@ stages: commit: ${{ parameters.commit }} shouldFailOnIssue: ${{ parameters.shouldFailOnIssue }} - - template: run-msbuild-tests.yaml@self + - template: build-tools/automation/yaml-templates/run-msbuild-tests.yaml@self parameters: testOS: Windows jobName: win_msbuild_tests diff --git a/build-tools/automation/yaml-templates/upload-results.yaml b/build-tools/automation/yaml-templates/upload-results.yaml index 9749dd185d7..a1313928cdb 100644 --- a/build-tools/automation/yaml-templates/upload-results.yaml +++ b/build-tools/automation/yaml-templates/upload-results.yaml @@ -6,7 +6,7 @@ parameters: condition: or(ne(variables['Agent.JobStatus'], 'Succeeded'), eq(variables['XA.PublishAllLogs'], 'true')) steps: -- template: run-xaprepare.yaml@self +- template: build-tools/automation/yaml-templates/run-xaprepare.yaml@self parameters: configuration: ${{ parameters.configuration }} arguments: --s=CopyExtraResultFilesForCI --verbosity v @@ -15,7 +15,7 @@ steps: condition: ${{ parameters.condition }} - ${{ if eq(parameters.includeBuildResults, false) }}: - - template: publish-artifact.yaml@self + - template: build-tools/automation/yaml-templates/publish-artifact.yaml@self parameters: displayName: upload test results artifactName: ${{ parameters.artifactName }} @@ -30,7 +30,7 @@ steps: targetFolder: $(Build.StagingDirectory)/Test${{ parameters.configuration }}/Build${{ parameters.configuration }} condition: ${{ parameters.condition }} - - template: publish-artifact.yaml@self + - template: build-tools/automation/yaml-templates/publish-artifact.yaml@self parameters: displayName: upload build and test results artifactName: ${{ parameters.artifactName }} From 3bf47826407bf378771cb2a8e0bb78f03971b912 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Wed, 21 Feb 2024 11:45:02 -0800 Subject: [PATCH 04/36] Rooted template paths take 2 --- build-tools/automation/azure-pipelines.yaml | 74 +++++++++---------- .../yaml-templates/apk-instrumentation.yaml | 2 +- .../yaml-templates/build-linux.yaml | 6 +- .../yaml-templates/build-macos.yaml | 4 +- .../yaml-templates/build-windows.yaml | 16 ++-- .../yaml-templates/commercial-build.yaml | 6 +- .../yaml-templates/run-emulator-tests.yaml | 8 +- .../yaml-templates/run-msbuild-tests.yaml | 12 +-- .../yaml-templates/run-nunit-tests.yaml | 2 +- .../run-sliced-nunit-tests.yaml | 4 +- .../setup-test-environment.yaml | 14 ++-- .../yaml-templates/setup-ubuntu.yaml | 2 +- .../stage-msbuild-emulator-tests.yaml | 22 +++--- .../yaml-templates/stage-msbuild-tests.yaml | 4 +- .../yaml-templates/upload-results.yaml | 6 +- 15 files changed, 91 insertions(+), 91 deletions(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 61170d8e64a..0ec0710c20a 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -48,7 +48,7 @@ parameters: # Global variables variables: -- template: build-tools/automation/yaml-templates/variables.yaml@self +- template: /build-tools/automation/yaml-templates/variables.yaml@self - template: templates/common/vs-release-vars.yml@sdk-insertions - ${{ if eq(variables['Build.DefinitionName'], 'Xamarin.Android-Private') }}: - group: AzureDevOps-Artifact-Feeds-Pats @@ -94,12 +94,12 @@ extends: os: windows # Stage and Job "display names" are shortened because they are combined to form the name of the corresponding GitHub check. stages: - - template: build-tools/automation/yaml-templates/build-macos.yaml@self + - template: /build-tools/automation/yaml-templates/build-macos.yaml@self - - template: build-tools/automation/yaml-templates/build-windows.yaml@self + - template: /build-tools/automation/yaml-templates/build-windows.yaml@self # Check - "Xamarin.Android (Linux > Build)" - - template: build-tools/automation/yaml-templates/build-linux.yaml@self + - template: /build-tools/automation/yaml-templates/build-linux.yaml@self - stage: smoke_tests displayName: Package Tests @@ -114,7 +114,7 @@ extends: workspace: clean: all steps: - - template: build-tools/automation/yaml-templates/setup-test-environment.yaml@self + - template: /build-tools/automation/yaml-templates/setup-test-environment.yaml@self parameters: xaprepareScenario: EmulatorTestDependencies @@ -130,7 +130,7 @@ extends: projects: $(System.DefaultWorkingDirectory)/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj arguments: -c Debug -bl:$(System.DefaultWorkingDirectory)/bin/TestDebug/BootstrapTasks.binlog - - template: build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self + - template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self parameters: project: Xamarin.Android.sln arguments: >- @@ -139,16 +139,16 @@ extends: displayName: prepare java.interop Debug continueOnError: false - - template: build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self + - template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self parameters: project: Xamarin.Android.sln arguments: -t:PrepareJavaInterop -c $(XA.Build.Configuration) --no-restore displayName: prepare java.interop $(XA.Build.Configuration) continueOnError: false - - template: build-tools/automation/yaml-templates/start-stop-emulator.yaml@self + - template: /build-tools/automation/yaml-templates/start-stop-emulator.yaml@self - - template: build-tools/automation/yaml-templates/apk-instrumentation.yaml@self + - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self parameters: configuration: $(XA.Build.Configuration) testName: Mono.Android.NET_Tests-$(XA.Build.Configuration) @@ -157,7 +157,7 @@ extends: artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab artifactFolder: $(DotNetTargetFramework)-$(XA.Build.Configuration) - - template: build-tools/automation/yaml-templates/apk-instrumentation.yaml@self + - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self parameters: buildConfiguration: $(XA.Build.Configuration) configuration: Debug @@ -167,7 +167,7 @@ extends: artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.apk artifactFolder: $(DotNetTargetFramework)-Debug - - template: build-tools/automation/yaml-templates/apk-instrumentation.yaml@self + - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self parameters: configuration: $(XA.Build.Configuration) testName: Mono.Android.NET_Tests-NoAab @@ -177,7 +177,7 @@ extends: artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.apk artifactFolder: $(DotNetTargetFramework)-NoAab - - template: build-tools/automation/yaml-templates/apk-instrumentation.yaml@self + - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self parameters: configuration: $(XA.Build.Configuration) testName: Mono.Android.NET_Tests-Interpreter @@ -187,7 +187,7 @@ extends: artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab artifactFolder: $(DotNetTargetFramework)-Interpreter - - template: build-tools/automation/yaml-templates/apk-instrumentation.yaml@self + - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self parameters: configuration: $(XA.Build.Configuration) testName: Mono.Android.NET_Tests-NoAot @@ -197,7 +197,7 @@ extends: artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab artifactFolder: $(DotNetTargetFramework)-NoAot - - template: build-tools/automation/yaml-templates/apk-instrumentation.yaml@self + - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self parameters: configuration: $(XA.Build.Configuration) testName: Mono.Android.NET_Tests-AotLlvm @@ -207,7 +207,7 @@ extends: artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab artifactFolder: $(DotNetTargetFramework)-AotLlvm - - template: build-tools/automation/yaml-templates/apk-instrumentation.yaml@self + - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self parameters: configuration: $(XA.Build.Configuration) testName: Xamarin.Android.JcwGen_Tests @@ -216,7 +216,7 @@ extends: artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Xamarin.Android.JcwGen_Tests-Signed.apk artifactFolder: $(DotNetTargetFramework)-Default - - template: build-tools/automation/yaml-templates/apk-instrumentation.yaml@self + - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self parameters: configuration: $(XA.Build.Configuration) testName: Xamarin.Android.JcwGen_Tests_FastDev @@ -226,7 +226,7 @@ extends: artifactFolder: $(DotNetTargetFramework)-FastDev_Assemblies_Dexes extraBuildArgs: /p:AndroidFastDeploymentType=Assemblies:Dexes - - template: build-tools/automation/yaml-templates/run-nunit-tests.yaml@self + - template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml@self parameters: testRunTitle: Xamarin.Android.Tools.Aidl-Tests - macOS testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Tools.Aidl-Tests.dll @@ -239,20 +239,20 @@ extends: args: build samples/HelloWorld/HelloWorld/HelloWorld.DotNet.csproj - ${{ if ne(parameters.macTestAgentsUseCleanImages, true) }}: - - template: build-tools/automation/yaml-templates/start-stop-emulator.yaml@self + - template: /build-tools/automation/yaml-templates/start-stop-emulator.yaml@self parameters: command: stop - - template: build-tools/automation/yaml-templates/upload-results.yaml@self + - template: /build-tools/automation/yaml-templates/upload-results.yaml@self parameters: artifactName: Test Results - APKs .NET $(XA.Build.Configuration) - macOS - - template: build-tools/automation/yaml-templates/upload-results.yaml@self + - template: /build-tools/automation/yaml-templates/upload-results.yaml@self parameters: artifactName: Test Results - APKs .NET Debug - macOS configuration: Debug - - template: build-tools/automation/yaml-templates/fail-on-issue.yaml@self + - template: /build-tools/automation/yaml-templates/fail-on-issue.yaml@self - stage: linux_tests displayName: Linux Tests @@ -269,37 +269,37 @@ extends: workspace: clean: all steps: - - template: build-tools/automation/yaml-templates/setup-ubuntu.yaml@self + - template: /build-tools/automation/yaml-templates/setup-ubuntu.yaml@self - - template: build-tools/automation/yaml-templates/setup-test-environment.yaml@self + - template: /build-tools/automation/yaml-templates/setup-test-environment.yaml@self - task: DownloadPipelineArtifact@2 inputs: artifactName: $(TestAssembliesArtifactName) downloadPath: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration) - - template: build-tools/automation/yaml-templates/run-nunit-tests.yaml@self + - template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml@self parameters: testRunTitle: Xamarin.Android.Build.Tests - Linux BuildTest testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll dotNetTestExtraArgs: --filter "Name = BuildTest" testResultsFile: TestResult-BuildTest-Linux-$(XA.Build.Configuration).xml - - template: build-tools/automation/yaml-templates/run-nunit-tests.yaml@self + - template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml@self parameters: testRunTitle: Xamarin.Android.Build.Tests - Linux PackagingTest testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll dotNetTestExtraArgs: --filter "Name = PackagingTest" testResultsFile: TestResult-PackagingTest-Linux-$(XA.Build.Configuration).xml - - template: build-tools/automation/yaml-templates/run-nunit-tests.yaml@self + - template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml@self parameters: testRunTitle: Xamarin.Android.Build.Tests - Linux XASdkTests testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll dotNetTestExtraArgs: --filter "Name = XASdkTests & Name != XamarinLegacySdk" testResultsFile: TestResult-XASdkTests-Linux-$(XA.Build.Configuration).xml - - template: build-tools/automation/yaml-templates/run-nunit-tests.yaml@self + - template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml@self parameters: testRunTitle: Xamarin.Android.Build.Tests - Linux AndroidDependenciesTests testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll @@ -312,16 +312,16 @@ extends: scriptPath: dotnet-local.sh args: build samples/HelloWorld/HelloWorld/HelloWorld.DotNet.csproj - - template: build-tools/automation/yaml-templates/upload-results.yaml@self + - template: /build-tools/automation/yaml-templates/upload-results.yaml@self parameters: configuration: $(XA.Build.Configuration) artifactName: Test Results - MSBuild - Linux - - template: build-tools/automation/yaml-templates/fail-on-issue.yaml@self + - template: /build-tools/automation/yaml-templates/fail-on-issue.yaml@self - - template: build-tools/automation/yaml-templates/stage-msbuild-tests.yaml@self + - template: /build-tools/automation/yaml-templates/stage-msbuild-tests.yaml@self - - template: build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml@self + - template: /build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml@self parameters: usesCleanImages: ${{ parameters.macTestAgentsUseCleanImages }} @@ -346,7 +346,7 @@ extends: path: s/maui persistCredentials: true - - template: build-tools/automation/yaml-templates/setup-test-environment.yaml@self + - template: /build-tools/automation/yaml-templates/setup-test-environment.yaml@self parameters: xaSourcePath: $(Build.SourcesDirectory)/xamarin-android androidSdkPlatforms: $(DefaultTestSdkPlatforms) @@ -405,7 +405,7 @@ extends: projects: $(Build.SourcesDirectory)/xamarin-android/Xamarin.Android.sln arguments: -t:InstallMaui -p:MauiUseLocalPacks=true -p:MauiWorkloadToInstall=maui -c $(XA.Build.Configuration) --no-restore -v:n -bl:$(Build.StagingDirectory)/logs/install-maui.binlog - - template: build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self + - template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self parameters: command: new arguments: maui -o $(Build.StagingDirectory)/MauiTestProj @@ -421,7 +421,7 @@ extends: $xml.Save($project) displayName: set TargetFrameworks to Android-only - - template: build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self + - template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self parameters: project: $(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj arguments: >- @@ -431,7 +431,7 @@ extends: xaSourcePath: $(Build.SourcesDirectory)/xamarin-android displayName: Build MAUI template - Debug - - template: build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self + - template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self parameters: project: $(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj arguments: >- @@ -450,14 +450,14 @@ extends: TargetFolder: $(Build.StagingDirectory)/logs flattenFolders: true - - template: build-tools/automation/yaml-templates/publish-artifact.yaml@self + - template: /build-tools/automation/yaml-templates/publish-artifact.yaml@self parameters: displayName: upload build and test results artifactName: Test Results - MAUI Integration targetPath: $(Build.StagingDirectory)/logs condition: or(ne(variables['Agent.JobStatus'], 'Succeeded'), eq(variables['XA.PublishAllLogs'], 'true')) - - template: build-tools/automation/yaml-templates/fail-on-issue.yaml@self + - template: /build-tools/automation/yaml-templates/fail-on-issue.yaml@self - stage: dotnet_prepare_release diff --git a/build-tools/automation/yaml-templates/apk-instrumentation.yaml b/build-tools/automation/yaml-templates/apk-instrumentation.yaml index acff28b13ef..0eac8e12dd8 100644 --- a/build-tools/automation/yaml-templates/apk-instrumentation.yaml +++ b/build-tools/automation/yaml-templates/apk-instrumentation.yaml @@ -13,7 +13,7 @@ parameters: retryCountOnTaskFailure: 1 steps: -- template: build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self +- template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self parameters: configuration: ${{ parameters.buildConfiguration }} xaSourcePath: ${{ parameters.xaSourcePath }} diff --git a/build-tools/automation/yaml-templates/build-linux.yaml b/build-tools/automation/yaml-templates/build-linux.yaml index da1ba2219fc..30b2f3fd981 100644 --- a/build-tools/automation/yaml-templates/build-linux.yaml +++ b/build-tools/automation/yaml-templates/build-linux.yaml @@ -43,7 +43,7 @@ stages: # https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops#checkout-path - checkout: maui - - template: build-tools/automation/yaml-templates/setup-ubuntu.yaml@self + - template: /build-tools/automation/yaml-templates/setup-ubuntu.yaml@self - ${{ if ne(variables['System.PullRequest.IsFork'], 'True') }}: - checkout: monodroid @@ -89,10 +89,10 @@ stages: artifactName: ${{ parameters.nugetArtifactName }} targetPath: $(System.DefaultWorkingDirectory)/xamarin-android/bin/Build$(XA.Build.Configuration)/nuget-linux - - template: build-tools/automation/yaml-templates/upload-results.yaml@self + - template: /build-tools/automation/yaml-templates/upload-results.yaml@self parameters: xaSourcePath: $(System.DefaultWorkingDirectory)/xamarin-android artifactName: ${{ parameters.buildResultArtifactName }} includeBuildResults: true - - template: build-tools/automation/yaml-templates/fail-on-issue.yaml@self + - template: /build-tools/automation/yaml-templates/fail-on-issue.yaml@self diff --git a/build-tools/automation/yaml-templates/build-macos.yaml b/build-tools/automation/yaml-templates/build-macos.yaml index cbffc4e23fe..e732ef0f46b 100644 --- a/build-tools/automation/yaml-templates/build-macos.yaml +++ b/build-tools/automation/yaml-templates/build-macos.yaml @@ -43,14 +43,14 @@ stages: path: ${{ parameters.checkoutPath }} persistCredentials: ${{ parameters.checkoutPersistCredentials }} - - template: build-tools/automation/yaml-templates/commercial-build.yaml@self + - template: /build-tools/automation/yaml-templates/commercial-build.yaml@self parameters: installerArtifactName: ${{ parameters.installerArtifactName }} nugetArtifactName: ${{ parameters.nugetArtifactName }} testAssembliesArtifactName: ${{ parameters.testAssembliesArtifactName }} windowsToolchainPdbArtifactName: ${{ parameters.windowsToolchainPdbArtifactName }} - - template: build-tools/automation/yaml-templates/upload-results.yaml@self + - template: /build-tools/automation/yaml-templates/upload-results.yaml@self parameters: xaSourcePath: $(System.DefaultWorkingDirectory)/xamarin-android artifactName: ${{ parameters.buildResultArtifactName }} diff --git a/build-tools/automation/yaml-templates/build-windows.yaml b/build-tools/automation/yaml-templates/build-windows.yaml index d921b539a67..d1080df907d 100644 --- a/build-tools/automation/yaml-templates/build-windows.yaml +++ b/build-tools/automation/yaml-templates/build-windows.yaml @@ -35,15 +35,15 @@ stages: path: ${{ parameters.checkoutPath }} persistCredentials: ${{ parameters.checkoutPersistCredentials }} - - template: build-tools/automation/yaml-templates/kill-processes.yaml@self + - template: /build-tools/automation/yaml-templates/kill-processes.yaml@self - - template: build-tools/automation/yaml-templates/clean.yaml@self + - template: /build-tools/automation/yaml-templates/clean.yaml@self - script: | echo ##vso[task.setvariable variable=JI_JAVA_HOME]%JAVA_HOME_17_X64% displayName: set JI_JAVA_HOME to $(JAVA_HOME_17_X64) - - template: build-tools/automation/yaml-templates/use-dot-net.yaml@self + - template: /build-tools/automation/yaml-templates/use-dot-net.yaml@self parameters: remove_dotnet: true @@ -54,7 +54,7 @@ stages: arguments: '-c $(XA.Build.Configuration) -t:Prepare --no-restore -p:AutoProvision=true -bl:$(System.DefaultWorkingDirectory)\bin\Build$(XA.Build.Configuration)\dotnet-build-prepare.binlog' # Build, pack .nupkgs, and extract workload packs to dotnet preview test directory - - template: build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self + - template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self parameters: project: Xamarin.Android.sln arguments: >- @@ -63,12 +63,12 @@ stages: displayName: Build Solution continueOnError: false - - template: build-tools/automation/yaml-templates/install-global-tool.yaml@self + - template: /build-tools/automation/yaml-templates/install-global-tool.yaml@self parameters: toolName: apkdiff version: $(ApkDiffToolVersion) - - template: build-tools/automation/yaml-templates/run-nunit-tests.yaml@self + - template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml@self parameters: testRunTitle: Smoke MSBuild Tests - Windows Dotnet Build testAssembly: $(System.DefaultWorkingDirectory)\bin\Test$(XA.Build.Configuration)\$(DotNetStableTargetFramework)\Xamarin.Android.Build.Tests.dll @@ -81,9 +81,9 @@ stages: filename: dotnet-local.cmd arguments: build samples\HelloWorld\HelloWorld\HelloWorld.DotNet.csproj - - template: build-tools/automation/yaml-templates/upload-results.yaml@self + - template: /build-tools/automation/yaml-templates/upload-results.yaml@self parameters: artifactName: ${{ parameters.buildResultArtifactName }} includeBuildResults: true - - template: build-tools/automation/yaml-templates/fail-on-issue.yaml@self + - template: /build-tools/automation/yaml-templates/fail-on-issue.yaml@self diff --git a/build-tools/automation/yaml-templates/commercial-build.yaml b/build-tools/automation/yaml-templates/commercial-build.yaml index 6f4639f9772..369e99ade37 100644 --- a/build-tools/automation/yaml-templates/commercial-build.yaml +++ b/build-tools/automation/yaml-templates/commercial-build.yaml @@ -10,7 +10,7 @@ steps: - script: echo "##vso[task.setvariable variable=JI_JAVA_HOME]$HOME/android-toolchain/jdk-17" displayName: set JI_JAVA_HOME -- template: build-tools/automation/yaml-templates/use-dot-net.yaml@self +- template: /build-tools/automation/yaml-templates/use-dot-net.yaml@self parameters: remove_dotnet: true @@ -72,7 +72,7 @@ steps: displayName: CodeQL 3000 Finalize condition: and(succeededOrFailed(), eq(variables['Codeql.Enabled'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/main')) -- template: build-tools/automation/yaml-templates/install-microbuild-tooling.yaml@self +- template: /build-tools/automation/yaml-templates/install-microbuild-tooling.yaml@self parameters: condition: and(succeeded(), eq(variables['MicroBuildSignType'], 'Real')) @@ -121,7 +121,7 @@ steps: /p:MicroBuildOverridePluginDirectory=$(Build.StagingDirectory)/MicroBuild/Plugins /bl:${{ parameters.xaSourcePath }}/bin/Build$(XA.Build.Configuration)/sign-bu-ex.binlog -- template: build-tools/automation/yaml-templates/remove-microbuild-tooling.yaml@self +- template: /build-tools/automation/yaml-templates/remove-microbuild-tooling.yaml@self parameters: condition: and(succeededOrFailed(), eq(variables['MicroBuildSignType'], 'Real')) diff --git a/build-tools/automation/yaml-templates/run-emulator-tests.yaml b/build-tools/automation/yaml-templates/run-emulator-tests.yaml index 3b959e904aa..1d3bf77c7c3 100644 --- a/build-tools/automation/yaml-templates/run-emulator-tests.yaml +++ b/build-tools/automation/yaml-templates/run-emulator-tests.yaml @@ -25,7 +25,7 @@ jobs: echo "##vso[task.setvariable variable=JAVA_HOME]${{ parameters.jdkTestFolder }}" displayName: set JAVA_HOME to ${{ parameters.jdkTestFolder }} - - template: build-tools/automation/yaml-templates/setup-test-environment.yaml@self + - template: /build-tools/automation/yaml-templates/setup-test-environment.yaml@self parameters: xaprepareScenario: EmulatorTestDependencies jdkTestFolder: ${{ parameters.jdkTestFolder }} @@ -35,14 +35,14 @@ jobs: artifactName: $(TestAssembliesArtifactName) downloadPath: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration) - - template: build-tools/automation/yaml-templates/start-stop-emulator.yaml@self + - template: /build-tools/automation/yaml-templates/start-stop-emulator.yaml@self parameters: emulatorMSBuildArgs: ${{ parameters.emulatorMSBuildArgs }} - ${{ parameters.testSteps }} - - template: build-tools/automation/yaml-templates/upload-results.yaml@self + - template: /build-tools/automation/yaml-templates/upload-results.yaml@self parameters: artifactName: Test Results - ${{ parameters.jobName }} With Emulator - macOS - - template: build-tools/automation/yaml-templates/fail-on-issue.yaml@self + - template: /build-tools/automation/yaml-templates/fail-on-issue.yaml@self diff --git a/build-tools/automation/yaml-templates/run-msbuild-tests.yaml b/build-tools/automation/yaml-templates/run-msbuild-tests.yaml index d932d4d7128..45283e12501 100644 --- a/build-tools/automation/yaml-templates/run-msbuild-tests.yaml +++ b/build-tools/automation/yaml-templates/run-msbuild-tests.yaml @@ -25,11 +25,11 @@ jobs: - ${{ if eq(parameters.testOS, 'Windows') }}: - script: netsh int ipv4 set global sourceroutingbehavior=drop - - template: build-tools/automation/yaml-templates/kill-processes.yaml@self + - template: /build-tools/automation/yaml-templates/kill-processes.yaml@self - - template: build-tools/automation/yaml-templates/clean.yaml@self + - template: /build-tools/automation/yaml-templates/clean.yaml@self - - template: build-tools/automation/yaml-templates/setup-test-environment.yaml@self + - template: /build-tools/automation/yaml-templates/setup-test-environment.yaml@self parameters: installTestSlicer: true installLegacyXamarinAndroid: true @@ -42,7 +42,7 @@ jobs: artifactName: $(TestAssembliesArtifactName) downloadPath: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration) - - template: build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml@self + - template: /build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml@self parameters: testAssembly: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll testFilter: ${{ parameters.testFilter }} @@ -50,11 +50,11 @@ jobs: retryFailedTests: false xaSourcePath: ${{ parameters.xaSourcePath }} - - template: build-tools/automation/yaml-templates/upload-results.yaml@self + - template: /build-tools/automation/yaml-templates/upload-results.yaml@self parameters: artifactName: Test Results - MSBuild - ${{ parameters.testOS }}-$(System.JobPositionInPhase) xaSourcePath: ${{ parameters.xaSourcePath }} - - template: build-tools/automation/yaml-templates/fail-on-issue.yaml@self + - template: /build-tools/automation/yaml-templates/fail-on-issue.yaml@self parameters: condition: ${{ parameters.shouldFailOnIssue }} diff --git a/build-tools/automation/yaml-templates/run-nunit-tests.yaml b/build-tools/automation/yaml-templates/run-nunit-tests.yaml index e49b0ecd4f8..3df74d5495a 100644 --- a/build-tools/automation/yaml-templates/run-nunit-tests.yaml +++ b/build-tools/automation/yaml-templates/run-nunit-tests.yaml @@ -23,7 +23,7 @@ steps: timeoutInMinutes: ${{ parameters.timeoutInMinutes }} retryCountOnTaskFailure: ${{ parameters.retryCountOnTaskFailure }} -- template: build-tools/automation/yaml-templates/kill-processes.yaml@self +- template: /build-tools/automation/yaml-templates/kill-processes.yaml@self - task: PublishTestResults@2 inputs: diff --git a/build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml b/build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml index 24ef5f16ebf..d96155e099b 100644 --- a/build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml +++ b/build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml @@ -28,7 +28,7 @@ steps: - ${{ if eq(parameters.retryFailedTests, 'false') }}: # If we aren't using auto-retry logic, then this is just a simple template call - - template: build-tools/automation/yaml-templates/run-nunit-tests.yaml@self + - template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml@self parameters: testRunTitle: ${{ parameters.testRunTitle }}-$(System.JobPositionInPhase) testAssembly: ${{ parameters.testAssembly }} @@ -70,7 +70,7 @@ steps: custom: build-server arguments: shutdown - - template: build-tools/automation/yaml-templates/run-nunit-tests.yaml@self + - template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml@self parameters: testRunTitle: ${{ parameters.testRunTitle }}-$(System.JobPositionInPhase) (Auto-Retry) testAssembly: ${{ parameters.testAssembly }} diff --git a/build-tools/automation/yaml-templates/setup-test-environment.yaml b/build-tools/automation/yaml-templates/setup-test-environment.yaml index 35c42a053ad..6f6fc91f6c1 100644 --- a/build-tools/automation/yaml-templates/setup-test-environment.yaml +++ b/build-tools/automation/yaml-templates/setup-test-environment.yaml @@ -35,14 +35,14 @@ steps: # Install .NET 6 for legacy tests - ${{ if eq(parameters.installLegacyDotNet, true) }}: - - template: build-tools/automation/yaml-templates/use-dot-net.yaml@self + - template: /build-tools/automation/yaml-templates/use-dot-net.yaml@self parameters: version: 6.0 quality: GA remove_dotnet: ${{ parameters.remove_dotnet }} # Install latest .NET -- template: build-tools/automation/yaml-templates/use-dot-net.yaml@self +- template: /build-tools/automation/yaml-templates/use-dot-net.yaml@self - task: DotNetCoreCLI@2 displayName: shut down existing build daemons @@ -52,7 +52,7 @@ steps: arguments: shutdown - ${{ if eq(parameters.updateMono, true) }}: - - template: build-tools/automation/yaml-templates/run-xaprepare.yaml@self + - template: /build-tools/automation/yaml-templates/run-xaprepare.yaml@self parameters: displayName: run xaprepare-UpdateMono arguments: --s=UpdateMono --auto-provision=yes --auto-provision-uses-sudo=yes @@ -60,7 +60,7 @@ steps: xaSourcePath: ${{ parameters.xaSourcePath }} - ${{ if eq(parameters.installLegacyXamarinAndroid, true) }}: - - template: build-tools/automation/yaml-templates/install-global-tool.yaml@self + - template: /build-tools/automation/yaml-templates/install-global-tool.yaml@self parameters: toolName: boots version: $(BootsToolVersion) @@ -68,7 +68,7 @@ steps: - powershell: boots --stable Xamarin.Android displayName: install Xamarin.Android stable -- template: build-tools/automation/yaml-templates/run-xaprepare.yaml@self +- template: /build-tools/automation/yaml-templates/run-xaprepare.yaml@self parameters: arguments: --s=${{ parameters.xaprepareScenario }} --android-sdk-platforms="${{ parameters.androidSdkPlatforms }}" xaSourcePath: ${{ parameters.xaSourcePath }} @@ -98,13 +98,13 @@ steps: arguments: -t:ExtractWorkloadPacks -c ${{ parameters.configuration }} -v:n -bl:${{ parameters.xaSourcePath }}/bin/Test${{ parameters.configuration }}/extract-workloads.binlog - ${{ if eq(parameters.installApkDiff, true) }}: - - template: build-tools/automation/yaml-templates/install-global-tool.yaml@self + - template: /build-tools/automation/yaml-templates/install-global-tool.yaml@self parameters: toolName: apkdiff version: $(ApkDiffToolVersion) - ${{ if eq(parameters.installTestSlicer, true) }}: - - template: build-tools/automation/yaml-templates/install-global-tool.yaml@self + - template: /build-tools/automation/yaml-templates/install-global-tool.yaml@self parameters: toolName: dotnet-test-slicer version: $(TestSlicerToolVersion) diff --git a/build-tools/automation/yaml-templates/setup-ubuntu.yaml b/build-tools/automation/yaml-templates/setup-ubuntu.yaml index 067208b6401..6b7c4e34e94 100644 --- a/build-tools/automation/yaml-templates/setup-ubuntu.yaml +++ b/build-tools/automation/yaml-templates/setup-ubuntu.yaml @@ -13,7 +13,7 @@ steps: # sudo apt install -y --no-install-recommends mono-complete nuget msbuild # displayName: install mono preview -#- template: build-tools/automation/yaml-templates/use-dot-net.yaml@self +#- template: /build-tools/automation/yaml-templates/use-dot-net.yaml@self # parameters: # remove_dotnet: true diff --git a/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml b/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml index 37ff1735d98..805045f5bf9 100644 --- a/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml +++ b/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml @@ -31,7 +31,7 @@ stages: workspace: clean: all steps: - - template: build-tools/automation/yaml-templates/setup-test-environment.yaml@self + - template: /build-tools/automation/yaml-templates/setup-test-environment.yaml@self parameters: installTestSlicer: true installApkDiff: false @@ -47,12 +47,12 @@ stages: artifactName: $(TestAssembliesArtifactName) downloadPath: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration) - - template: build-tools/automation/yaml-templates/start-stop-emulator.yaml@self + - template: /build-tools/automation/yaml-templates/start-stop-emulator.yaml@self parameters: xaSourcePath: ${{ parameters.xaSourcePath }} startContinueOnError: ${{ parameters.emulatorStartContinueOnError }} - - template: build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml@self + - template: /build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml@self parameters: testAssembly: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration)/MSBuildDeviceIntegration/$(DotNetStableTargetFramework)/MSBuildDeviceIntegration.dll testFilter: $(ExcludedNightlyNUnitCategories) @@ -64,12 +64,12 @@ stages: command: stop xaSourcePath: ${{ parameters.xaSourcePath }} - - template: build-tools/automation/yaml-templates/upload-results.yaml@self + - template: /build-tools/automation/yaml-templates/upload-results.yaml@self parameters: artifactName: Test Results - MSBuild With Emulator - macOS-$(System.JobPositionInPhase) xaSourcePath: ${{ parameters.xaSourcePath }} - - template: build-tools/automation/yaml-templates/fail-on-issue.yaml@self + - template: /build-tools/automation/yaml-templates/fail-on-issue.yaml@self parameters: condition: ${{ parameters.shouldFailOnIssue }} @@ -90,7 +90,7 @@ stages: workspace: clean: all steps: - - template: build-tools/automation/yaml-templates/setup-test-environment.yaml@self + - template: /build-tools/automation/yaml-templates/setup-test-environment.yaml@self parameters: installTestSlicer: true installApkDiff: false @@ -104,7 +104,7 @@ stages: artifactName: $(TestAssembliesArtifactName) downloadPath: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration) - - template: build-tools/automation/yaml-templates/start-stop-emulator.yaml@self + - template: /build-tools/automation/yaml-templates/start-stop-emulator.yaml@self parameters: specificImage: true deviceName: $(deviceName) @@ -114,7 +114,7 @@ stages: xaSourcePath: ${{ parameters.xaSourcePath }} startContinueOnError: ${{ parameters.emulatorStartContinueOnError }} - - template: build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml@self + - template: /build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml@self parameters: testRunTitle: WearOS On Device - macOS testAssembly: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration)/MSBuildDeviceIntegration/$(DotNetStableTargetFramework)/MSBuildDeviceIntegration.dll @@ -122,7 +122,7 @@ stages: xaSourcePath: ${{ parameters.xaSourcePath }} - ${{ if ne(parameters.usesCleanImages, true) }}: - - template: build-tools/automation/yaml-templates/start-stop-emulator.yaml@self + - template: /build-tools/automation/yaml-templates/start-stop-emulator.yaml@self parameters: command: stop specificImage: true @@ -132,12 +132,12 @@ stages: avdType: $(avdType) xaSourcePath: ${{ parameters.xaSourcePath }} - - template: build-tools/automation/yaml-templates/upload-results.yaml@self + - template: /build-tools/automation/yaml-templates/upload-results.yaml@self parameters: configuration: $(XA.Build.Configuration) artifactName: Test Results - Emulator $(avdApiLevel)-$(avdAbi)-$(avdType) - macOS xaSourcePath: ${{ parameters.xaSourcePath }} - - template: build-tools/automation/yaml-templates/fail-on-issue.yaml@self + - template: /build-tools/automation/yaml-templates/fail-on-issue.yaml@self parameters: condition: ${{ parameters.shouldFailOnIssue }} diff --git a/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml b/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml index 04e74493290..a9eff7fb75a 100644 --- a/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml +++ b/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml @@ -16,7 +16,7 @@ stages: dependsOn: ${{ parameters.dependsOn }} condition: ${{ parameters.stageCondition }} jobs: - - template: build-tools/automation/yaml-templates/run-msbuild-tests.yaml@self + - template: /build-tools/automation/yaml-templates/run-msbuild-tests.yaml@self parameters: testOS: macOS jobName: mac_msbuild_tests @@ -27,7 +27,7 @@ stages: commit: ${{ parameters.commit }} shouldFailOnIssue: ${{ parameters.shouldFailOnIssue }} - - template: build-tools/automation/yaml-templates/run-msbuild-tests.yaml@self + - template: /build-tools/automation/yaml-templates/run-msbuild-tests.yaml@self parameters: testOS: Windows jobName: win_msbuild_tests diff --git a/build-tools/automation/yaml-templates/upload-results.yaml b/build-tools/automation/yaml-templates/upload-results.yaml index a1313928cdb..48330ea8ffc 100644 --- a/build-tools/automation/yaml-templates/upload-results.yaml +++ b/build-tools/automation/yaml-templates/upload-results.yaml @@ -6,7 +6,7 @@ parameters: condition: or(ne(variables['Agent.JobStatus'], 'Succeeded'), eq(variables['XA.PublishAllLogs'], 'true')) steps: -- template: build-tools/automation/yaml-templates/run-xaprepare.yaml@self +- template: /build-tools/automation/yaml-templates/run-xaprepare.yaml@self parameters: configuration: ${{ parameters.configuration }} arguments: --s=CopyExtraResultFilesForCI --verbosity v @@ -15,7 +15,7 @@ steps: condition: ${{ parameters.condition }} - ${{ if eq(parameters.includeBuildResults, false) }}: - - template: build-tools/automation/yaml-templates/publish-artifact.yaml@self + - template: /build-tools/automation/yaml-templates/publish-artifact.yaml@self parameters: displayName: upload test results artifactName: ${{ parameters.artifactName }} @@ -30,7 +30,7 @@ steps: targetFolder: $(Build.StagingDirectory)/Test${{ parameters.configuration }}/Build${{ parameters.configuration }} condition: ${{ parameters.condition }} - - template: build-tools/automation/yaml-templates/publish-artifact.yaml@self + - template: /build-tools/automation/yaml-templates/publish-artifact.yaml@self parameters: displayName: upload build and test results artifactName: ${{ parameters.artifactName }} From a5818bd52bce21d0c5e7639fafd49b1e11a0e266 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Wed, 21 Feb 2024 11:50:01 -0800 Subject: [PATCH 05/36] Use 1es publish for linux build --- build-tools/automation/yaml-templates/build-linux.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/automation/yaml-templates/build-linux.yaml b/build-tools/automation/yaml-templates/build-linux.yaml index 30b2f3fd981..48e25615666 100644 --- a/build-tools/automation/yaml-templates/build-linux.yaml +++ b/build-tools/automation/yaml-templates/build-linux.yaml @@ -83,7 +83,7 @@ stages: workingDirectory: $(System.DefaultWorkingDirectory)/xamarin-android displayName: copy linux sdk - - task: PublishPipelineArtifact@1 + - task: 1ES.PublishPipelineArtifact@1 displayName: upload linux sdk inputs: artifactName: ${{ parameters.nugetArtifactName }} From 743635c86159fd55e97c4efa195d3b3cf602434d Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Wed, 21 Feb 2024 12:16:16 -0800 Subject: [PATCH 06/36] Pass use1ESTemplate=true to all signing jobs --- build-tools/automation/azure-pipelines.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 0ec0710c20a..26ebdd9546d 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -29,11 +29,6 @@ resources: type: github name: xamarin/monodroid endpoint: xamarin - - repository: release_scripts - type: github - name: xamarin/release-scripts - ref: refs/heads/sign-and-notarized - endpoint: xamarin - repository: maui type: github name: dotnet/maui @@ -476,6 +471,7 @@ extends: signType: $(MicroBuildSignType) signedArtifactName: nuget-signed usePipelineArtifactTasks: true + use1ESTemplate: true # Check - "Xamarin.Android (Prepare .NET Release Sign Linux Archive)" - template: sign-artifacts/jobs/v2.yml@yaml-templates From 0c3d9f21173eded21b9e723c077149fecef452c3 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Wed, 21 Feb 2024 12:24:51 -0800 Subject: [PATCH 07/36] Use 'output: nuget' instead of NuGetCommand@2 --- build-tools/automation/azure-pipelines.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 26ebdd9546d..deadd2d3086 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -527,6 +527,15 @@ extends: variables: - ${{ if eq(variables['MicroBuildSignType'], 'Real') }}: - group: Publish-Build-Assets + templateContext: + outputs: + - output: nuget + condition: and(succeeded(), eq(variables['PushXAPackages'], 'true')) + useDotNetTask: false # The default is false to use the NuGetCommand task. Set to true to use the DotNetCoreCLI task to publish packages. + packagesToPush: $(Build.StagingDirectory)\nuget-signed\*.nupkg + packageParentPath: $(Build.StagingDirectory)\nuget-signed + nuGetFeedType: external + publishFeedCredentials: $(DotNetFeedCredential) steps: - checkout: self @@ -550,15 +559,6 @@ extends: artifactName: $(WindowsToolchainPdbArtifactName) downloadPath: $(Build.StagingDirectory)\nuget-signed - - task: NuGetCommand@2 - displayName: push nupkgs - inputs: - command: push - packagesToPush: $(Build.StagingDirectory)\nuget-signed\*.nupkg - nuGetFeedType: external - publishFeedCredentials: $(DotNetFeedCredential) - condition: and(succeeded(), eq(variables['PushXAPackages'], 'true')) - - template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions parameters: githubToken: $(GitHub.Token) From c2dce755d14ee30727f8c3084a509a5e642a0880 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Wed, 21 Feb 2024 12:31:12 -0800 Subject: [PATCH 08/36] Update sdl repos to scan --- build-tools/automation/azure-pipelines.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index deadd2d3086..845c7471e20 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -87,6 +87,12 @@ extends: name: AzurePipelines-EO image: $(WindowsPoolImage1ESPT) os: windows + sourceRepositoriesToScan: + include: + - repository: monodroid + exclude: + - repository: yaml-templates + - repository: maui # Stage and Job "display names" are shortened because they are combined to form the name of the corresponding GitHub check. stages: - template: /build-tools/automation/yaml-templates/build-macos.yaml@self From ebe16bf2edd5d8ea506c4dac38b6414d90c1ef8b Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Wed, 21 Feb 2024 12:42:23 -0800 Subject: [PATCH 09/36] Update pools --- build-tools/automation/azure-pipelines.yaml | 4 +++- .../automation/yaml-templates/build-linux.yaml | 2 +- .../automation/yaml-templates/build-macos.yaml | 12 ++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 845c7471e20..aee188a98f8 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -265,7 +265,9 @@ extends: - job: linux_tests_smoke displayName: Linux > Tests > MSBuild pool: - name: android-devdiv-ubuntu-vmss-pr + name: AzurePipelines-EO + image: $(LinuxPoolImage1ESPT) + os: linux timeoutInMinutes: 180 workspace: clean: all diff --git a/build-tools/automation/yaml-templates/build-linux.yaml b/build-tools/automation/yaml-templates/build-linux.yaml index 48e25615666..b44d3c8894a 100644 --- a/build-tools/automation/yaml-templates/build-linux.yaml +++ b/build-tools/automation/yaml-templates/build-linux.yaml @@ -23,7 +23,7 @@ stages: displayName: ${{ parameters.jobDisplayName }} pool: name: AzurePipelines-EO - vmImage: $(LinuxPoolImage1ESPT) + image: $(LinuxPoolImage1ESPT) os: linux timeoutInMinutes: 180 workspace: diff --git a/build-tools/automation/yaml-templates/build-macos.yaml b/build-tools/automation/yaml-templates/build-macos.yaml index e732ef0f46b..7a3d890d24d 100644 --- a/build-tools/automation/yaml-templates/build-macos.yaml +++ b/build-tools/automation/yaml-templates/build-macos.yaml @@ -26,11 +26,15 @@ stages: - job: ${{ parameters.jobName }} displayName: ${{ parameters.jobDisplayName }} pool: - name: $(MacBuildPoolName) - vmImage: $(MacBuildPoolImage) + name: Azure Pipelines + vmImage: $(HostedMacImage) os: macOS - ${{ if ne(variables['MicroBuildSignType'], 'Real') }}: - demands: macOS.Name -equals Monterey + #pool: + # name: $(MacBuildPoolName) + # vmImage: $(MacBuildPoolImage) + # os: macOS + # ${{ if ne(variables['MicroBuildSignType'], 'Real') }}: + # demands: macOS.Name -equals Monterey timeoutInMinutes: 240 cancelTimeoutInMinutes: 5 workspace: From dabedabf8ca218781e2b2cb6cab94ec206934e57 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Wed, 21 Feb 2024 15:14:07 -0800 Subject: [PATCH 10/36] Fixing pools, guardian suppressions --- .gdn/.gdnsettings | 7 + .gdn/.gdnsuppress | 395 ++++++++++++++++++ .gdn/.gitignore | 11 + build-tools/automation/azure-pipelines.yaml | 18 +- .../guardian/CredScanSuppressions.json | 41 -- .../automation/guardian/source.gdnsuppress | 250 ----------- .../yaml-templates/build-linux.yaml | 2 +- .../yaml-templates/build-windows.yaml | 2 +- .../yaml-templates/run-msbuild-tests.yaml | 9 +- .../stage-msbuild-emulator-tests.yaml | 4 + 10 files changed, 438 insertions(+), 301 deletions(-) create mode 100644 .gdn/.gdnsettings create mode 100644 .gdn/.gdnsuppress create mode 100644 .gdn/.gitignore delete mode 100644 build-tools/automation/guardian/CredScanSuppressions.json delete mode 100644 build-tools/automation/guardian/source.gdnsuppress diff --git a/.gdn/.gdnsettings b/.gdn/.gdnsettings new file mode 100644 index 00000000000..9ebd4133b35 --- /dev/null +++ b/.gdn/.gdnsettings @@ -0,0 +1,7 @@ +{ + "files": { }, + "folders": { }, + "overwriteLogs": true, + "telemetryFlushTimeout": 10, + "variables": { } +} diff --git a/.gdn/.gdnsuppress b/.gdn/.gdnsuppress new file mode 100644 index 00000000000..602c113c219 --- /dev/null +++ b/.gdn/.gdnsuppress @@ -0,0 +1,395 @@ +{ + "hydrated": false, + "properties": { + "helpUri": "https://eng.ms/docs/microsoft-security/security/azure-security/cloudai-security-fundamentals-engineering/security-integration/guardian-wiki/microsoft-guardian/general/suppressions", + "hydrationStatus": "This file does not contain identifying data. It is safe to check into your repo. To hydrate this file with identifying data, run `guardian hydrate --help` and follow the guidance." + }, + "version": "1.0.0", + "suppressionSets": { + "default": { + "name": "default", + "createdDate": "2023-02-22 23:55:29Z", + "lastUpdatedDate": "2024-02-21 20:58:02Z" + } + }, + "results": { + "97699b24b70c14e4857a1744533bacead40c1d999f4500d859f5d46d6799f953": { + "signature": "97699b24b70c14e4857a1744533bacead40c1d999f4500d859f5d46d6799f953", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Ionic.Zip API documentation with generic example password.", + "createdDate": "2024-02-21 20:57:50Z" + }, + "f03baf4c9d82f32a33f1c6124f648e4ebfcd92f2db349e28e98d1363e9d171b2": { + "signature": "f03baf4c9d82f32a33f1c6124f648e4ebfcd92f2db349e28e98d1363e9d171b2", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Ionic.Zip API documentation with generic example password.", + "createdDate": "2024-02-21 20:57:50Z" + }, + "42ec4c4af1860770023359ca62028bd2b090f78c5272ec226c4d91aa552fa2df": { + "signature": "42ec4c4af1860770023359ca62028bd2b090f78c5272ec226c4d91aa552fa2df", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Ionic.Zip API documentation with generic example password.", + "createdDate": "2024-02-21 20:57:50Z" + }, + "bf2d49450b2d6a960fa4092ef4431ccb88dc2b49fbf11c5241210d2690a26e94": { + "signature": "bf2d49450b2d6a960fa4092ef4431ccb88dc2b49fbf11c5241210d2690a26e94", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Ionic.Zip API documentation with generic example password.", + "createdDate": "2024-02-21 20:57:50Z" + }, + "5e87237daa293a5a8fb787852eec77320bf175950973cda2f3d254792594cf89": { + "signature": "5e87237daa293a5a8fb787852eec77320bf175950973cda2f3d254792594cf89", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Ionic.Zip API documentation with generic example password.", + "createdDate": "2024-02-21 20:57:50Z" + }, + "69fc8b0dd9a9068feec650279c5b10f01b52a09300d93792e64199864992cc0a": { + "signature": "69fc8b0dd9a9068feec650279c5b10f01b52a09300d93792e64199864992cc0a", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Ionic.Zip API documentation with generic example password.", + "createdDate": "2024-02-21 20:57:50Z" + }, + "5440d292f0e20c316e8279265dd14ba16492d3f438c2652b78bfe42b56f3ebe1": { + "signature": "5440d292f0e20c316e8279265dd14ba16492d3f438c2652b78bfe42b56f3ebe1", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Ionic.Zip API documentation with generic example password.", + "createdDate": "2024-02-21 20:57:50Z" + }, + "4093b2ad3dec514395d2f2de413b890b02098b67656c02c610c8d447918b9e3c": { + "signature": "4093b2ad3dec514395d2f2de413b890b02098b67656c02c610c8d447918b9e3c", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Ionic.Zip API documentation with generic example password.", + "createdDate": "2024-02-21 20:57:50Z" + }, + "cdf0c9dfadcc6b8dc6f52439eedc5bad9cb96b0814749eb139d65acfd5fc7cda": { + "signature": "cdf0c9dfadcc6b8dc6f52439eedc5bad9cb96b0814749eb139d65acfd5fc7cda", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Ionic.Zip API documentation with generic example password.", + "createdDate": "2024-02-21 20:57:50Z" + }, + "bb1319f066c1fef6722134892543eaef862800d15ada0fbc3ea16ccf7e412fff": { + "signature": "bb1319f066c1fef6722134892543eaef862800d15ada0fbc3ea16ccf7e412fff", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Ionic.Zip API documentation with generic example password.", + "createdDate": "2024-02-21 20:57:50Z" + }, + "1a1fc34f0b4f480cad2e9e39e27dec9cbcd5bc2d49c2785ac2a016fa75fcaee0": { + "signature": "1a1fc34f0b4f480cad2e9e39e27dec9cbcd5bc2d49c2785ac2a016fa75fcaee0", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Ionic.Zip API documentation with generic example password.", + "createdDate": "2024-02-21 20:57:50Z" + }, + "fa26064b5b8bc8af4e359c62f6b2a21d58c46ef8b5dcff6bf4ebf609d3d6004f": { + "signature": "fa26064b5b8bc8af4e359c62f6b2a21d58c46ef8b5dcff6bf4ebf609d3d6004f", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Ionic.Zip API documentation with generic example password.", + "createdDate": "2024-02-21 20:57:50Z" + }, + "3160f73c36ac035609563087313b44bb1e47bd811e55db4ae6f72541263fd315": { + "signature": "3160f73c36ac035609563087313b44bb1e47bd811e55db4ae6f72541263fd315", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Ionic.Zip API documentation with generic example password.", + "createdDate": "2024-02-21 20:57:50Z" + }, + "d9b3620b9eb0e0ba436abc25ca81845d6df2d7284015c2b139e0c584bea3d470": { + "signature": "d9b3620b9eb0e0ba436abc25ca81845d6df2d7284015c2b139e0c584bea3d470", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Ionic.Zip API documentation with generic example password.", + "createdDate": "2024-02-21 20:57:50Z" + }, + "61adc9c3537513142847443779d278efec47594468a219fff28342768744d94b": { + "signature": "61adc9c3537513142847443779d278efec47594468a219fff28342768744d94b", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Ionic.Zip API documentation with generic example password.", + "createdDate": "2024-02-21 20:57:50Z" + }, + "faf422860921d179b62d537fc81b1d99f4ff4b75243939dc153e78f21a9b8211": { + "signature": "faf422860921d179b62d537fc81b1d99f4ff4b75243939dc153e78f21a9b8211", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Ionic.Zip API documentation with generic example password.", + "createdDate": "2024-02-21 20:57:50Z" + }, + "a7e7ea7c2ae0b67e14969a5ff466fc27450988d81f8a21ef958798a46b53c0bd": { + "signature": "a7e7ea7c2ae0b67e14969a5ff466fc27450988d81f8a21ef958798a46b53c0bd", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Ionic.Zip API documentation with generic example password.", + "createdDate": "2024-02-21 20:57:50Z" + }, + "fa16145869148c36ac91a535ab4acb35d5442377f46b1c84f2970dee354208fb": { + "signature": "fa16145869148c36ac91a535ab4acb35d5442377f46b1c84f2970dee354208fb", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Dummy UnitTest.keystore file used for testing.", + "createdDate": "2024-02-21 20:57:50Z" + }, + "2fa9a7d39500379442bc21bc0ee41b9ba9a6316bbb0bf87478a8abf6d9b52ded": { + "signature": "2fa9a7d39500379442bc21bc0ee41b9ba9a6316bbb0bf87478a8abf6d9b52ded", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Dummy test.keystore file used for testing.", + "createdDate": "2024-02-21 20:57:50Z" + }, + "bc654b0dca486b80c22e3e0ca2a8246bbad14d7be3db71fbaaa8ba0f2c194f73": { + "signature": "bc654b0dca486b80c22e3e0ca2a8246bbad14d7be3db71fbaaa8ba0f2c194f73", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Dummy test.keystore file used for testing.", + "createdDate": "2024-02-21 20:57:50Z" + }, + "5a0a8690d8a06dfdbf6002c67fa64a60a94f3fc77a594034cce20382e88002aa": { + "signature": "5a0a8690d8a06dfdbf6002c67fa64a60a94f3fc77a594034cce20382e88002aa", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Reference to an external source file.", + "createdDate": "2023-02-22 23:55:29Z" + }, + "1b319055b8e507b220d0dab341e67e20f49632fd1844a08a4fcc6d4493930ac5": { + "signature": "1b319055b8e507b220d0dab341e67e20f49632fd1844a08a4fcc6d4493930ac5", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Reference to an external source file.", + "createdDate": "2023-02-22 23:55:29Z" + }, + "6789cab1bdc97b0cc3ad057b7fdd21d63cdf8bc2679391923803fa240ef81292": { + "signature": "6789cab1bdc97b0cc3ad057b7fdd21d63cdf8bc2679391923803fa240ef81292", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Reference to an ISCII term.", + "createdDate": "2023-02-22 23:55:29Z" + }, + "bbaf5f946cb72748567e41f0df5f1bae05550f4ba7381e21ec6b26d6c3ecec9f": { + "signature": "bbaf5f946cb72748567e41f0df5f1bae05550f4ba7381e21ec6b26d6c3ecec9f", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Reference to an ISCII term.", + "createdDate": "2023-02-22 23:55:29Z" + }, + "db8916a0f0cdca4082c540921dd362e09a9ff413862ab826308411b76ee35789": { + "signature": "db8916a0f0cdca4082c540921dd362e09a9ff413862ab826308411b76ee35789", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Reference to an Android logging function.", + "createdDate": "2023-02-22 23:55:29Z" + }, + "6d1fb3a483eb491710d6a09ed0b4bab47f13942d0c6fc744e6683614a66604ab": { + "signature": "6d1fb3a483eb491710d6a09ed0b4bab47f13942d0c6fc744e6683614a66604ab", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Reference to an Android logging function.", + "createdDate": "2023-02-22 23:55:29Z" + }, + "b07e75fc8a506b94690dbd06877da06c1228e40e7deda3967f6b882b842f726d": { + "signature": "b07e75fc8a506b94690dbd06877da06c1228e40e7deda3967f6b882b842f726d", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Reference to an Android logging function.", + "createdDate": "2023-02-22 23:55:29Z" + }, + "87d8313310c2dd42021844b95bdcb9121bf10036fea5b212b945e0732a456e5a": { + "signature": "87d8313310c2dd42021844b95bdcb9121bf10036fea5b212b945e0732a456e5a", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Reference to an Android logging function.", + "createdDate": "2023-02-22 23:55:29Z" + }, + "8e5400e0233c8d887ad48bd8a48e8a7be5a579f9eefad521419b6df0828bbfac": { + "signature": "8e5400e0233c8d887ad48bd8a48e8a7be5a579f9eefad521419b6df0828bbfac", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Reference to an Android logging function.", + "createdDate": "2023-02-22 23:55:29Z" + }, + "1b38e026fae90da4ae2fe9151c9c1ebd73c8b3c2c5f072ceae390a3ceec2fb97": { + "signature": "1b38e026fae90da4ae2fe9151c9c1ebd73c8b3c2c5f072ceae390a3ceec2fb97", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Reference to an Android logging function.", + "createdDate": "2023-02-22 23:55:29Z" + }, + "a2b4d032c59a9d1211d218c3cd550cf8febb369941d70284d07d03ebee855bc0": { + "signature": "a2b4d032c59a9d1211d218c3cd550cf8febb369941d70284d07d03ebee855bc0", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Reference to find first set bit function.", + "createdDate": "2023-02-22 23:55:29Z" + }, + "1c87b45a6044d205dc3f3562f349c238f7cabe22b4609da762df9dc44151e9fb": { + "signature": "1c87b45a6044d205dc3f3562f349c238f7cabe22b4609da762df9dc44151e9fb", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Reference to find first set bit function.", + "createdDate": "2023-02-22 23:55:29Z" + }, + "a6639098c4785509a4215c9e2fc10f82c06fce461915dc11a00227ddec558845": { + "signature": "a6639098c4785509a4215c9e2fc10f82c06fce461915dc11a00227ddec558845", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Reference to find first set bit function.", + "createdDate": "2023-02-22 23:55:29Z" + }, + "d6b3df0b1d35cb4acec6a954acc145c9ec22041cd463b94ff080682c65a9bd62": { + "signature": "d6b3df0b1d35cb4acec6a954acc145c9ec22041cd463b94ff080682c65a9bd62", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Reference to find first set bit function.", + "createdDate": "2023-02-22 23:55:29Z" + }, + "b34b42aa41018376a31460c142f2ae910704725d9e9a4470f92b587df682369b": { + "signature": "b34b42aa41018376a31460c142f2ae910704725d9e9a4470f92b587df682369b", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Reference to output from an external tool.", + "createdDate": "2023-02-22 23:55:29Z" + }, + "75474fa652dbbf8f96826100a5fe37ba686a032ca07d61ef68a79c8e4412c150": { + "signature": "75474fa652dbbf8f96826100a5fe37ba686a032ca07d61ef68a79c8e4412c150", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Reference to an external source file.", + "createdDate": "2023-02-22 23:55:29Z" + }, + "243e199c7aec22377e0363bdca82384278cc36b0674f35697935fde6c45cfd0e": { + "signature": "243e199c7aec22377e0363bdca82384278cc36b0674f35697935fde6c45cfd0e", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Reference to a proper name.", + "createdDate": "2023-10-26 21:20:54Z" + }, + "28e1a7a1157c8739dce8ac1bbd828a471e477444ec50d2656d0440948b58a274": { + "signature": "28e1a7a1157c8739dce8ac1bbd828a471e477444ec50d2656d0440948b58a274", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "FillEventHistory+Event API documentation with generic example password.", + "createdDate": "2024-02-21 20:58:02Z" + }, + "0b7cc0b28f27b0eeb2a415f10e62c32675dd2d4edcffe35600eae35f8064004e": { + "signature": "0b7cc0b28f27b0eeb2a415f10e62c32675dd2d4edcffe35600eae35f8064004e", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Android.Service.Autofill.FillEventHistory+Event API documentation with generic example password.", + "createdDate": "2024-02-21 20:58:02Z" + }, + "e57727a14a28f6fd8f4aa87cd3c4b33401dfea1078ce32fb3cbdf342e8adf63d": { + "signature": "e57727a14a28f6fd8f4aa87cd3c4b33401dfea1078ce32fb3cbdf342e8adf63d", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Javax.Crypto.ISecretKey API documentation with generic example password.", + "createdDate": "2024-02-21 20:58:02Z" + }, + "15c51590a2e2bb503a7277448e05357f5fd8d4cb2f9b9b7446e41c872cceaac4": { + "signature": "15c51590a2e2bb503a7277448e05357f5fd8d4cb2f9b9b7446e41c872cceaac4", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Javax.Security.Auth.Callback.PasswordCallback API documentation with generic example password.", + "createdDate": "2024-02-21 20:58:02Z" + }, + "1ccf925aa704efd1035bac38e94d2e629fb5b0d1784d5473e4a52e6d13db16ee": { + "signature": "1ccf925aa704efd1035bac38e94d2e629fb5b0d1784d5473e4a52e6d13db16ee", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Dummy test.keystore file used for testing.", + "createdDate": "2024-02-21 20:58:02Z" + } + } +} diff --git a/.gdn/.gitignore b/.gdn/.gitignore new file mode 100644 index 00000000000..de1a20ab6d5 --- /dev/null +++ b/.gdn/.gitignore @@ -0,0 +1,11 @@ +## Ignore Guardian internal files +.r/ +rc/ +rs/ +i/ +p/ +c/ +o/ + +## Ignore Guardian Local settings +LocalSettings.gdn.json diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index aee188a98f8..263bd6b99c3 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -71,10 +71,11 @@ variables: value: true extends: - ${{ if eq(variables['MicroBuildSignType'], 'Real') }}: - template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines - ${{ else }}: - template: v1/1ES.Unofficial.PipelineTemplate.yml@1esPipelines + template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines + #${{ if eq(variables['MicroBuildSignType'], 'Real') }}: + # template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines + #${{ else }}: + # template: v1/1ES.Unofficial.PipelineTemplate.yml@1esPipelines parameters: sdl: ${{ if eq('${{ parameters.Skip1ESComplianceTasks }}', 'true') }}: @@ -82,7 +83,7 @@ extends: codeql: runSourceLanguagesInSourceAnalysis: true suppression: - suppressionFile: $(Build.SourcesDirectory)\build-tools\automation\guardian\source.gdnsuppress + suppressionFile: $(Build.SourcesDirectory)\.gdn\.gdnsuppress sourceAnalysisPool: name: AzurePipelines-EO image: $(WindowsPoolImage1ESPT) @@ -110,7 +111,9 @@ extends: - job: mac_apk_tests_net displayName: macOS > Tests > APKs .NET pool: + name: Azure Pipelines vmImage: $(HostedMacImage) + os: macOS timeoutInMinutes: 180 workspace: clean: all @@ -336,7 +339,10 @@ extends: # Check - "Xamarin.Android (MAUI Tests MAUI Integration)" - job: maui_tests_integration displayName: MAUI Integration - pool: $(1ESWindowsPool) + pool: + name: AzurePipelines-EO + image: $(WindowsPoolImage1ESPT) + os: windows timeoutInMinutes: 180 workspace: clean: all diff --git a/build-tools/automation/guardian/CredScanSuppressions.json b/build-tools/automation/guardian/CredScanSuppressions.json deleted file mode 100644 index d484f12ded2..00000000000 --- a/build-tools/automation/guardian/CredScanSuppressions.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "tool": "Credential Scanner", - "suppressions": [ - { - "file": "\\src\\Xamarin.Android.Build.Tasks\\Tests\\Xamarin.ProjectTools\\Resources\\Base\\test.keystore", - "_justification": "Dummy keystore file used for testing." - }, - { - "file": "tests\\MSBuildDeviceIntegration\\Tests\\InstallTests.cs", - "_justification": "Password of the dummy keystore file used only for testing." - }, - { - "file": "external\\android-api-docs\\docs\\Mono.Android\\en\\Android.Webkit\\HttpAuthHandler.xml", - "_justification": "Android API documentation, does not contain a password." - }, - { - "file": "external\\android-api-docs\\docs\\Mono.Android\\en\\Android.Webkit\\WebViewDatabase.xml", - "_justification": "Android API documentation, does not contain a password." - }, - { - "file": "external\\android-api-docs\\docs\\Mono.Android\\en\\Java.Security\\KeyStore+PasswordProtection.xml", - "_justification": "Android API documentation, does not contain a password." - }, - { - "file": "external\\android-api-docs\\docs\\Mono.Android\\en\\Javax.Security.Auth.Callback\\PasswordCallback.xml", - "_justification": "Android API documentation, does not contain a password." - }, - { - "file": "external\\android-api-docs\\docs\\Mono.Android\\en\\Javax.Crypto\\ISecretKey.xml", - "_justification": "Android API documentation, does not contain a password." - }, - { - "file": "external\\android-api-docs\\docs\\Mono.Android\\en\\Javax.Crypto\\KeyAgreementSpi.xml", - "_justification": "Android API documentation, does not contain a password." - }, - { - "file": "external\\android-api-docs\\docs\\Mono.Android\\en\\Javax.Crypto.Interfaces\\IPBEKey.xml", - "_justification": "Android API documentation, does not contain a password." - } - ] -} diff --git a/build-tools/automation/guardian/source.gdnsuppress b/build-tools/automation/guardian/source.gdnsuppress deleted file mode 100644 index d0a4455d7c6..00000000000 --- a/build-tools/automation/guardian/source.gdnsuppress +++ /dev/null @@ -1,250 +0,0 @@ -{ - "version": "latest", - "suppressionSets": { - "default": { - "name": "default", - "createdDate": "2023-02-22 23:55:29Z", - "lastUpdatedDate": "2023-05-04 13:54:18Z" - } - }, - "results": { - "5a0a8690d8a06dfdbf6002c67fa64a60a94f3fc77a594034cce20382e88002aa": { - "signature": "5a0a8690d8a06dfdbf6002c67fa64a60a94f3fc77a594034cce20382e88002aa", - "alternativeSignatures": [], - "target": "src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj", - "memberOf": [ - "default" - ], - "tool": "policheck", - "ruleId": "79459", - "justification": "Reference to an external source file.", - "createdDate": "2023-02-22 23:55:29Z", - "expirationDate": null, - "type": null - }, - "1b319055b8e507b220d0dab341e67e20f49632fd1844a08a4fcc6d4493930ac5": { - "signature": "1b319055b8e507b220d0dab341e67e20f49632fd1844a08a4fcc6d4493930ac5", - "alternativeSignatures": [], - "target": "src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj", - "memberOf": [ - "default" - ], - "tool": "policheck", - "ruleId": "79459", - "justification": "Reference to an external source file.", - "createdDate": "2023-02-22 23:55:29Z", - "expirationDate": null, - "type": null - }, - "6789cab1bdc97b0cc3ad057b7fdd21d63cdf8bc2679391923803fa240ef81292": { - "signature": "6789cab1bdc97b0cc3ad057b7fdd21d63cdf8bc2679391923803fa240ef81292", - "alternativeSignatures": [], - "target": "Documentation/guides/building-apps/build-properties.md", - "memberOf": [ - "default" - ], - "tool": "policheck", - "ruleId": "185843", - "justification": "Reference to an ISCII term.", - "createdDate": "2023-02-22 23:55:29Z", - "expirationDate": null, - "type": null - }, - "bbaf5f946cb72748567e41f0df5f1bae05550f4ba7381e21ec6b26d6c3ecec9f": { - "signature": "bbaf5f946cb72748567e41f0df5f1bae05550f4ba7381e21ec6b26d6c3ecec9f", - "alternativeSignatures": [], - "target": "Documentation/guides/building-apps/build-properties.md", - "memberOf": [ - "default" - ], - "tool": "policheck", - "ruleId": "185837", - "justification": "Reference to an ISCII term.", - "createdDate": "2023-02-22 23:55:29Z", - "expirationDate": null, - "type": null - }, - "db8916a0f0cdca4082c540921dd362e09a9ff413862ab826308411b76ee35789": { - "signature": "db8916a0f0cdca4082c540921dd362e09a9ff413862ab826308411b76ee35789", - "alternativeSignatures": [], - "target": "src/Mono.Android/Android.Util/Log.cs", - "memberOf": [ - "default" - ], - "tool": "policheck", - "ruleId": "80418", - "justification": "Reference to an Android logging function.", - "createdDate": "2023-02-22 23:55:29Z", - "expirationDate": null, - "type": null - }, - "6d1fb3a483eb491710d6a09ed0b4bab47f13942d0c6fc744e6683614a66604ab": { - "signature": "6d1fb3a483eb491710d6a09ed0b4bab47f13942d0c6fc744e6683614a66604ab", - "alternativeSignatures": [], - "target": "src/Mono.Android/Android.Util/Log.cs", - "memberOf": [ - "default" - ], - "tool": "policheck", - "ruleId": "80418", - "justification": "Reference to an Android logging function.", - "createdDate": "2023-02-22 23:55:29Z", - "expirationDate": null, - "type": null - }, - "b07e75fc8a506b94690dbd06877da06c1228e40e7deda3967f6b882b842f726d": { - "signature": "b07e75fc8a506b94690dbd06877da06c1228e40e7deda3967f6b882b842f726d", - "alternativeSignatures": [], - "target": "src/Mono.Android/Android.Util/Log.cs", - "memberOf": [ - "default" - ], - "tool": "policheck", - "ruleId": "80418", - "justification": "Reference to an Android logging function.", - "createdDate": "2023-02-22 23:55:29Z", - "expirationDate": null, - "type": null - }, - "87d8313310c2dd42021844b95bdcb9121bf10036fea5b212b945e0732a456e5a": { - "signature": "87d8313310c2dd42021844b95bdcb9121bf10036fea5b212b945e0732a456e5a", - "alternativeSignatures": [], - "target": "src/Mono.Android/Android.Util/Log.cs", - "memberOf": [ - "default" - ], - "tool": "policheck", - "ruleId": "80418", - "justification": "Reference to an Android logging function.", - "createdDate": "2023-02-22 23:55:29Z", - "expirationDate": null, - "type": null - }, - "8e5400e0233c8d887ad48bd8a48e8a7be5a579f9eefad521419b6df0828bbfac": { - "signature": "8e5400e0233c8d887ad48bd8a48e8a7be5a579f9eefad521419b6df0828bbfac", - "alternativeSignatures": [], - "target": "src/Mono.Android/Android.Util/Log.cs", - "memberOf": [ - "default" - ], - "tool": "policheck", - "ruleId": "80418", - "justification": "Reference to an Android logging function.", - "createdDate": "2023-02-22 23:55:29Z", - "expirationDate": null, - "type": null - }, - "1b38e026fae90da4ae2fe9151c9c1ebd73c8b3c2c5f072ceae390a3ceec2fb97": { - "signature": "1b38e026fae90da4ae2fe9151c9c1ebd73c8b3c2c5f072ceae390a3ceec2fb97", - "alternativeSignatures": [], - "target": "src/Mono.Android/Android.Util/Log.cs", - "memberOf": [ - "default" - ], - "tool": "policheck", - "ruleId": "80418", - "justification": "Reference to an Android logging function.", - "createdDate": "2023-02-22 23:55:29Z", - "expirationDate": null, - "type": null - }, - "a2b4d032c59a9d1211d218c3cd550cf8febb369941d70284d07d03ebee855bc0": { - "signature": "a2b4d032c59a9d1211d218c3cd550cf8febb369941d70284d07d03ebee855bc0", - "alternativeSignatures": [], - "target": "src/monodroid/jni/logger.cc", - "memberOf": [ - "default" - ], - "tool": "policheck", - "ruleId": "79668", - "justification": "Reference to find first set bit function.", - "createdDate": "2023-02-22 23:55:29Z", - "expirationDate": null, - "type": null - }, - "1c87b45a6044d205dc3f3562f349c238f7cabe22b4609da762df9dc44151e9fb": { - "signature": "1c87b45a6044d205dc3f3562f349c238f7cabe22b4609da762df9dc44151e9fb", - "alternativeSignatures": [], - "target": "src/monodroid/jni/logger.cc", - "memberOf": [ - "default" - ], - "tool": "policheck", - "ruleId": "79668", - "justification": "Reference to find first set bit function.", - "createdDate": "2023-02-22 23:55:29Z", - "expirationDate": null, - "type": null - }, - "a6639098c4785509a4215c9e2fc10f82c06fce461915dc11a00227ddec558845": { - "signature": "a6639098c4785509a4215c9e2fc10f82c06fce461915dc11a00227ddec558845", - "alternativeSignatures": [], - "target": "src/monodroid/jni/logger.cc", - "memberOf": [ - "default" - ], - "tool": "policheck", - "ruleId": "79668", - "justification": "Reference to find first set bit function.", - "createdDate": "2023-02-22 23:55:29Z", - "expirationDate": null, - "type": null - }, - "d6b3df0b1d35cb4acec6a954acc145c9ec22041cd463b94ff080682c65a9bd62": { - "signature": "d6b3df0b1d35cb4acec6a954acc145c9ec22041cd463b94ff080682c65a9bd62", - "alternativeSignatures": [], - "target": "src/monodroid/jni/logger.cc", - "memberOf": [ - "default" - ], - "tool": "policheck", - "ruleId": "79668", - "justification": "Reference to find first set bit function.", - "createdDate": "2023-02-22 23:55:29Z", - "expirationDate": null, - "type": null - }, - "b34b42aa41018376a31460c142f2ae910704725d9e9a4470f92b587df682369b": { - "signature": "b34b42aa41018376a31460c142f2ae910704725d9e9a4470f92b587df682369b", - "alternativeSignatures": [], - "target": "src/Xamarin.Android.Build.Tasks/Tasks/Aapt2.cs", - "memberOf": [ - "default" - ], - "tool": "policheck", - "ruleId": "80411", - "justification": "Reference to output from an external tool.", - "createdDate": "2023-02-22 23:55:29Z", - "expirationDate": null, - "type": null - }, - "75474fa652dbbf8f96826100a5fe37ba686a032ca07d61ef68a79c8e4412c150": { - "signature": "75474fa652dbbf8f96826100a5fe37ba686a032ca07d61ef68a79c8e4412c150", - "alternativeSignatures": [], - "target": "src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/Linker.cs", - "memberOf": [ - "default" - ], - "tool": "policheck", - "ruleId": "79459", - "justification": "Reference to an external source file.", - "createdDate": "2023-02-22 23:55:29Z", - "expirationDate": null, - "type": null - }, - "243e199c7aec22377e0363bdca82384278cc36b0674f35697935fde6c45cfd0e": { - "signature": "243e199c7aec22377e0363bdca82384278cc36b0674f35697935fde6c45cfd0e", - "alternativeSignatures": [], - "target": "build-tools/xaprepare/xaprepare/ThirdPartyNotices/MavenNet.cs", - "memberOf": [ - "default" - ], - "tool": "policheck", - "ruleId": "79607", - "justification": "Reference to a proper name.", - "createdDate": "2023-10-26 21:20:54Z", - "expirationDate": null, - "type": null - } - } -} diff --git a/build-tools/automation/yaml-templates/build-linux.yaml b/build-tools/automation/yaml-templates/build-linux.yaml index b44d3c8894a..ba9a99f44e3 100644 --- a/build-tools/automation/yaml-templates/build-linux.yaml +++ b/build-tools/automation/yaml-templates/build-linux.yaml @@ -25,7 +25,7 @@ stages: name: AzurePipelines-EO image: $(LinuxPoolImage1ESPT) os: linux - timeoutInMinutes: 180 + timeoutInMinutes: 240 workspace: clean: all variables: diff --git a/build-tools/automation/yaml-templates/build-windows.yaml b/build-tools/automation/yaml-templates/build-windows.yaml index d1080df907d..337dc71b301 100644 --- a/build-tools/automation/yaml-templates/build-windows.yaml +++ b/build-tools/automation/yaml-templates/build-windows.yaml @@ -26,7 +26,7 @@ stages: name: AzurePipelines-EO image: $(WindowsPoolImage1ESPT) os: windows - timeoutInMinutes: 360 + timeoutInMinutes: 240 steps: - template: sdk-unified/steps/checkout/v1.yml@yaml-templates parameters: diff --git a/build-tools/automation/yaml-templates/run-msbuild-tests.yaml b/build-tools/automation/yaml-templates/run-msbuild-tests.yaml index 45283e12501..404f95352c9 100644 --- a/build-tools/automation/yaml-templates/run-msbuild-tests.yaml +++ b/build-tools/automation/yaml-templates/run-msbuild-tests.yaml @@ -15,11 +15,16 @@ jobs: parallel: ${{ parameters.agentCount }} displayName: ${{ parameters.jobDisplayName }} ${{ if eq(parameters.testOS, 'Windows') }}: - pool: $(1ESWindowsPool) + pool: + name: AzurePipelines-EO + image: $(WindowsPoolImage1ESPT) + os: windows ${{ if eq(parameters.testOS, 'macOS') }}: pool: + name: Azure Pipelines vmImage: $(HostedMacImage) - timeoutInMinutes: 180 + os: macOS + timeoutInMinutes: 240 cancelTimeoutInMinutes: 5 steps: - ${{ if eq(parameters.testOS, 'Windows') }}: diff --git a/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml b/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml index 805045f5bf9..924d727d285 100644 --- a/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml +++ b/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml @@ -25,7 +25,9 @@ stages: parallel: ${{ parameters.agent_count }} displayName: "macOS > Tests > MSBuild+Emulator" pool: + name: Azure Pipelines vmImage: $(HostedMacImage) + os: macOS timeoutInMinutes: 180 cancelTimeoutInMinutes: 5 workspace: @@ -86,7 +88,9 @@ stages: deviceName: wear_square androidSdkPlatforms: 34 pool: + name: Azure Pipelines vmImage: $(HostedMacImage) + os: macOS workspace: clean: all steps: From 50fc87eac891c886d1a383433bc450c7bcfb9318 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Wed, 21 Feb 2024 15:58:32 -0800 Subject: [PATCH 11/36] Update monodroid guardian files --- .gdn/.gdnsuppress | 180 -------------------- build-tools/automation/azure-pipelines.yaml | 1 + 2 files changed, 1 insertion(+), 180 deletions(-) diff --git a/.gdn/.gdnsuppress b/.gdn/.gdnsuppress index 602c113c219..3ec387e7231 100644 --- a/.gdn/.gdnsuppress +++ b/.gdn/.gdnsuppress @@ -13,186 +13,6 @@ } }, "results": { - "97699b24b70c14e4857a1744533bacead40c1d999f4500d859f5d46d6799f953": { - "signature": "97699b24b70c14e4857a1744533bacead40c1d999f4500d859f5d46d6799f953", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Ionic.Zip API documentation with generic example password.", - "createdDate": "2024-02-21 20:57:50Z" - }, - "f03baf4c9d82f32a33f1c6124f648e4ebfcd92f2db349e28e98d1363e9d171b2": { - "signature": "f03baf4c9d82f32a33f1c6124f648e4ebfcd92f2db349e28e98d1363e9d171b2", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Ionic.Zip API documentation with generic example password.", - "createdDate": "2024-02-21 20:57:50Z" - }, - "42ec4c4af1860770023359ca62028bd2b090f78c5272ec226c4d91aa552fa2df": { - "signature": "42ec4c4af1860770023359ca62028bd2b090f78c5272ec226c4d91aa552fa2df", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Ionic.Zip API documentation with generic example password.", - "createdDate": "2024-02-21 20:57:50Z" - }, - "bf2d49450b2d6a960fa4092ef4431ccb88dc2b49fbf11c5241210d2690a26e94": { - "signature": "bf2d49450b2d6a960fa4092ef4431ccb88dc2b49fbf11c5241210d2690a26e94", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Ionic.Zip API documentation with generic example password.", - "createdDate": "2024-02-21 20:57:50Z" - }, - "5e87237daa293a5a8fb787852eec77320bf175950973cda2f3d254792594cf89": { - "signature": "5e87237daa293a5a8fb787852eec77320bf175950973cda2f3d254792594cf89", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Ionic.Zip API documentation with generic example password.", - "createdDate": "2024-02-21 20:57:50Z" - }, - "69fc8b0dd9a9068feec650279c5b10f01b52a09300d93792e64199864992cc0a": { - "signature": "69fc8b0dd9a9068feec650279c5b10f01b52a09300d93792e64199864992cc0a", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Ionic.Zip API documentation with generic example password.", - "createdDate": "2024-02-21 20:57:50Z" - }, - "5440d292f0e20c316e8279265dd14ba16492d3f438c2652b78bfe42b56f3ebe1": { - "signature": "5440d292f0e20c316e8279265dd14ba16492d3f438c2652b78bfe42b56f3ebe1", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Ionic.Zip API documentation with generic example password.", - "createdDate": "2024-02-21 20:57:50Z" - }, - "4093b2ad3dec514395d2f2de413b890b02098b67656c02c610c8d447918b9e3c": { - "signature": "4093b2ad3dec514395d2f2de413b890b02098b67656c02c610c8d447918b9e3c", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Ionic.Zip API documentation with generic example password.", - "createdDate": "2024-02-21 20:57:50Z" - }, - "cdf0c9dfadcc6b8dc6f52439eedc5bad9cb96b0814749eb139d65acfd5fc7cda": { - "signature": "cdf0c9dfadcc6b8dc6f52439eedc5bad9cb96b0814749eb139d65acfd5fc7cda", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Ionic.Zip API documentation with generic example password.", - "createdDate": "2024-02-21 20:57:50Z" - }, - "bb1319f066c1fef6722134892543eaef862800d15ada0fbc3ea16ccf7e412fff": { - "signature": "bb1319f066c1fef6722134892543eaef862800d15ada0fbc3ea16ccf7e412fff", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Ionic.Zip API documentation with generic example password.", - "createdDate": "2024-02-21 20:57:50Z" - }, - "1a1fc34f0b4f480cad2e9e39e27dec9cbcd5bc2d49c2785ac2a016fa75fcaee0": { - "signature": "1a1fc34f0b4f480cad2e9e39e27dec9cbcd5bc2d49c2785ac2a016fa75fcaee0", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Ionic.Zip API documentation with generic example password.", - "createdDate": "2024-02-21 20:57:50Z" - }, - "fa26064b5b8bc8af4e359c62f6b2a21d58c46ef8b5dcff6bf4ebf609d3d6004f": { - "signature": "fa26064b5b8bc8af4e359c62f6b2a21d58c46ef8b5dcff6bf4ebf609d3d6004f", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Ionic.Zip API documentation with generic example password.", - "createdDate": "2024-02-21 20:57:50Z" - }, - "3160f73c36ac035609563087313b44bb1e47bd811e55db4ae6f72541263fd315": { - "signature": "3160f73c36ac035609563087313b44bb1e47bd811e55db4ae6f72541263fd315", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Ionic.Zip API documentation with generic example password.", - "createdDate": "2024-02-21 20:57:50Z" - }, - "d9b3620b9eb0e0ba436abc25ca81845d6df2d7284015c2b139e0c584bea3d470": { - "signature": "d9b3620b9eb0e0ba436abc25ca81845d6df2d7284015c2b139e0c584bea3d470", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Ionic.Zip API documentation with generic example password.", - "createdDate": "2024-02-21 20:57:50Z" - }, - "61adc9c3537513142847443779d278efec47594468a219fff28342768744d94b": { - "signature": "61adc9c3537513142847443779d278efec47594468a219fff28342768744d94b", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Ionic.Zip API documentation with generic example password.", - "createdDate": "2024-02-21 20:57:50Z" - }, - "faf422860921d179b62d537fc81b1d99f4ff4b75243939dc153e78f21a9b8211": { - "signature": "faf422860921d179b62d537fc81b1d99f4ff4b75243939dc153e78f21a9b8211", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Ionic.Zip API documentation with generic example password.", - "createdDate": "2024-02-21 20:57:50Z" - }, - "a7e7ea7c2ae0b67e14969a5ff466fc27450988d81f8a21ef958798a46b53c0bd": { - "signature": "a7e7ea7c2ae0b67e14969a5ff466fc27450988d81f8a21ef958798a46b53c0bd", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Ionic.Zip API documentation with generic example password.", - "createdDate": "2024-02-21 20:57:50Z" - }, - "fa16145869148c36ac91a535ab4acb35d5442377f46b1c84f2970dee354208fb": { - "signature": "fa16145869148c36ac91a535ab4acb35d5442377f46b1c84f2970dee354208fb", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Dummy UnitTest.keystore file used for testing.", - "createdDate": "2024-02-21 20:57:50Z" - }, - "2fa9a7d39500379442bc21bc0ee41b9ba9a6316bbb0bf87478a8abf6d9b52ded": { - "signature": "2fa9a7d39500379442bc21bc0ee41b9ba9a6316bbb0bf87478a8abf6d9b52ded", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Dummy test.keystore file used for testing.", - "createdDate": "2024-02-21 20:57:50Z" - }, - "bc654b0dca486b80c22e3e0ca2a8246bbad14d7be3db71fbaaa8ba0f2c194f73": { - "signature": "bc654b0dca486b80c22e3e0ca2a8246bbad14d7be3db71fbaaa8ba0f2c194f73", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Dummy test.keystore file used for testing.", - "createdDate": "2024-02-21 20:57:50Z" - }, "5a0a8690d8a06dfdbf6002c67fa64a60a94f3fc77a594034cce20382e88002aa": { "signature": "5a0a8690d8a06dfdbf6002c67fa64a60a94f3fc77a594034cce20382e88002aa", "alternativeSignatures": [], diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 263bd6b99c3..deb1d605ca5 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -28,6 +28,7 @@ resources: - repository: monodroid type: github name: xamarin/monodroid + ref: refs/heads/dev/pjc/1estemp endpoint: xamarin - repository: maui type: github From fcb0c2fa1daaf396b55e208da960246df562650d Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Wed, 21 Feb 2024 18:56:48 -0800 Subject: [PATCH 12/36] More windows parallelization, use pipeline outputs for macos build --- build-tools/automation/azure-pipelines.yaml | 2 + .../yaml-templates/build-macos.yaml | 24 ++++++++++ .../yaml-templates/commercial-build.yaml | 48 ++++++++++--------- .../yaml-templates/stage-msbuild-tests.yaml | 2 +- 4 files changed, 52 insertions(+), 24 deletions(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index deb1d605ca5..8b75d18635b 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -98,6 +98,8 @@ extends: # Stage and Job "display names" are shortened because they are combined to form the name of the corresponding GitHub check. stages: - template: /build-tools/automation/yaml-templates/build-macos.yaml@self + parameters: + use1ESTemplate: true - template: /build-tools/automation/yaml-templates/build-windows.yaml@self diff --git a/build-tools/automation/yaml-templates/build-macos.yaml b/build-tools/automation/yaml-templates/build-macos.yaml index 7a3d890d24d..5039abdc2c7 100644 --- a/build-tools/automation/yaml-templates/build-macos.yaml +++ b/build-tools/automation/yaml-templates/build-macos.yaml @@ -14,6 +14,7 @@ parameters: stageDisplayName: Mac testAssembliesArtifactName: $(TestAssembliesArtifactName) windowsToolchainPdbArtifactName: $(WindowsToolchainPdbArtifactName) + use1ESTemplate: false stages: - stage: ${{ parameters.stageName }} @@ -39,6 +40,28 @@ stages: cancelTimeoutInMinutes: 5 workspace: clean: all + ${{ if eq(parameters.use1ESTemplate, true) }}: + templateContext: + outputParentDirectory: ${{ parameters.xaSourcePath }}/bin + outputs: + - output: pipelineArtifact + displayName: upload nupkgs + artifactName: ${{ parameters.nugetArtifactName }} + targetPath: ${{ parameters.xaSourcePath }}/bin/Build$(XA.Build.Configuration)/nuget-unsigned + - output: pipelineArtifact + displayName: upload Windows toolchain pdb files + artifactName: ${{ parameters.windowsToolchainPdbArtifactName }} + targetPath: ${{ parameters.xaSourcePath }}/bin/Build$(XA.Build.Configuration)/windows-toolchain-pdb + - output: pipelineArtifact + displayName: upload test assemblies + artifactName: ${{ parameters.testAssembliesArtifactName }} + targetPath: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration) + sbomEnabled: false + - output: pipelineArtifact + displayName: upload build tools inventory + artifactName: AndroidBuildToolsInventory + targetPath: ${{ parameters.xaSourcePath }}/bin/Build$(XA.Build.Configuration)/buildtoolsinventory.csv + sbomEnabled: false steps: - template: sdk-unified/steps/checkout/v1.yml@yaml-templates parameters: @@ -53,6 +76,7 @@ stages: nugetArtifactName: ${{ parameters.nugetArtifactName }} testAssembliesArtifactName: ${{ parameters.testAssembliesArtifactName }} windowsToolchainPdbArtifactName: ${{ parameters.windowsToolchainPdbArtifactName }} + use1ESTemplate: ${{ parameters.use1ESTemplate }} - template: /build-tools/automation/yaml-templates/upload-results.yaml@self parameters: diff --git a/build-tools/automation/yaml-templates/commercial-build.yaml b/build-tools/automation/yaml-templates/commercial-build.yaml index 369e99ade37..86a17700cdd 100644 --- a/build-tools/automation/yaml-templates/commercial-build.yaml +++ b/build-tools/automation/yaml-templates/commercial-build.yaml @@ -5,6 +5,7 @@ parameters: nugetArtifactName: $(NuGetArtifactName) testAssembliesArtifactName: $(TestAssembliesArtifactName) windowsToolchainPdbArtifactName: $(WindowsToolchainPdbArtifactName) + use1ESTemplate: false steps: - script: echo "##vso[task.setvariable variable=JI_JAVA_HOME]$HOME/android-toolchain/jdk-17" @@ -129,18 +130,6 @@ steps: workingDirectory: ${{ parameters.xaSourcePath }} displayName: make create-installers -- task: 1ES.PublishPipelineArtifact@1 - displayName: upload nupkgs - inputs: - artifactName: ${{ parameters.nugetArtifactName }} - targetPath: ${{ parameters.xaSourcePath }}/bin/Build$(XA.Build.Configuration)/nuget-unsigned - -- task: 1ES.PublishPipelineArtifact@1 - displayName: upload test assemblies - inputs: - artifactName: ${{ parameters.testAssembliesArtifactName }} - targetPath: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration) - - script: > mkdir -p ${{ parameters.xaSourcePath }}/bin/Build$(XA.Build.Configuration)/windows-toolchain-pdb && cd ${{ parameters.xaSourcePath }}/bin/$(XA.Build.Configuration)/lib/packs/Microsoft.Android.Sdk.Darwin/*/tools/binutils/windows-toolchain-pdb && @@ -148,14 +137,27 @@ steps: workingDirectory: ${{ parameters.xaSourcePath }} displayName: zip Windows toolchain pdb files -- task: 1ES.PublishPipelineArtifact@1 - displayName: upload Windows toolchain pdb files - inputs: - artifactName: ${{ parameters.windowsToolchainPdbArtifactName }} - targetPath: ${{ parameters.xaSourcePath }}/bin/Build$(XA.Build.Configuration)/windows-toolchain-pdb - -- task: 1ES.PublishPipelineArtifact@1 - displayName: upload build tools inventory - inputs: - artifactName: AndroidBuildToolsInventory - targetPath: ${{ parameters.xaSourcePath }}/bin/Build$(XA.Build.Configuration)/buildtoolsinventory.csv +- ${{ if ne(parameters.use1ESTemplate, true) }}: + - task: PublishPipelineArtifact@1 + displayName: upload nupkgs + inputs: + artifactName: ${{ parameters.nugetArtifactName }} + targetPath: ${{ parameters.xaSourcePath }}/bin/Build$(XA.Build.Configuration)/nuget-unsigned + + - task: PublishPipelineArtifact@1 + displayName: upload test assemblies + inputs: + artifactName: ${{ parameters.testAssembliesArtifactName }} + targetPath: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration) + + - task: PublishPipelineArtifact@1 + displayName: upload Windows toolchain pdb files + inputs: + artifactName: ${{ parameters.windowsToolchainPdbArtifactName }} + targetPath: ${{ parameters.xaSourcePath }}/bin/Build$(XA.Build.Configuration)/windows-toolchain-pdb + + - task: PublishPipelineArtifact@1 + displayName: upload build tools inventory + inputs: + artifactName: AndroidBuildToolsInventory + targetPath: ${{ parameters.xaSourcePath }}/bin/Build$(XA.Build.Configuration)/buildtoolsinventory.csv diff --git a/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml b/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml index a9eff7fb75a..8ff13943c97 100644 --- a/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml +++ b/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml @@ -32,7 +32,7 @@ stages: testOS: Windows jobName: win_msbuild_tests jobDisplayName: Windows > Tests > MSBuild - agentCount: 6 + agentCount: 12 xaSourcePath: ${{ parameters.xaSourcePath }} repositoryAlias: ${{ parameters.repositoryAlias }} commit: ${{ parameters.commit }} From 398dae976fbb1881bc058bf02c268553e6abe4b9 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Wed, 21 Feb 2024 19:15:57 -0800 Subject: [PATCH 13/36] Remove setup-linux, update nightly --- .../automation/azure-pipelines-nightly.yaml | 49 ++++++++++--------- build-tools/automation/azure-pipelines.yaml | 4 -- .../yaml-templates/build-linux.yaml | 22 ++++++--- .../yaml-templates/build-macos.yaml | 3 +- .../yaml-templates/commercial-build.yaml | 2 +- .../yaml-templates/publish-artifact.yaml | 21 +++++--- .../yaml-templates/run-emulator-tests.yaml | 2 + .../yaml-templates/setup-ubuntu.yaml | 23 --------- .../yaml-templates/upload-results.yaml | 3 ++ 9 files changed, 65 insertions(+), 64 deletions(-) delete mode 100644 build-tools/automation/yaml-templates/setup-ubuntu.yaml diff --git a/build-tools/automation/azure-pipelines-nightly.yaml b/build-tools/automation/azure-pipelines-nightly.yaml index 84611f455db..06915227c7e 100644 --- a/build-tools/automation/azure-pipelines-nightly.yaml +++ b/build-tools/automation/azure-pipelines-nightly.yaml @@ -31,7 +31,7 @@ parameters: # Global variables variables: -- template: yaml-templates/variables.yaml +- template: /build-tools/automation/yaml-templates/variables.yaml stages: - stage: mac_build @@ -56,16 +56,17 @@ stages: - checkout: self submodules: recursive - - template: yaml-templates/commercial-build.yaml + - template: /build-tools/automation/yaml-templates/commercial-build.yaml parameters: makeMSBuildArgs: /p:EnableNativeAnalyzers=true + use1ESTemplate: false - - template: yaml-templates/upload-results.yaml + - template: /build-tools/automation/yaml-templates/upload-results.yaml parameters: xaSourcePath: $(System.DefaultWorkingDirectory)/xamarin-android artifactName: Build Results - Nightly macOS includeBuildResults: true - + use1ESTemplate: false - stage: test_apk displayName: Test APKs @@ -116,26 +117,26 @@ stages: workspace: clean: all steps: - - template: yaml-templates/setup-test-environment.yaml + - template: /build-tools/automation/yaml-templates/setup-test-environment.yaml parameters: xaprepareScenario: EmulatorTestDependencies jdkTestFolder: $(JAVA_HOME_11_X64) - - template: yaml-templates/run-dotnet-preview.yaml + - template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml parameters: project: Xamarin.Android.sln arguments: -t:PrepareJavaInterop -c $(XA.Build.Configuration) -m:1 -v:n displayName: prepare java.interop $(XA.Build.Configuration) continueOnError: false - - template: yaml-templates/start-stop-emulator.yaml + - template: /build-tools/automation/yaml-templates/start-stop-emulator.yaml parameters: specificImage: true avdApiLevel: $(avdApiLevel) avdAbi: $(avdAbi) avdType: $(avdType) - - template: yaml-templates/apk-instrumentation.yaml + - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml parameters: configuration: $(XA.Build.Configuration) testName: Mono.Android.NET_Tests-$(XA.Build.Configuration)-$(avdApiLevel) @@ -145,19 +146,21 @@ stages: artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab artifactFolder: Mono.Android-$(XA.Build.Configuration)-$(avdApiLevel) - - template: yaml-templates/upload-results.yaml + - template: /build-tools/automation/yaml-templates/upload-results.yaml parameters: configuration: $(XA.Build.Configuration) artifactName: Test Results - Emulator $(avdApiLevel)-$(avdAbi)-$(avdType) - macOS + use1ESTemplate: false - - template: yaml-templates/fail-on-issue.yaml + - template: /build-tools/automation/yaml-templates/fail-on-issue.yaml - - template: yaml-templates/run-emulator-tests.yaml + - template: /build-tools/automation/yaml-templates/run-emulator-tests.yaml parameters: emulatorMSBuildArgs: -p:TestAvdExtraBootArgs=-writable-system jobName: SystemApplicationTests jobTimeout: 120 jdkTestFolder: $HOME/android-toolchain/jdk-17 + use1ESTemplate: false testSteps: - template: run-nunit-tests.yaml parameters: @@ -194,7 +197,7 @@ stages: echo "##vso[task.setvariable variable=JAVA_HOME]$HOME/android-toolchain/jdk-17" displayName: set JAVA_HOME to $HOME/android-toolchain/jdk-17 - - template: yaml-templates/setup-test-environment.yaml + - template: /build-tools/automation/yaml-templates/setup-test-environment.yaml parameters: installTestSlicer: true xaprepareScenario: EmulatorTestDependencies @@ -205,21 +208,22 @@ stages: artifactName: $(TestAssembliesArtifactName) downloadPath: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration) - - template: yaml-templates/start-stop-emulator.yaml + - template: /build-tools/automation/yaml-templates/start-stop-emulator.yaml parameters: emulatorMSBuildArgs: -p:TestAvdShowWindow=true - - template: yaml-templates/run-sliced-nunit-tests.yaml + - template: /build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml parameters: testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/MSBuildDeviceIntegration/$(DotNetStableTargetFramework)/MSBuildDeviceIntegration.dll testFilter: method == CheckTimeZoneInfoIsCorrectWithSlicer testRunTitle: CheckTimeZoneInfoIsCorrectNode On Device - macOS - - template: yaml-templates/upload-results.yaml + - template: /build-tools/automation/yaml-templates/upload-results.yaml parameters: artifactName: Test Results - TimeZoneInfoTests With Emulator - macOS-$(System.JobPositionInPhase) + use1ESTemplate: false - - template: yaml-templates/fail-on-issue.yaml + - template: /build-tools/automation/yaml-templates/fail-on-issue.yaml # Localization test jobs @@ -249,7 +253,7 @@ stages: echo "##vso[task.setvariable variable=JAVA_HOME]$HOME/android-toolchain/jdk-17" displayName: set JAVA_HOME to $HOME/android-toolchain/jdk-17 - - template: yaml-templates/setup-test-environment.yaml + - template: /build-tools/automation/yaml-templates/setup-test-environment.yaml parameters: installTestSlicer: true xaprepareScenario: EmulatorTestDependencies @@ -260,21 +264,22 @@ stages: artifactName: $(TestAssembliesArtifactName) downloadPath: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration) - - template: yaml-templates/start-stop-emulator.yaml + - template: /build-tools/automation/yaml-templates/start-stop-emulator.yaml parameters: emulatorMSBuildArgs: -p:TestAvdShowWindow=true - - template: yaml-templates/run-sliced-nunit-tests.yaml + - template: /build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml parameters: testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/MSBuildDeviceIntegration/$(DotNetStableTargetFramework)/MSBuildDeviceIntegration.dll testFilter: method == CheckLocalizationIsCorrectWithSlicer testRunTitle: CheckLocalizationIsCorrect On Device - macOS - - template: yaml-templates/upload-results.yaml + - template: /build-tools/automation/yaml-templates/upload-results.yaml parameters: artifactName: Test Results - Localization With Emulator - macOS-$(System.JobPositionInPhase) + use1ESTemplate: false - - template: yaml-templates/fail-on-issue.yaml + - template: /build-tools/automation/yaml-templates/fail-on-issue.yaml - stage: compliance_scan @@ -291,7 +296,7 @@ stages: workspace: clean: all steps: - - template: yaml-templates/setup-test-environment.yaml + - template: /build-tools/automation/yaml-templates/setup-test-environment.yaml parameters: installApkDiff: false diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 8b75d18635b..d22c81c69e4 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -98,8 +98,6 @@ extends: # Stage and Job "display names" are shortened because they are combined to form the name of the corresponding GitHub check. stages: - template: /build-tools/automation/yaml-templates/build-macos.yaml@self - parameters: - use1ESTemplate: true - template: /build-tools/automation/yaml-templates/build-windows.yaml@self @@ -278,8 +276,6 @@ extends: workspace: clean: all steps: - - template: /build-tools/automation/yaml-templates/setup-ubuntu.yaml@self - - template: /build-tools/automation/yaml-templates/setup-test-environment.yaml@self - task: DownloadPipelineArtifact@2 diff --git a/build-tools/automation/yaml-templates/build-linux.yaml b/build-tools/automation/yaml-templates/build-linux.yaml index ba9a99f44e3..03ca42267fd 100644 --- a/build-tools/automation/yaml-templates/build-linux.yaml +++ b/build-tools/automation/yaml-templates/build-linux.yaml @@ -11,6 +11,7 @@ parameters: repositoryAlias: self stageName: linux_build stageDisplayName: Linux + use1ESTemplate: true stages: - stage: ${{ parameters.stageName }} @@ -31,6 +32,13 @@ stages: variables: CXX: g++-10 CC: gcc-10 + ${{ if eq(parameters.use1ESTemplate, true) }}: + templateContext: + outputs: + - output: pipelineArtifact + displayName: upload linux sdk + artifactName: ${{ parameters.nugetArtifactName }} + targetPath: $(System.DefaultWorkingDirectory)/xamarin-android/bin/Build$(XA.Build.Configuration)/nuget-linux steps: - template: sdk-unified/steps/checkout/v1.yml@yaml-templates parameters: @@ -43,8 +51,6 @@ stages: # https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops#checkout-path - checkout: maui - - template: /build-tools/automation/yaml-templates/setup-ubuntu.yaml@self - - ${{ if ne(variables['System.PullRequest.IsFork'], 'True') }}: - checkout: monodroid clean: true @@ -83,16 +89,18 @@ stages: workingDirectory: $(System.DefaultWorkingDirectory)/xamarin-android displayName: copy linux sdk - - task: 1ES.PublishPipelineArtifact@1 - displayName: upload linux sdk - inputs: - artifactName: ${{ parameters.nugetArtifactName }} - targetPath: $(System.DefaultWorkingDirectory)/xamarin-android/bin/Build$(XA.Build.Configuration)/nuget-linux + - ${{ if ne(parameters.use1ESTemplate, true) }}: + - task: PublishPipelineArtifact@1 + displayName: upload linux sdk + inputs: + artifactName: ${{ parameters.nugetArtifactName }} + targetPath: $(System.DefaultWorkingDirectory)/xamarin-android/bin/Build$(XA.Build.Configuration)/nuget-linux - template: /build-tools/automation/yaml-templates/upload-results.yaml@self parameters: xaSourcePath: $(System.DefaultWorkingDirectory)/xamarin-android artifactName: ${{ parameters.buildResultArtifactName }} includeBuildResults: true + use1ESTemplate: ${{ parameters.use1ESTemplate }} - template: /build-tools/automation/yaml-templates/fail-on-issue.yaml@self diff --git a/build-tools/automation/yaml-templates/build-macos.yaml b/build-tools/automation/yaml-templates/build-macos.yaml index 5039abdc2c7..d033a86e71f 100644 --- a/build-tools/automation/yaml-templates/build-macos.yaml +++ b/build-tools/automation/yaml-templates/build-macos.yaml @@ -14,7 +14,7 @@ parameters: stageDisplayName: Mac testAssembliesArtifactName: $(TestAssembliesArtifactName) windowsToolchainPdbArtifactName: $(WindowsToolchainPdbArtifactName) - use1ESTemplate: false + use1ESTemplate: true stages: - stage: ${{ parameters.stageName }} @@ -83,3 +83,4 @@ stages: xaSourcePath: $(System.DefaultWorkingDirectory)/xamarin-android artifactName: ${{ parameters.buildResultArtifactName }} includeBuildResults: true + use1ESTemplate: ${{ parameters.use1ESTemplate }} diff --git a/build-tools/automation/yaml-templates/commercial-build.yaml b/build-tools/automation/yaml-templates/commercial-build.yaml index 86a17700cdd..d8937b1f877 100644 --- a/build-tools/automation/yaml-templates/commercial-build.yaml +++ b/build-tools/automation/yaml-templates/commercial-build.yaml @@ -5,7 +5,7 @@ parameters: nugetArtifactName: $(NuGetArtifactName) testAssembliesArtifactName: $(TestAssembliesArtifactName) windowsToolchainPdbArtifactName: $(WindowsToolchainPdbArtifactName) - use1ESTemplate: false + use1ESTemplate: true steps: - script: echo "##vso[task.setvariable variable=JI_JAVA_HOME]$HOME/android-toolchain/jdk-17" diff --git a/build-tools/automation/yaml-templates/publish-artifact.yaml b/build-tools/automation/yaml-templates/publish-artifact.yaml index 4144c3473db..50c7824282d 100644 --- a/build-tools/automation/yaml-templates/publish-artifact.yaml +++ b/build-tools/automation/yaml-templates/publish-artifact.yaml @@ -3,6 +3,7 @@ parameters: artifactName: artifact targetPath: $(Build.ArtifactStagingDirectory) condition: always() + use1ESTemplate: true steps: # Add the "(Attempt X)" for retries, but leave the initial run blank @@ -12,9 +13,17 @@ steps: displayName: Set upload artifact name condition: ${{ parameters.condition }} -- task: 1ES.PublishPipelineArtifact@1 - displayName: ${{ parameters.displayName }} - inputs: - artifactName: ${{ parameters.artifactName }} $(UploadAttemptSuffix) - targetPath: ${{ parameters.targetPath }} - condition: ${{ parameters.condition }} +- ${{ if eq(parameters.use1ESTemplate, true) }}: + - task: 1ES.PublishPipelineArtifact@1 + displayName: ${{ parameters.displayName }} + inputs: + artifactName: ${{ parameters.artifactName }} $(UploadAttemptSuffix) + targetPath: ${{ parameters.targetPath }} + condition: ${{ parameters.condition }} +- ${{ else }}: + - task: PublishPipelineArtifact@1 + displayName: ${{ parameters.displayName }} + inputs: + artifactName: ${{ parameters.artifactName }} $(UploadAttemptSuffix) + targetPath: ${{ parameters.targetPath }} + condition: ${{ parameters.condition }} diff --git a/build-tools/automation/yaml-templates/run-emulator-tests.yaml b/build-tools/automation/yaml-templates/run-emulator-tests.yaml index 1d3bf77c7c3..bbf7e212943 100644 --- a/build-tools/automation/yaml-templates/run-emulator-tests.yaml +++ b/build-tools/automation/yaml-templates/run-emulator-tests.yaml @@ -6,6 +6,7 @@ parameters: jobTimeout: 360 jdkTestFolder: $(JAVA_HOME_17_X64) testSteps: [] + use1ESTemplate: true jobs: - job: mac_${{ parameters.jobName }}_tests @@ -44,5 +45,6 @@ jobs: - template: /build-tools/automation/yaml-templates/upload-results.yaml@self parameters: artifactName: Test Results - ${{ parameters.jobName }} With Emulator - macOS + use1ESTemplate: ${{ parameters.use1ESTemplate }} - template: /build-tools/automation/yaml-templates/fail-on-issue.yaml@self diff --git a/build-tools/automation/yaml-templates/setup-ubuntu.yaml b/build-tools/automation/yaml-templates/setup-ubuntu.yaml deleted file mode 100644 index 6b7c4e34e94..00000000000 --- a/build-tools/automation/yaml-templates/setup-ubuntu.yaml +++ /dev/null @@ -1,23 +0,0 @@ -steps: -- script: echo skip -#- script: sudo rm /etc/apt/sources.list.d/treasure-data.list || true -# displayName: remove invalid treasure-data source - -#- script: echo "##vso[task.setvariable variable=XDG_CONFIG_HOME]$HOME/.config" -# displayName: update XDG_CONFIG_HOME - -#- script: > -# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && -# echo "deb https://download.mono-project.com/repo/ubuntu preview-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-preview.list && -# sudo apt update && -# sudo apt install -y --no-install-recommends mono-complete nuget msbuild -# displayName: install mono preview - -#- template: /build-tools/automation/yaml-templates/use-dot-net.yaml@self -# parameters: -# remove_dotnet: true - -#- task: NuGetToolInstaller@1 -# displayName: Use NuGet 5.x -# inputs: -# versionSpec: 5.x diff --git a/build-tools/automation/yaml-templates/upload-results.yaml b/build-tools/automation/yaml-templates/upload-results.yaml index 48330ea8ffc..40ce61a07cd 100644 --- a/build-tools/automation/yaml-templates/upload-results.yaml +++ b/build-tools/automation/yaml-templates/upload-results.yaml @@ -4,6 +4,7 @@ parameters: artifactName: results includeBuildResults: false condition: or(ne(variables['Agent.JobStatus'], 'Succeeded'), eq(variables['XA.PublishAllLogs'], 'true')) + use1ESTemplate: true steps: - template: /build-tools/automation/yaml-templates/run-xaprepare.yaml@self @@ -21,6 +22,7 @@ steps: artifactName: ${{ parameters.artifactName }} targetPath: $(Build.StagingDirectory)/Test${{ parameters.configuration }} condition: ${{ parameters.condition }} + use1ESTemplate: ${{ parameters.use1ESTemplate }} # Copy Build$(Configuration) folder into test result root and upload single artifact - ${{ if eq(parameters.includeBuildResults, true) }}: @@ -36,3 +38,4 @@ steps: artifactName: ${{ parameters.artifactName }} targetPath: $(Build.StagingDirectory)/Test${{ parameters.configuration }} condition: ${{ parameters.condition }} + use1ESTemplate: ${{ parameters.use1ESTemplate }} From 35c5864b36abee4d8cb3ed4609ad52976f7b299d Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Thu, 22 Feb 2024 08:29:52 -0800 Subject: [PATCH 14/36] bump monodroid, fix mac build source path --- .external | 2 +- build-tools/automation/azure-pipelines.yaml | 2 +- build-tools/automation/yaml-templates/build-macos.yaml | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.external b/.external index 8d72a200199..c04533c913b 100644 --- a/.external +++ b/.external @@ -1 +1 @@ -xamarin/monodroid:main@cb01503327f7723ec138ec4cc051610fecee1bf7 +xamarin/monodroid:main@59a052933b6803635a0f31d978791e949cb35444 diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index d22c81c69e4..bba70dd6e8d 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -28,7 +28,7 @@ resources: - repository: monodroid type: github name: xamarin/monodroid - ref: refs/heads/dev/pjc/1estemp + ref: refs/heads/main endpoint: xamarin - repository: maui type: github diff --git a/build-tools/automation/yaml-templates/build-macos.yaml b/build-tools/automation/yaml-templates/build-macos.yaml index d033a86e71f..aa92c77890d 100644 --- a/build-tools/automation/yaml-templates/build-macos.yaml +++ b/build-tools/automation/yaml-templates/build-macos.yaml @@ -2,6 +2,7 @@ parameters: buildResultArtifactName: Build Results - macOS checkoutCommit: '' checkoutPath: 's/xamarin-android' + xaSourcePath: $(System.DefaultWorkingDirectory)/xamarin-android checkoutPersistCredentials: false dependsOn: '' dependsOnResult: '' @@ -72,6 +73,7 @@ stages: - template: /build-tools/automation/yaml-templates/commercial-build.yaml@self parameters: + xaSourcePath: ${{ parameters.xaSourcePath }} installerArtifactName: ${{ parameters.installerArtifactName }} nugetArtifactName: ${{ parameters.nugetArtifactName }} testAssembliesArtifactName: ${{ parameters.testAssembliesArtifactName }} @@ -80,7 +82,7 @@ stages: - template: /build-tools/automation/yaml-templates/upload-results.yaml@self parameters: - xaSourcePath: $(System.DefaultWorkingDirectory)/xamarin-android + xaSourcePath: ${{ parameters.xaSourcePath }} artifactName: ${{ parameters.buildResultArtifactName }} includeBuildResults: true use1ESTemplate: ${{ parameters.use1ESTemplate }} From e0cc0abc0e2e2855189dd65108bcfde9a3f720c8 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Thu, 22 Feb 2024 10:51:15 -0800 Subject: [PATCH 15/36] Update result publishing and timeout --- .../automation/azure-pipelines-nightly.yaml | 1 - build-tools/automation/azure-pipelines.yaml | 22 ++++++++----------- .../yaml-templates/build-windows.yaml | 1 - .../yaml-templates/run-nunit-tests.yaml | 10 +-------- 4 files changed, 10 insertions(+), 24 deletions(-) diff --git a/build-tools/automation/azure-pipelines-nightly.yaml b/build-tools/automation/azure-pipelines-nightly.yaml index 06915227c7e..a71b2ac0872 100644 --- a/build-tools/automation/azure-pipelines-nightly.yaml +++ b/build-tools/automation/azure-pipelines-nightly.yaml @@ -167,7 +167,6 @@ stages: testRunTitle: SystemApplicationTests On Device - macOS testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/MSBuildDeviceIntegration/$(DotNetStableTargetFramework)/MSBuildDeviceIntegration.dll dotNetTestExtraArgs: --filter "Name=SystemApplicationTests" - testResultsFile: TestResult-SystemApplicationTests-$(XA.Build.Configuration).xml # TimeZoneInfo test jobs diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index bba70dd6e8d..b972ce71639 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -37,6 +37,8 @@ resources: endpoint: xamarin parameters: +- name: pushXAPackagesToMaestro + default: true - name: macTestAgentsUseCleanImages # Test agents we do not need to clean up when finished because they are not reused default: true - name: Skip1ESComplianceTasks @@ -72,11 +74,10 @@ variables: value: true extends: - template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines - #${{ if eq(variables['MicroBuildSignType'], 'Real') }}: - # template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines - #${{ else }}: - # template: v1/1ES.Unofficial.PipelineTemplate.yml@1esPipelines + ${{ if eq(variables['MicroBuildSignType'], 'Real') }}: + template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines + ${{ else }}: + template: v1/1ES.Unofficial.PipelineTemplate.yml@1esPipelines parameters: sdl: ${{ if eq('${{ parameters.Skip1ESComplianceTasks }}', 'true') }}: @@ -235,7 +236,6 @@ extends: parameters: testRunTitle: Xamarin.Android.Tools.Aidl-Tests - macOS testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Tools.Aidl-Tests.dll - testResultsFile: TestResult-Aidl-Tests-macOS-$(XA.Build.Configuration).xml - task: ShellScript@2 displayName: Test dotnet-local.sh @@ -288,28 +288,24 @@ extends: testRunTitle: Xamarin.Android.Build.Tests - Linux BuildTest testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll dotNetTestExtraArgs: --filter "Name = BuildTest" - testResultsFile: TestResult-BuildTest-Linux-$(XA.Build.Configuration).xml - template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml@self parameters: testRunTitle: Xamarin.Android.Build.Tests - Linux PackagingTest testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll dotNetTestExtraArgs: --filter "Name = PackagingTest" - testResultsFile: TestResult-PackagingTest-Linux-$(XA.Build.Configuration).xml - template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml@self parameters: testRunTitle: Xamarin.Android.Build.Tests - Linux XASdkTests testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll dotNetTestExtraArgs: --filter "Name = XASdkTests & Name != XamarinLegacySdk" - testResultsFile: TestResult-XASdkTests-Linux-$(XA.Build.Configuration).xml - template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml@self parameters: testRunTitle: Xamarin.Android.Build.Tests - Linux AndroidDependenciesTests testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll dotNetTestExtraArgs: --filter "Name = AndroidDependenciesTests" - testResultsFile: TestResult-AndroidDependenciesTests-Linux-$(XA.Build.Configuration).xml - task: ShellScript@2 displayName: Test dotnet-local.sh @@ -543,7 +539,7 @@ extends: templateContext: outputs: - output: nuget - condition: and(succeeded(), eq(variables['PushXAPackages'], 'true')) + condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true')) useDotNetTask: false # The default is false to use the NuGetCommand task. Set to true to use the DotNetCoreCLI task to publish packages. packagesToPush: $(Build.StagingDirectory)\nuget-signed\*.nupkg packageParentPath: $(Build.StagingDirectory)\nuget-signed @@ -617,7 +613,7 @@ extends: $(System.DefaultWorkingDirectory)\build-tools\create-packs\Microsoft.Android.Sdk.proj -bl:$(System.DefaultWorkingDirectory)\bin\Build$(XA.Build.Configuration)\push-bar-manifest.binlog displayName: generate and publish BAR manifest - condition: and(succeeded(), eq(variables['PushXAPackageInfoToMaestro'], 'true')) + condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true')) - powershell: | $versionEndpoint = 'https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16' @@ -626,7 +622,7 @@ extends: & dotnet tool update microsoft.dotnet.darc --version "$darcVersion" --add-source "$arcadeServicesSource" --tool-path $(Agent.ToolsDirectory)\darc -v n & $(Agent.ToolsDirectory)\darc\darc add-build-to-channel --default-channels --id $(BARBuildId) --publishing-infra-version 3 --skip-assets-publishing --password $(MaestroAccessToken) --azdev-pat $(publishing-dnceng-devdiv-code-r-build-re) displayName: add build to default darc channel - condition: and(succeeded(), eq(variables['PushXAPackageInfoToMaestro'], 'true')) + condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true')) - template: build-tools\automation\yaml-templates\upload-results.yaml@self parameters: diff --git a/build-tools/automation/yaml-templates/build-windows.yaml b/build-tools/automation/yaml-templates/build-windows.yaml index 337dc71b301..74ba17fe244 100644 --- a/build-tools/automation/yaml-templates/build-windows.yaml +++ b/build-tools/automation/yaml-templates/build-windows.yaml @@ -72,7 +72,6 @@ stages: parameters: testRunTitle: Smoke MSBuild Tests - Windows Dotnet Build testAssembly: $(System.DefaultWorkingDirectory)\bin\Test$(XA.Build.Configuration)\$(DotNetStableTargetFramework)\Xamarin.Android.Build.Tests.dll - testResultsFile: TestResult-SmokeMSBuildTests-WinDotnetBuild-$(XA.Build.Configuration).xml dotNetTestExtraArgs: --filter "TestCategory = SmokeTests" - task: BatchScript@1 diff --git a/build-tools/automation/yaml-templates/run-nunit-tests.yaml b/build-tools/automation/yaml-templates/run-nunit-tests.yaml index 3df74d5495a..709a503e477 100644 --- a/build-tools/automation/yaml-templates/run-nunit-tests.yaml +++ b/build-tools/automation/yaml-templates/run-nunit-tests.yaml @@ -1,11 +1,10 @@ parameters: testRunTitle: Xamarin Android Tests testAssembly: '' - testResultsFile: TestResult.xml dotNetTestExtraArgs: '' workers: $(NUnit.NumberOfTestWorkers) condition: succeeded() - timeoutInMinutes: 0 + timeoutInMinutes: 180 retryCountOnTaskFailure: 0 steps: @@ -24,10 +23,3 @@ steps: retryCountOnTaskFailure: ${{ parameters.retryCountOnTaskFailure }} - template: /build-tools/automation/yaml-templates/kill-processes.yaml@self - -- task: PublishTestResults@2 - inputs: - testResultsFormat: $(TestResultsFormat) - testResultsFiles: ${{ parameters.testResultsFile }} - testRunTitle: ${{ parameters.testRunTitle }} - condition: and(${{ parameters.condition }}, or(ne('${{ parameters.useDotNet }}', 'true'), eq('${{ parameters.useDotNetPreview }}', 'true'))) From d174ca259faf6969d9576b2239bffee7cb67984d Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Thu, 22 Feb 2024 12:30:24 -0800 Subject: [PATCH 16/36] Restore multi-language policheck scan --- .../guardian => .gdn}/CHT.gdnsuppress | 0 .../PoliCheck.Exclusions.xml | 0 .../guardian => .gdn}/tsaoptions-v2.json | 0 build-tools/automation/azure-pipelines.yaml | 24 +++++++++++++++++++ 4 files changed, 24 insertions(+) rename {build-tools/automation/guardian => .gdn}/CHT.gdnsuppress (100%) rename {build-tools/automation/guardian => .gdn}/PoliCheck.Exclusions.xml (100%) rename {build-tools/automation/guardian => .gdn}/tsaoptions-v2.json (100%) diff --git a/build-tools/automation/guardian/CHT.gdnsuppress b/.gdn/CHT.gdnsuppress similarity index 100% rename from build-tools/automation/guardian/CHT.gdnsuppress rename to .gdn/CHT.gdnsuppress diff --git a/build-tools/automation/guardian/PoliCheck.Exclusions.xml b/.gdn/PoliCheck.Exclusions.xml similarity index 100% rename from build-tools/automation/guardian/PoliCheck.Exclusions.xml rename to .gdn/PoliCheck.Exclusions.xml diff --git a/build-tools/automation/guardian/tsaoptions-v2.json b/.gdn/tsaoptions-v2.json similarity index 100% rename from build-tools/automation/guardian/tsaoptions-v2.json rename to .gdn/tsaoptions-v2.json diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 41b0700c0fc..fc732dce62f 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -629,3 +629,27 @@ extends: xaSourcePath: $(System.DefaultWorkingDirectory) artifactName: Prepare Release - Push Internal includeBuildResults: true + + # Check - "Xamarin.Android (PoliCheck)" + - template: security/policheck/v3.yml@yaml-templates + parameters: + windowsImageOverride: $(WindowsPoolImage1ESPT) + stageDependsOn: [] + sourceGdnSuppressionFile: $(Build.SourcesDirectory)\.gdn\.gdnsuppress + tsaConfigFile: $(Build.SourcesDirectory)\.gdn\tsaoptions-v2.json + policheckLocScanEnabled: true + policheckExclusionFilesFolder: $(Build.SourcesDirectory)\.gdn + policheckGdnSuppressionFilesFolder: $(Build.SourcesDirectory)\.gdn + policheckChsScanFolder: $(Build.SourcesDirectory)\Localize\loc\zh-Hans + policheckChtScanFolder: $(Build.SourcesDirectory)\Localize\loc\zh-Hant + policheckCsyScanFolder: $(Build.SourcesDirectory)\Localize\loc\cs + policheckDeuScanFolder: $(Build.SourcesDirectory)\Localize\loc\de + policheckEsnScanFolder: $(Build.SourcesDirectory)\Localize\loc\es + policheckFraScanFolder: $(Build.SourcesDirectory)\Localize\loc\fr + policheckItaScanFolder: $(Build.SourcesDirectory)\Localize\loc\it + policheckJpnScanFolder: $(Build.SourcesDirectory)\Localize\loc\ja + policheckKorScanFolder: $(Build.SourcesDirectory)\Localize\loc\ko + policheckPlkScanFolder: $(Build.SourcesDirectory)\Localize\loc\pl + policheckPtbScanFolder: $(Build.SourcesDirectory)\Localize\loc\pt-BR + policheckRusScanFolder: $(Build.SourcesDirectory)\Localize\loc\ru + policheckTrkScanFolder: $(Build.SourcesDirectory)\Localize\loc\tr From c6ada8e26370a80ddc708764eaa31b0e3f0a005c Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Thu, 22 Feb 2024 13:32:01 -0800 Subject: [PATCH 17/36] Rename gdnsuppress for policheck template --- .gdn/{.gdnsuppress => source.gdnsuppress} | 0 build-tools/automation/azure-pipelines.yaml | 3 +-- 2 files changed, 1 insertion(+), 2 deletions(-) rename .gdn/{.gdnsuppress => source.gdnsuppress} (100%) diff --git a/.gdn/.gdnsuppress b/.gdn/source.gdnsuppress similarity index 100% rename from .gdn/.gdnsuppress rename to .gdn/source.gdnsuppress diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index fc732dce62f..6f07d3a56a7 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -85,7 +85,7 @@ extends: codeql: runSourceLanguagesInSourceAnalysis: true suppression: - suppressionFile: $(Build.SourcesDirectory)\.gdn\.gdnsuppress + suppressionFile: $(Build.SourcesDirectory)\.gdn\source.gdnsuppress sourceAnalysisPool: name: AzurePipelines-EO image: $(WindowsPoolImage1ESPT) @@ -635,7 +635,6 @@ extends: parameters: windowsImageOverride: $(WindowsPoolImage1ESPT) stageDependsOn: [] - sourceGdnSuppressionFile: $(Build.SourcesDirectory)\.gdn\.gdnsuppress tsaConfigFile: $(Build.SourcesDirectory)\.gdn\tsaoptions-v2.json policheckLocScanEnabled: true policheckExclusionFilesFolder: $(Build.SourcesDirectory)\.gdn From 23808ee02276da1e4574e9473fc6216c55d0a656 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Thu, 22 Feb 2024 15:49:13 -0800 Subject: [PATCH 18/36] Update source.gdnsuppress --- .gdn/source.gdnsuppress | 91 +++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/.gdn/source.gdnsuppress b/.gdn/source.gdnsuppress index 3ec387e7231..e7225edeaae 100644 --- a/.gdn/source.gdnsuppress +++ b/.gdn/source.gdnsuppress @@ -9,31 +9,15 @@ "default": { "name": "default", "createdDate": "2023-02-22 23:55:29Z", - "lastUpdatedDate": "2024-02-21 20:58:02Z" + "lastUpdatedDate": "2024-02-22 21:40:38Z" } }, "results": { - "5a0a8690d8a06dfdbf6002c67fa64a60a94f3fc77a594034cce20382e88002aa": { - "signature": "5a0a8690d8a06dfdbf6002c67fa64a60a94f3fc77a594034cce20382e88002aa", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Reference to an external source file.", - "createdDate": "2023-02-22 23:55:29Z" - }, - "1b319055b8e507b220d0dab341e67e20f49632fd1844a08a4fcc6d4493930ac5": { - "signature": "1b319055b8e507b220d0dab341e67e20f49632fd1844a08a4fcc6d4493930ac5", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Reference to an external source file.", - "createdDate": "2023-02-22 23:55:29Z" - }, "6789cab1bdc97b0cc3ad057b7fdd21d63cdf8bc2679391923803fa240ef81292": { "signature": "6789cab1bdc97b0cc3ad057b7fdd21d63cdf8bc2679391923803fa240ef81292", - "alternativeSignatures": [], + "alternativeSignatures": [ + "b5041e3ec6776af49d6d69148e4db480f366b559299d19ec8ea3e095295b39a8" + ], "memberOf": [ "default" ], @@ -42,7 +26,9 @@ }, "bbaf5f946cb72748567e41f0df5f1bae05550f4ba7381e21ec6b26d6c3ecec9f": { "signature": "bbaf5f946cb72748567e41f0df5f1bae05550f4ba7381e21ec6b26d6c3ecec9f", - "alternativeSignatures": [], + "alternativeSignatures": [ + "739cb5e6ee2409515900652ca668f819f697f23834becece8d2f9f9236723c1b" + ], "memberOf": [ "default" ], @@ -51,7 +37,9 @@ }, "db8916a0f0cdca4082c540921dd362e09a9ff413862ab826308411b76ee35789": { "signature": "db8916a0f0cdca4082c540921dd362e09a9ff413862ab826308411b76ee35789", - "alternativeSignatures": [], + "alternativeSignatures": [ + "a755747462567003e5aa2b7bf01aa72af5143714e427ad043747b1fb54b1c440" + ], "memberOf": [ "default" ], @@ -60,7 +48,9 @@ }, "6d1fb3a483eb491710d6a09ed0b4bab47f13942d0c6fc744e6683614a66604ab": { "signature": "6d1fb3a483eb491710d6a09ed0b4bab47f13942d0c6fc744e6683614a66604ab", - "alternativeSignatures": [], + "alternativeSignatures": [ + "a755747462567003e5aa2b7bf01aa72af5143714e427ad043747b1fb54b1c440" + ], "memberOf": [ "default" ], @@ -69,7 +59,9 @@ }, "b07e75fc8a506b94690dbd06877da06c1228e40e7deda3967f6b882b842f726d": { "signature": "b07e75fc8a506b94690dbd06877da06c1228e40e7deda3967f6b882b842f726d", - "alternativeSignatures": [], + "alternativeSignatures": [ + "a755747462567003e5aa2b7bf01aa72af5143714e427ad043747b1fb54b1c440" + ], "memberOf": [ "default" ], @@ -78,7 +70,9 @@ }, "87d8313310c2dd42021844b95bdcb9121bf10036fea5b212b945e0732a456e5a": { "signature": "87d8313310c2dd42021844b95bdcb9121bf10036fea5b212b945e0732a456e5a", - "alternativeSignatures": [], + "alternativeSignatures": [ + "a755747462567003e5aa2b7bf01aa72af5143714e427ad043747b1fb54b1c440" + ], "memberOf": [ "default" ], @@ -87,7 +81,9 @@ }, "8e5400e0233c8d887ad48bd8a48e8a7be5a579f9eefad521419b6df0828bbfac": { "signature": "8e5400e0233c8d887ad48bd8a48e8a7be5a579f9eefad521419b6df0828bbfac", - "alternativeSignatures": [], + "alternativeSignatures": [ + "a755747462567003e5aa2b7bf01aa72af5143714e427ad043747b1fb54b1c440" + ], "memberOf": [ "default" ], @@ -96,7 +92,9 @@ }, "1b38e026fae90da4ae2fe9151c9c1ebd73c8b3c2c5f072ceae390a3ceec2fb97": { "signature": "1b38e026fae90da4ae2fe9151c9c1ebd73c8b3c2c5f072ceae390a3ceec2fb97", - "alternativeSignatures": [], + "alternativeSignatures": [ + "a755747462567003e5aa2b7bf01aa72af5143714e427ad043747b1fb54b1c440" + ], "memberOf": [ "default" ], @@ -105,7 +103,9 @@ }, "a2b4d032c59a9d1211d218c3cd550cf8febb369941d70284d07d03ebee855bc0": { "signature": "a2b4d032c59a9d1211d218c3cd550cf8febb369941d70284d07d03ebee855bc0", - "alternativeSignatures": [], + "alternativeSignatures": [ + "9feaec8a73b72e0d212c0e18d863e4fe16ff010c5d33cf8d47d8b0f465cc4c5e" + ], "memberOf": [ "default" ], @@ -114,7 +114,9 @@ }, "1c87b45a6044d205dc3f3562f349c238f7cabe22b4609da762df9dc44151e9fb": { "signature": "1c87b45a6044d205dc3f3562f349c238f7cabe22b4609da762df9dc44151e9fb", - "alternativeSignatures": [], + "alternativeSignatures": [ + "9feaec8a73b72e0d212c0e18d863e4fe16ff010c5d33cf8d47d8b0f465cc4c5e" + ], "memberOf": [ "default" ], @@ -123,43 +125,42 @@ }, "a6639098c4785509a4215c9e2fc10f82c06fce461915dc11a00227ddec558845": { "signature": "a6639098c4785509a4215c9e2fc10f82c06fce461915dc11a00227ddec558845", - "alternativeSignatures": [], + "alternativeSignatures": [ + "9feaec8a73b72e0d212c0e18d863e4fe16ff010c5d33cf8d47d8b0f465cc4c5e" + ], "memberOf": [ "default" ], "justification": "Reference to find first set bit function.", "createdDate": "2023-02-22 23:55:29Z" }, - "d6b3df0b1d35cb4acec6a954acc145c9ec22041cd463b94ff080682c65a9bd62": { - "signature": "d6b3df0b1d35cb4acec6a954acc145c9ec22041cd463b94ff080682c65a9bd62", - "alternativeSignatures": [], + "f94ede7b396cb54934db2084f0879cd31a17ce2584eb01e0bfcd35324a724c31": { + "signature": "f94ede7b396cb54934db2084f0879cd31a17ce2584eb01e0bfcd35324a724c31", + "alternativeSignatures": [ + "9feaec8a73b72e0d212c0e18d863e4fe16ff010c5d33cf8d47d8b0f465cc4c5e" + ], "memberOf": [ "default" ], "justification": "Reference to find first set bit function.", - "createdDate": "2023-02-22 23:55:29Z" + "createdDate": "2024-02-22 21:40:38Z" }, "b34b42aa41018376a31460c142f2ae910704725d9e9a4470f92b587df682369b": { "signature": "b34b42aa41018376a31460c142f2ae910704725d9e9a4470f92b587df682369b", - "alternativeSignatures": [], - "memberOf": [ - "default" + "alternativeSignatures": [ + "3901d031f3ac168bb1a84d06bb234355af514c59a0ed9da325b11a8861ff0b05" ], - "justification": "Reference to output from an external tool.", - "createdDate": "2023-02-22 23:55:29Z" - }, - "75474fa652dbbf8f96826100a5fe37ba686a032ca07d61ef68a79c8e4412c150": { - "signature": "75474fa652dbbf8f96826100a5fe37ba686a032ca07d61ef68a79c8e4412c150", - "alternativeSignatures": [], "memberOf": [ "default" ], - "justification": "Reference to an external source file.", + "justification": "Reference to output from an external tool.", "createdDate": "2023-02-22 23:55:29Z" }, "243e199c7aec22377e0363bdca82384278cc36b0674f35697935fde6c45cfd0e": { "signature": "243e199c7aec22377e0363bdca82384278cc36b0674f35697935fde6c45cfd0e", - "alternativeSignatures": [], + "alternativeSignatures": [ + "cf02f44873b25336e01a1fa294bd858d2ea69ae734f08c6db40d4b83d17ccf76" + ], "memberOf": [ "default" ], From acd8ef63c4f03298767aff746560f193d94be4b5 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Thu, 22 Feb 2024 17:24:40 -0800 Subject: [PATCH 19/36] Update guardian files --- .gdn/.gdn/policheck/CHT.gdnsuppress | 9 +++ .gdn/.gdnsuppress | 62 +++++++++++++++++++ .gdn/CHT.gdnsuppress | 26 -------- .gdn/policheck/CHT.gdnsuppress | 26 ++++++++ .gdn/{ => policheck}/PoliCheck.Exclusions.xml | 0 .gdn/{ => policheck}/source.gdnsuppress | 45 -------------- build-tools/automation/azure-pipelines.yaml | 6 +- 7 files changed, 100 insertions(+), 74 deletions(-) create mode 100644 .gdn/.gdn/policheck/CHT.gdnsuppress create mode 100644 .gdn/.gdnsuppress delete mode 100644 .gdn/CHT.gdnsuppress create mode 100644 .gdn/policheck/CHT.gdnsuppress rename .gdn/{ => policheck}/PoliCheck.Exclusions.xml (100%) rename .gdn/{ => policheck}/source.gdnsuppress (77%) diff --git a/.gdn/.gdn/policheck/CHT.gdnsuppress b/.gdn/.gdn/policheck/CHT.gdnsuppress new file mode 100644 index 00000000000..75469b1ed33 --- /dev/null +++ b/.gdn/.gdn/policheck/CHT.gdnsuppress @@ -0,0 +1,9 @@ +{ + "hydrated": false, + "properties": { + "helpUri": "https://eng.ms/docs/microsoft-security/security/azure-security/cloudai-security-fundamentals-engineering/security-integration/guardian-wiki/microsoft-guardian/general/suppressions", + "hydrationStatus": "This file does not contain identifying data. It is safe to check into your repo. To hydrate this file with identifying data, run `guardian hydrate --help` and follow the guidance." + }, + "version": "1.0.0", + + } \ No newline at end of file diff --git a/.gdn/.gdnsuppress b/.gdn/.gdnsuppress new file mode 100644 index 00000000000..05025c8dc59 --- /dev/null +++ b/.gdn/.gdnsuppress @@ -0,0 +1,62 @@ +{ + "hydrated": false, + "properties": { + "helpUri": "https://eng.ms/docs/microsoft-security/security/azure-security/cloudai-security-fundamentals-engineering/security-integration/guardian-wiki/microsoft-guardian/general/suppressions", + "hydrationStatus": "This file does not contain identifying data. It is safe to check into your repo. To hydrate this file with identifying data, run `guardian hydrate --help` and follow the guidance." + }, + "version": "1.0.0", + "suppressionSets": { + "default": { + "name": "default", + "createdDate": "2024-02-21 20:58:02Z", + "lastUpdatedDate": "2024-02-22 21:40:38Z" + } + }, + "results": { + "28e1a7a1157c8739dce8ac1bbd828a471e477444ec50d2656d0440948b58a274": { + "signature": "28e1a7a1157c8739dce8ac1bbd828a471e477444ec50d2656d0440948b58a274", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "FillEventHistory+Event API documentation with generic example password.", + "createdDate": "2024-02-21 20:58:02Z" + }, + "0b7cc0b28f27b0eeb2a415f10e62c32675dd2d4edcffe35600eae35f8064004e": { + "signature": "0b7cc0b28f27b0eeb2a415f10e62c32675dd2d4edcffe35600eae35f8064004e", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Android.Service.Autofill.FillEventHistory+Event API documentation with generic example password.", + "createdDate": "2024-02-21 20:58:02Z" + }, + "e57727a14a28f6fd8f4aa87cd3c4b33401dfea1078ce32fb3cbdf342e8adf63d": { + "signature": "e57727a14a28f6fd8f4aa87cd3c4b33401dfea1078ce32fb3cbdf342e8adf63d", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Javax.Crypto.ISecretKey API documentation with generic example password.", + "createdDate": "2024-02-21 20:58:02Z" + }, + "15c51590a2e2bb503a7277448e05357f5fd8d4cb2f9b9b7446e41c872cceaac4": { + "signature": "15c51590a2e2bb503a7277448e05357f5fd8d4cb2f9b9b7446e41c872cceaac4", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Javax.Security.Auth.Callback.PasswordCallback API documentation with generic example password.", + "createdDate": "2024-02-21 20:58:02Z" + }, + "1ccf925aa704efd1035bac38e94d2e629fb5b0d1784d5473e4a52e6d13db16ee": { + "signature": "1ccf925aa704efd1035bac38e94d2e629fb5b0d1784d5473e4a52e6d13db16ee", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Dummy test.keystore file used for testing.", + "createdDate": "2024-02-21 20:58:02Z" + } + } +} diff --git a/.gdn/CHT.gdnsuppress b/.gdn/CHT.gdnsuppress deleted file mode 100644 index 4396a9a378a..00000000000 --- a/.gdn/CHT.gdnsuppress +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": "latest", - "suppressionSets": { - "default": { - "name": "default", - "createdDate": "2023-02-24 00:05:39Z", - "lastUpdatedDate": "2023-02-24 00:05:39Z" - } - }, - "results": { - "04910d714a13bf4523ffa77350f654f52114fa4fa3d760c9f63186d41716c019": { - "signature": "04910d714a13bf4523ffa77350f654f52114fa4fa3d760c9f63186d41716c019", - "alternativeSignatures": [], - "target": "Localize/loc/zh-Hant/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl", - "memberOf": [ - "default" - ], - "tool": "policheck", - "ruleId": "64550", - "justification": "Reference to the Android package format APK.", - "createdDate": "2023-02-24 00:05:39Z", - "expirationDate": null, - "type": null - } - } -} diff --git a/.gdn/policheck/CHT.gdnsuppress b/.gdn/policheck/CHT.gdnsuppress new file mode 100644 index 00000000000..4a7ab1881eb --- /dev/null +++ b/.gdn/policheck/CHT.gdnsuppress @@ -0,0 +1,26 @@ +{ + "hydrated": false, + "properties": { + "helpUri": "https://eng.ms/docs/microsoft-security/security/azure-security/cloudai-security-fundamentals-engineering/security-integration/guardian-wiki/microsoft-guardian/general/suppressions", + "hydrationStatus": "This file does not contain identifying data. It is safe to check into your repo. To hydrate this file with identifying data, run `guardian hydrate --help` and follow the guidance." + }, + "version": "1.0.0", + "suppressionSets": { + "default": { + "name": "default", + "createdDate": "2023-02-24 00:05:39Z", + "lastUpdatedDate": "2024-02-22 21:40:38Z" + } + }, + "results": { + "04910d714a13bf4523ffa77350f654f52114fa4fa3d760c9f63186d41716c019": { + "signature": "04910d714a13bf4523ffa77350f654f52114fa4fa3d760c9f63186d41716c019", + "alternativeSignatures": [], + "memberOf": [ + "default" + ], + "justification": "Reference to the Android package format APK.", + "createdDate": "2023-02-24 00:05:39Z" + } + } +} diff --git a/.gdn/PoliCheck.Exclusions.xml b/.gdn/policheck/PoliCheck.Exclusions.xml similarity index 100% rename from .gdn/PoliCheck.Exclusions.xml rename to .gdn/policheck/PoliCheck.Exclusions.xml diff --git a/.gdn/source.gdnsuppress b/.gdn/policheck/source.gdnsuppress similarity index 77% rename from .gdn/source.gdnsuppress rename to .gdn/policheck/source.gdnsuppress index e7225edeaae..f73824769dc 100644 --- a/.gdn/source.gdnsuppress +++ b/.gdn/policheck/source.gdnsuppress @@ -166,51 +166,6 @@ ], "justification": "Reference to a proper name.", "createdDate": "2023-10-26 21:20:54Z" - }, - "28e1a7a1157c8739dce8ac1bbd828a471e477444ec50d2656d0440948b58a274": { - "signature": "28e1a7a1157c8739dce8ac1bbd828a471e477444ec50d2656d0440948b58a274", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "FillEventHistory+Event API documentation with generic example password.", - "createdDate": "2024-02-21 20:58:02Z" - }, - "0b7cc0b28f27b0eeb2a415f10e62c32675dd2d4edcffe35600eae35f8064004e": { - "signature": "0b7cc0b28f27b0eeb2a415f10e62c32675dd2d4edcffe35600eae35f8064004e", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Android.Service.Autofill.FillEventHistory+Event API documentation with generic example password.", - "createdDate": "2024-02-21 20:58:02Z" - }, - "e57727a14a28f6fd8f4aa87cd3c4b33401dfea1078ce32fb3cbdf342e8adf63d": { - "signature": "e57727a14a28f6fd8f4aa87cd3c4b33401dfea1078ce32fb3cbdf342e8adf63d", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Javax.Crypto.ISecretKey API documentation with generic example password.", - "createdDate": "2024-02-21 20:58:02Z" - }, - "15c51590a2e2bb503a7277448e05357f5fd8d4cb2f9b9b7446e41c872cceaac4": { - "signature": "15c51590a2e2bb503a7277448e05357f5fd8d4cb2f9b9b7446e41c872cceaac4", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Javax.Security.Auth.Callback.PasswordCallback API documentation with generic example password.", - "createdDate": "2024-02-21 20:58:02Z" - }, - "1ccf925aa704efd1035bac38e94d2e629fb5b0d1784d5473e4a52e6d13db16ee": { - "signature": "1ccf925aa704efd1035bac38e94d2e629fb5b0d1784d5473e4a52e6d13db16ee", - "alternativeSignatures": [], - "memberOf": [ - "default" - ], - "justification": "Dummy test.keystore file used for testing.", - "createdDate": "2024-02-21 20:58:02Z" } } } diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 6f07d3a56a7..6f04eb8ce2f 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -85,7 +85,7 @@ extends: codeql: runSourceLanguagesInSourceAnalysis: true suppression: - suppressionFile: $(Build.SourcesDirectory)\.gdn\source.gdnsuppress + suppressionFile: $(Build.SourcesDirectory)\.gdn\.gdnsuppress sourceAnalysisPool: name: AzurePipelines-EO image: $(WindowsPoolImage1ESPT) @@ -637,8 +637,8 @@ extends: stageDependsOn: [] tsaConfigFile: $(Build.SourcesDirectory)\.gdn\tsaoptions-v2.json policheckLocScanEnabled: true - policheckExclusionFilesFolder: $(Build.SourcesDirectory)\.gdn - policheckGdnSuppressionFilesFolder: $(Build.SourcesDirectory)\.gdn + policheckExclusionFilesFolder: $(Build.SourcesDirectory)\.gdn\policheck + policheckGdnSuppressionFilesFolder: $(Build.SourcesDirectory)\.gdn\policheck policheckChsScanFolder: $(Build.SourcesDirectory)\Localize\loc\zh-Hans policheckChtScanFolder: $(Build.SourcesDirectory)\Localize\loc\zh-Hant policheckCsyScanFolder: $(Build.SourcesDirectory)\Localize\loc\cs From 93851857e7a8d8b21bdbc0dde697863390ee5bff Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Thu, 22 Feb 2024 17:26:46 -0800 Subject: [PATCH 20/36] Remove dupe folder --- .gdn/.gdn/policheck/CHT.gdnsuppress | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 .gdn/.gdn/policheck/CHT.gdnsuppress diff --git a/.gdn/.gdn/policheck/CHT.gdnsuppress b/.gdn/.gdn/policheck/CHT.gdnsuppress deleted file mode 100644 index 75469b1ed33..00000000000 --- a/.gdn/.gdn/policheck/CHT.gdnsuppress +++ /dev/null @@ -1,9 +0,0 @@ -{ - "hydrated": false, - "properties": { - "helpUri": "https://eng.ms/docs/microsoft-security/security/azure-security/cloudai-security-fundamentals-engineering/security-integration/guardian-wiki/microsoft-guardian/general/suppressions", - "hydrationStatus": "This file does not contain identifying data. It is safe to check into your repo. To hydrate this file with identifying data, run `guardian hydrate --help` and follow the guidance." - }, - "version": "1.0.0", - - } \ No newline at end of file From c997c207b9bad1a34f0b4817b79344af760960dc Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Mon, 26 Feb 2024 13:18:50 -0800 Subject: [PATCH 21/36] Update sdl task params --- build-tools/automation/azure-pipelines.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 6f04eb8ce2f..3071dd580ea 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -82,10 +82,16 @@ extends: sdl: ${{ if eq('${{ parameters.Skip1ESComplianceTasks }}', 'true') }}: enableAllTools: false + binskim: + scanOutputDirectoryOnly: true codeql: runSourceLanguagesInSourceAnalysis: true - suppression: - suppressionFile: $(Build.SourcesDirectory)\.gdn\.gdnsuppress + policheck: + enabled: false + justification: Built in task does not support multi-language scanning + spotBugs: + enabled: false + justification: 'Failing with "Could not successfully find the java tool launcher"' sourceAnalysisPool: name: AzurePipelines-EO image: $(WindowsPoolImage1ESPT) @@ -96,6 +102,8 @@ extends: exclude: - repository: yaml-templates - repository: maui + suppression: + suppressionFile: $(Build.SourcesDirectory)\.gdn\.gdnsuppress # Stage and Job "display names" are shortened because they are combined to form the name of the corresponding GitHub check. stages: - template: /build-tools/automation/yaml-templates/build-macos.yaml@self From 0b900877c377192a66c3e730f6a50d366705dca7 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Mon, 26 Feb 2024 17:28:10 -0800 Subject: [PATCH 22/36] Use yaml templates main --- build-tools/automation/azure-pipelines.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 3071dd580ea..044de1f28e9 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -18,7 +18,7 @@ resources: - repository: yaml-templates type: github name: xamarin/yaml-templates - ref: refs/heads/dev/pjc/1es-nuget-convert + ref: refs/heads/main endpoint: xamarin - repository: sdk-insertions type: github From 1f323ee46f7316628251dca0ecfe88a57f90473b Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Wed, 28 Feb 2024 09:43:27 -0800 Subject: [PATCH 23/36] Test new windows pool --- build-tools/automation/yaml-templates/stage-msbuild-tests.yaml | 2 +- build-tools/automation/yaml-templates/variables.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml b/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml index 8ff13943c97..a9eff7fb75a 100644 --- a/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml +++ b/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml @@ -32,7 +32,7 @@ stages: testOS: Windows jobName: win_msbuild_tests jobDisplayName: Windows > Tests > MSBuild - agentCount: 12 + agentCount: 6 xaSourcePath: ${{ parameters.xaSourcePath }} repositoryAlias: ${{ parameters.repositoryAlias }} commit: ${{ parameters.commit }} diff --git a/build-tools/automation/yaml-templates/variables.yaml b/build-tools/automation/yaml-templates/variables.yaml index 2f1a330c16c..3bb985a8d42 100644 --- a/build-tools/automation/yaml-templates/variables.yaml +++ b/build-tools/automation/yaml-templates/variables.yaml @@ -36,7 +36,7 @@ variables: - name: 1ESWindowsPool value: android-win-2022 - name: WindowsPoolImage1ESPT - value: 1ESPT-Windows2022 + value: MAUI-1ESPT-Windows2022 - name: LinuxPoolImage1ESPT value: 1ESPT-Ubuntu22.04 - name: VSEngMicroBuildPool From 80572d06dce6043daee12b6ea3c28554eeb54ebb Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Wed, 28 Feb 2024 09:54:04 -0800 Subject: [PATCH 24/36] Use new win pool --- build-tools/automation/azure-pipelines.yaml | 3 +-- build-tools/automation/yaml-templates/build-windows.yaml | 3 +-- .../automation/yaml-templates/run-msbuild-tests.yaml | 3 +-- build-tools/automation/yaml-templates/variables.yaml | 6 +++--- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 044de1f28e9..c1b73d700d4 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -343,8 +343,7 @@ extends: - job: maui_tests_integration displayName: MAUI Integration pool: - name: AzurePipelines-EO - image: $(WindowsPoolImage1ESPT) + name: $(WindowsPoolNameMaui1ESPT) os: windows timeoutInMinutes: 180 workspace: diff --git a/build-tools/automation/yaml-templates/build-windows.yaml b/build-tools/automation/yaml-templates/build-windows.yaml index 74ba17fe244..136dc1d3596 100644 --- a/build-tools/automation/yaml-templates/build-windows.yaml +++ b/build-tools/automation/yaml-templates/build-windows.yaml @@ -23,8 +23,7 @@ stages: - job: ${{ parameters.jobName }} displayName: ${{ parameters.jobDisplayName }} pool: - name: AzurePipelines-EO - image: $(WindowsPoolImage1ESPT) + name: $(WindowsPoolNameMaui1ESPT) os: windows timeoutInMinutes: 240 steps: diff --git a/build-tools/automation/yaml-templates/run-msbuild-tests.yaml b/build-tools/automation/yaml-templates/run-msbuild-tests.yaml index 404f95352c9..fb669482cf4 100644 --- a/build-tools/automation/yaml-templates/run-msbuild-tests.yaml +++ b/build-tools/automation/yaml-templates/run-msbuild-tests.yaml @@ -16,8 +16,7 @@ jobs: displayName: ${{ parameters.jobDisplayName }} ${{ if eq(parameters.testOS, 'Windows') }}: pool: - name: AzurePipelines-EO - image: $(WindowsPoolImage1ESPT) + name: $(WindowsPoolNameMaui1ESPT) os: windows ${{ if eq(parameters.testOS, 'macOS') }}: pool: diff --git a/build-tools/automation/yaml-templates/variables.yaml b/build-tools/automation/yaml-templates/variables.yaml index 3bb985a8d42..1e935f785f7 100644 --- a/build-tools/automation/yaml-templates/variables.yaml +++ b/build-tools/automation/yaml-templates/variables.yaml @@ -33,10 +33,10 @@ variables: value: macOS-13 - name: HostedWinImage value: windows-2022 -- name: 1ESWindowsPool - value: android-win-2022 -- name: WindowsPoolImage1ESPT +- name: WindowsPoolNameMaui1ESPT value: MAUI-1ESPT-Windows2022 +- name: WindowsPoolImage1ESPT + value: 1ESPT-Windows2022 - name: LinuxPoolImage1ESPT value: 1ESPT-Ubuntu22.04 - name: VSEngMicroBuildPool From 45f3b6f608754b54554ec8c374785d3d41b0aab3 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Wed, 28 Feb 2024 11:58:11 -0800 Subject: [PATCH 25/36] Invoke boots with pwsh, diagnostic install --- build-tools/automation/yaml-templates/install-global-tool.yaml | 2 +- .../automation/yaml-templates/setup-test-environment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build-tools/automation/yaml-templates/install-global-tool.yaml b/build-tools/automation/yaml-templates/install-global-tool.yaml index 69ac8c28583..c35b73389b5 100644 --- a/build-tools/automation/yaml-templates/install-global-tool.yaml +++ b/build-tools/automation/yaml-templates/install-global-tool.yaml @@ -18,6 +18,6 @@ steps: command: custom custom: tool arguments: >- - update ${{ parameters.toolName }} -g + update ${{ parameters.toolName }} -g -v:diag --version ${{ parameters.version }} --add-source "https://api.nuget.org/v3/index.json" diff --git a/build-tools/automation/yaml-templates/setup-test-environment.yaml b/build-tools/automation/yaml-templates/setup-test-environment.yaml index 6f6fc91f6c1..6a81c412339 100644 --- a/build-tools/automation/yaml-templates/setup-test-environment.yaml +++ b/build-tools/automation/yaml-templates/setup-test-environment.yaml @@ -65,7 +65,7 @@ steps: toolName: boots version: $(BootsToolVersion) continueOnError: false - - powershell: boots --stable Xamarin.Android + - pwsh: boots --stable Xamarin.Android displayName: install Xamarin.Android stable - template: /build-tools/automation/yaml-templates/run-xaprepare.yaml@self From fbff67072c61dc0d83cec21a1d5b25a18ca3840e Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Wed, 28 Feb 2024 14:02:13 -0800 Subject: [PATCH 26/36] Install dotnet tools locally and prepend path --- .../automation/yaml-templates/build-windows.yaml | 11 ++++++++++- ...tall-global-tool.yaml => install-dotnet-tool.yaml} | 6 +++++- .../yaml-templates/setup-test-environment.yaml | 6 +++--- 3 files changed, 18 insertions(+), 5 deletions(-) rename build-tools/automation/yaml-templates/{install-global-tool.yaml => install-dotnet-tool.yaml} (72%) diff --git a/build-tools/automation/yaml-templates/build-windows.yaml b/build-tools/automation/yaml-templates/build-windows.yaml index 136dc1d3596..5d4221ddd3b 100644 --- a/build-tools/automation/yaml-templates/build-windows.yaml +++ b/build-tools/automation/yaml-templates/build-windows.yaml @@ -46,6 +46,15 @@ stages: parameters: remove_dotnet: true + - template: /build-tools/automation/yaml-templates/install-dotnet-tool.yaml@self + parameters: + toolName: boots + version: $(BootsToolVersion) + continueOnError: false + - pwsh: boots --stable Xamarin.Android + displayName: install Xamarin.Android stable + + - task: DotNetCoreCLI@2 displayName: Prepare Solution inputs: @@ -62,7 +71,7 @@ stages: displayName: Build Solution continueOnError: false - - template: /build-tools/automation/yaml-templates/install-global-tool.yaml@self + - template: /build-tools/automation/yaml-templates/install-dotnet-tool.yaml@self parameters: toolName: apkdiff version: $(ApkDiffToolVersion) diff --git a/build-tools/automation/yaml-templates/install-global-tool.yaml b/build-tools/automation/yaml-templates/install-dotnet-tool.yaml similarity index 72% rename from build-tools/automation/yaml-templates/install-global-tool.yaml rename to build-tools/automation/yaml-templates/install-dotnet-tool.yaml index c35b73389b5..9ba521f7b40 100644 --- a/build-tools/automation/yaml-templates/install-global-tool.yaml +++ b/build-tools/automation/yaml-templates/install-dotnet-tool.yaml @@ -18,6 +18,10 @@ steps: command: custom custom: tool arguments: >- - update ${{ parameters.toolName }} -g -v:diag + update ${{ parameters.toolName }} -v:diag + --tool-path $(Agent.ToolsDirectory)/android-tools --version ${{ parameters.version }} --add-source "https://api.nuget.org/v3/index.json" + +- script: echo "##vso[task.prependpath]$(Agent.ToolsDirectory)/android-tools" + displayName: add $(Agent.ToolsDirectory)/android-tools to path diff --git a/build-tools/automation/yaml-templates/setup-test-environment.yaml b/build-tools/automation/yaml-templates/setup-test-environment.yaml index 6a81c412339..d31a2ee5e01 100644 --- a/build-tools/automation/yaml-templates/setup-test-environment.yaml +++ b/build-tools/automation/yaml-templates/setup-test-environment.yaml @@ -60,7 +60,7 @@ steps: xaSourcePath: ${{ parameters.xaSourcePath }} - ${{ if eq(parameters.installLegacyXamarinAndroid, true) }}: - - template: /build-tools/automation/yaml-templates/install-global-tool.yaml@self + - template: /build-tools/automation/yaml-templates/install-dotnet-tool.yaml@self parameters: toolName: boots version: $(BootsToolVersion) @@ -98,13 +98,13 @@ steps: arguments: -t:ExtractWorkloadPacks -c ${{ parameters.configuration }} -v:n -bl:${{ parameters.xaSourcePath }}/bin/Test${{ parameters.configuration }}/extract-workloads.binlog - ${{ if eq(parameters.installApkDiff, true) }}: - - template: /build-tools/automation/yaml-templates/install-global-tool.yaml@self + - template: /build-tools/automation/yaml-templates/install-dotnet-tool.yaml@self parameters: toolName: apkdiff version: $(ApkDiffToolVersion) - ${{ if eq(parameters.installTestSlicer, true) }}: - - template: /build-tools/automation/yaml-templates/install-global-tool.yaml@self + - template: /build-tools/automation/yaml-templates/install-dotnet-tool.yaml@self parameters: toolName: dotnet-test-slicer version: $(TestSlicerToolVersion) From fac7da67923c533e5ed29c3f01c404d8145a6cca Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Wed, 28 Feb 2024 14:24:58 -0800 Subject: [PATCH 27/36] Try full tool path --- build-tools/automation/yaml-templates/build-windows.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/automation/yaml-templates/build-windows.yaml b/build-tools/automation/yaml-templates/build-windows.yaml index 5d4221ddd3b..b9d5cafeee6 100644 --- a/build-tools/automation/yaml-templates/build-windows.yaml +++ b/build-tools/automation/yaml-templates/build-windows.yaml @@ -51,7 +51,7 @@ stages: toolName: boots version: $(BootsToolVersion) continueOnError: false - - pwsh: boots --stable Xamarin.Android + - pwsh: $(Agent.ToolsDirectory)/android-tools/boots --stable Xamarin.Android displayName: install Xamarin.Android stable From fbe295f912196e8630354f428013632a7407a498 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Wed, 28 Feb 2024 14:40:17 -0800 Subject: [PATCH 28/36] Use full tool paths --- build-tools/automation/yaml-templates/build-windows.yaml | 9 --------- .../yaml-templates/run-sliced-nunit-tests.yaml | 6 +++--- .../yaml-templates/setup-test-environment.yaml | 2 +- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/build-tools/automation/yaml-templates/build-windows.yaml b/build-tools/automation/yaml-templates/build-windows.yaml index b9d5cafeee6..2844ef04ce1 100644 --- a/build-tools/automation/yaml-templates/build-windows.yaml +++ b/build-tools/automation/yaml-templates/build-windows.yaml @@ -46,15 +46,6 @@ stages: parameters: remove_dotnet: true - - template: /build-tools/automation/yaml-templates/install-dotnet-tool.yaml@self - parameters: - toolName: boots - version: $(BootsToolVersion) - continueOnError: false - - pwsh: $(Agent.ToolsDirectory)/android-tools/boots --stable Xamarin.Android - displayName: install Xamarin.Android stable - - - task: DotNetCoreCLI@2 displayName: Prepare Solution inputs: diff --git a/build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml b/build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml index d96155e099b..51705f5f7a2 100644 --- a/build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml +++ b/build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml @@ -8,7 +8,7 @@ parameters: steps: - ${{if parameters.testFilter}}: - pwsh: >- - dotnet-test-slicer slice + $(Agent.ToolsDirectory)/android-tools/dotnet-test-slicer slice --test-assembly="${{ parameters.testAssembly }}" --test-filter="${{ parameters.testFilter }}" --slice-number=$(System.JobPositionInPhase) @@ -18,7 +18,7 @@ steps: failOnStderr: true - ${{ else }}: - pwsh: >- - dotnet-test-slicer slice + $(Agent.ToolsDirectory)/android-tools/dotnet-test-slicer slice --test-assembly="${{ parameters.testAssembly }}" --slice-number=$(System.JobPositionInPhase) --total-slices=$(System.TotalJobsInPhase) @@ -49,7 +49,7 @@ steps: workingDirectory: ${{ parameters.xaSourcePath }} - pwsh: | - dotnet-test-slicer ` + $(Agent.ToolsDirectory)/android-tools/dotnet-test-slicer ` retry ` --trx="$(Agent.TempDirectory)" ` --outfile="${{ parameters.testAssembly }}.runsettings" diff --git a/build-tools/automation/yaml-templates/setup-test-environment.yaml b/build-tools/automation/yaml-templates/setup-test-environment.yaml index d31a2ee5e01..00b056ddeea 100644 --- a/build-tools/automation/yaml-templates/setup-test-environment.yaml +++ b/build-tools/automation/yaml-templates/setup-test-environment.yaml @@ -65,7 +65,7 @@ steps: toolName: boots version: $(BootsToolVersion) continueOnError: false - - pwsh: boots --stable Xamarin.Android + - pwsh: $(Agent.ToolsDirectory)/android-tools/boots --stable Xamarin.Android displayName: install Xamarin.Android stable - template: /build-tools/automation/yaml-templates/run-xaprepare.yaml@self From b65dea86d4314f5886da4410260afbe4e931d600 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Thu, 29 Feb 2024 08:53:55 -0800 Subject: [PATCH 29/36] Try to reenable static macos PR build pool --- build-tools/automation/azure-pipelines.yaml | 17 +++-------------- .../automation/yaml-templates/build-macos.yaml | 14 ++++++-------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index c1b73d700d4..86f06c2687c 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -56,22 +56,11 @@ variables: - ${{ if ne(variables['Build.DefinitionName'], 'Xamarin.Android-Private') }}: - name: DotNetFeedCredential value: dnceng-dotnet9 -- ${{ if and(or(eq(variables['Build.DefinitionName'], 'Xamarin.Android'), eq(variables['Build.DefinitionName'], 'Xamarin.Android-Private')), ne(variables['Build.Reason'], 'PullRequest')) }}: - - name: MicroBuildSignType +- name: MicroBuildSignType + ${{ if and(or(eq(variables['Build.DefinitionName'], 'Xamarin.Android'), eq(variables['Build.DefinitionName'], 'Xamarin.Android-Private')), ne(variables['Build.Reason'], 'PullRequest')) }}: value: Real - - name: MacBuildPoolName - value: Azure Pipelines - - name: MacBuildPoolImage - value: macOS-13 -- ${{ if or(and(ne(variables['Build.DefinitionName'],'Xamarin.Android'), ne(variables['Build.DefinitionName'], 'Xamarin.Android-Private')), eq(variables['Build.Reason'], 'PullRequest')) }}: - - name: MicroBuildSignType + ${{ else }}: value: Test - - name: MacBuildPoolName - value: VSEng-Xamarin-RedmondMac-Android-Untrusted - - name: MacBuildPoolImage - value: '' - - name: DisablePipelineConfigDetector - value: true extends: ${{ if eq(variables['MicroBuildSignType'], 'Real') }}: diff --git a/build-tools/automation/yaml-templates/build-macos.yaml b/build-tools/automation/yaml-templates/build-macos.yaml index aa92c77890d..74f7aed02c1 100644 --- a/build-tools/automation/yaml-templates/build-macos.yaml +++ b/build-tools/automation/yaml-templates/build-macos.yaml @@ -28,15 +28,13 @@ stages: - job: ${{ parameters.jobName }} displayName: ${{ parameters.jobDisplayName }} pool: - name: Azure Pipelines - vmImage: $(HostedMacImage) + ${{ if eq(variables['MicroBuildSignType'], 'Real') }}: + name: Azure Pipelines + vmImage: $(HostedMacImage) + ${{ else }}: + name: VSEng-Xamarin-RedmondMac-Android-Untrusted + demands: macOS.Name -equals Monterey os: macOS - #pool: - # name: $(MacBuildPoolName) - # vmImage: $(MacBuildPoolImage) - # os: macOS - # ${{ if ne(variables['MicroBuildSignType'], 'Real') }}: - # demands: macOS.Name -equals Monterey timeoutInMinutes: 240 cancelTimeoutInMinutes: 5 workspace: From 536df9a62b6c702801e1532706ea33972a485709 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Thu, 29 Feb 2024 09:14:00 -0800 Subject: [PATCH 30/36] Try MAUI-DevDiv pool --- build-tools/automation/yaml-templates/variables.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/automation/yaml-templates/variables.yaml b/build-tools/automation/yaml-templates/variables.yaml index 1e935f785f7..955fb28628c 100644 --- a/build-tools/automation/yaml-templates/variables.yaml +++ b/build-tools/automation/yaml-templates/variables.yaml @@ -34,7 +34,7 @@ variables: - name: HostedWinImage value: windows-2022 - name: WindowsPoolNameMaui1ESPT - value: MAUI-1ESPT-Windows2022 + value: MAUI-DevDiv - name: WindowsPoolImage1ESPT value: 1ESPT-Windows2022 - name: LinuxPoolImage1ESPT From 03532f33eb7d0928ea120541826afd0b851c1acc Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Thu, 29 Feb 2024 12:33:48 -0800 Subject: [PATCH 31/36] Test new MAUI-1ESPT pool --- build-tools/automation/azure-pipelines.yaml | 5 +++-- build-tools/automation/yaml-templates/build-linux.yaml | 2 +- build-tools/automation/yaml-templates/build-windows.yaml | 3 ++- build-tools/automation/yaml-templates/run-msbuild-tests.yaml | 3 ++- build-tools/automation/yaml-templates/variables.yaml | 2 -- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 86f06c2687c..2a38d46e14d 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -266,7 +266,7 @@ extends: - job: linux_tests_smoke displayName: Linux > Tests > MSBuild pool: - name: AzurePipelines-EO + name: Maui-1ESPT image: $(LinuxPoolImage1ESPT) os: linux timeoutInMinutes: 180 @@ -332,7 +332,8 @@ extends: - job: maui_tests_integration displayName: MAUI Integration pool: - name: $(WindowsPoolNameMaui1ESPT) + name: Maui-1ESPT + image: $(WindowsPoolImage1ESPT) os: windows timeoutInMinutes: 180 workspace: diff --git a/build-tools/automation/yaml-templates/build-linux.yaml b/build-tools/automation/yaml-templates/build-linux.yaml index 03ca42267fd..5440ab5a6b4 100644 --- a/build-tools/automation/yaml-templates/build-linux.yaml +++ b/build-tools/automation/yaml-templates/build-linux.yaml @@ -23,7 +23,7 @@ stages: - job: ${{ parameters.jobName }} displayName: ${{ parameters.jobDisplayName }} pool: - name: AzurePipelines-EO + name: Maui-1ESPT image: $(LinuxPoolImage1ESPT) os: linux timeoutInMinutes: 240 diff --git a/build-tools/automation/yaml-templates/build-windows.yaml b/build-tools/automation/yaml-templates/build-windows.yaml index 2844ef04ce1..866aadf2ac7 100644 --- a/build-tools/automation/yaml-templates/build-windows.yaml +++ b/build-tools/automation/yaml-templates/build-windows.yaml @@ -23,7 +23,8 @@ stages: - job: ${{ parameters.jobName }} displayName: ${{ parameters.jobDisplayName }} pool: - name: $(WindowsPoolNameMaui1ESPT) + name: Maui-1ESPT + image: $(WindowsPoolImage1ESPT) os: windows timeoutInMinutes: 240 steps: diff --git a/build-tools/automation/yaml-templates/run-msbuild-tests.yaml b/build-tools/automation/yaml-templates/run-msbuild-tests.yaml index fb669482cf4..052f2bc9458 100644 --- a/build-tools/automation/yaml-templates/run-msbuild-tests.yaml +++ b/build-tools/automation/yaml-templates/run-msbuild-tests.yaml @@ -16,7 +16,8 @@ jobs: displayName: ${{ parameters.jobDisplayName }} ${{ if eq(parameters.testOS, 'Windows') }}: pool: - name: $(WindowsPoolNameMaui1ESPT) + name: Maui-1ESPT + image: $(WindowsPoolImage1ESPT) os: windows ${{ if eq(parameters.testOS, 'macOS') }}: pool: diff --git a/build-tools/automation/yaml-templates/variables.yaml b/build-tools/automation/yaml-templates/variables.yaml index 955fb28628c..e9398268781 100644 --- a/build-tools/automation/yaml-templates/variables.yaml +++ b/build-tools/automation/yaml-templates/variables.yaml @@ -33,8 +33,6 @@ variables: value: macOS-13 - name: HostedWinImage value: windows-2022 -- name: WindowsPoolNameMaui1ESPT - value: MAUI-DevDiv - name: WindowsPoolImage1ESPT value: 1ESPT-Windows2022 - name: LinuxPoolImage1ESPT From 5bf687ca765182f12ad1de0755b5d73747386641 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Thu, 29 Feb 2024 14:16:18 -0800 Subject: [PATCH 32/36] Update names, dotnet tool install path and lookup --- build-tools/automation/azure-pipelines.yaml | 12 +++++------- .../automation/yaml-templates/build-linux.yaml | 3 ++- .../automation/yaml-templates/build-macos.yaml | 2 +- .../automation/yaml-templates/build-windows.yaml | 4 ++-- .../yaml-templates/install-dotnet-tool.yaml | 6 +++--- .../automation/yaml-templates/run-msbuild-tests.yaml | 2 +- .../yaml-templates/run-sliced-nunit-tests.yaml | 6 +++--- .../yaml-templates/setup-test-environment.yaml | 2 +- .../Utilities/BaseTest.cs | 12 +++++++++--- 9 files changed, 27 insertions(+), 22 deletions(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 2a38d46e14d..b59aac5362b 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -93,20 +93,18 @@ extends: - repository: maui suppression: suppressionFile: $(Build.SourcesDirectory)\.gdn\.gdnsuppress - # Stage and Job "display names" are shortened because they are combined to form the name of the corresponding GitHub check. stages: - template: /build-tools/automation/yaml-templates/build-macos.yaml@self - template: /build-tools/automation/yaml-templates/build-windows.yaml@self - # Check - "Xamarin.Android (Linux > Build)" - template: /build-tools/automation/yaml-templates/build-linux.yaml@self - stage: smoke_tests displayName: Package Tests dependsOn: mac_build jobs: - # Check - "Xamarin.Android (macOS > Tests > APKs .NET)" + # Check - "Xamarin.Android (Package Tests macOS > Tests > APKs .NET)" - job: mac_apk_tests_net displayName: macOS > Tests > APKs .NET pool: @@ -262,11 +260,11 @@ extends: - mac_build - linux_build jobs: - # Check - "Xamarin.Android (Linux > Tests > MSBuild)" + # Check - "Xamarin.Android (Linux Tests Linux > Tests > MSBuild)" - job: linux_tests_smoke displayName: Linux > Tests > MSBuild pool: - name: Maui-1ESPT + name: MAUI-1ESPT image: $(LinuxPoolImage1ESPT) os: linux timeoutInMinutes: 180 @@ -332,7 +330,7 @@ extends: - job: maui_tests_integration displayName: MAUI Integration pool: - name: Maui-1ESPT + name: AzurePipelines-EO image: $(WindowsPoolImage1ESPT) os: windows timeoutInMinutes: 180 @@ -627,7 +625,7 @@ extends: artifactName: Prepare Release - Push Internal includeBuildResults: true - # Check - "Xamarin.Android (PoliCheck)" + # Check - "Xamarin.Android (PoliCheck PoliCheck $(Language))" - template: security/policheck/v3.yml@yaml-templates parameters: windowsImageOverride: $(WindowsPoolImage1ESPT) diff --git a/build-tools/automation/yaml-templates/build-linux.yaml b/build-tools/automation/yaml-templates/build-linux.yaml index 5440ab5a6b4..673270ca735 100644 --- a/build-tools/automation/yaml-templates/build-linux.yaml +++ b/build-tools/automation/yaml-templates/build-linux.yaml @@ -20,10 +20,11 @@ stages: ${{ if and(ne(parameters.dependsOn, ''), ne(parameters.dependsOnResult, '')) }}: condition: eq(dependencies.${{ parameters.dependsOn }}.result, '${{ parameters.dependsOnResult }}') jobs: + # Check - "Xamarin.Android (Linux Linux > Build)" - job: ${{ parameters.jobName }} displayName: ${{ parameters.jobDisplayName }} pool: - name: Maui-1ESPT + name: MAUI-1ESPT image: $(LinuxPoolImage1ESPT) os: linux timeoutInMinutes: 240 diff --git a/build-tools/automation/yaml-templates/build-macos.yaml b/build-tools/automation/yaml-templates/build-macos.yaml index 74f7aed02c1..e2a88a7a1f3 100644 --- a/build-tools/automation/yaml-templates/build-macos.yaml +++ b/build-tools/automation/yaml-templates/build-macos.yaml @@ -24,7 +24,7 @@ stages: ${{ if and(ne(parameters.dependsOn, ''), ne(parameters.dependsOnResult, '')) }}: condition: eq(dependencies.${{ parameters.dependsOn }}.result, '${{ parameters.dependsOnResult }}') jobs: - # Check - "Xamarin.Android (macOS > Build)" + # Check - "Xamarin.Android (Mac macOS > Build)" - job: ${{ parameters.jobName }} displayName: ${{ parameters.jobDisplayName }} pool: diff --git a/build-tools/automation/yaml-templates/build-windows.yaml b/build-tools/automation/yaml-templates/build-windows.yaml index 866aadf2ac7..e3867113a22 100644 --- a/build-tools/automation/yaml-templates/build-windows.yaml +++ b/build-tools/automation/yaml-templates/build-windows.yaml @@ -19,11 +19,11 @@ stages: ${{ if and(ne(parameters.dependsOn, ''), ne(parameters.dependsOnResult, '')) }}: condition: eq(dependencies.${{ parameters.dependsOn }}.result, '${{ parameters.dependsOnResult }}') jobs: - # Check - "Xamarin.Android (Windows > Build & Smoke Test)" + # Check - "Xamarin.Android (Windows Windows > Build & Smoke Test)" - job: ${{ parameters.jobName }} displayName: ${{ parameters.jobDisplayName }} pool: - name: Maui-1ESPT + name: MAUI-1ESPT image: $(WindowsPoolImage1ESPT) os: windows timeoutInMinutes: 240 diff --git a/build-tools/automation/yaml-templates/install-dotnet-tool.yaml b/build-tools/automation/yaml-templates/install-dotnet-tool.yaml index 9ba521f7b40..65e9cf02243 100644 --- a/build-tools/automation/yaml-templates/install-dotnet-tool.yaml +++ b/build-tools/automation/yaml-templates/install-dotnet-tool.yaml @@ -19,9 +19,9 @@ steps: custom: tool arguments: >- update ${{ parameters.toolName }} -v:diag - --tool-path $(Agent.ToolsDirectory)/android-tools + --tool-path $(Agent.ToolsDirectory) --version ${{ parameters.version }} --add-source "https://api.nuget.org/v3/index.json" -- script: echo "##vso[task.prependpath]$(Agent.ToolsDirectory)/android-tools" - displayName: add $(Agent.ToolsDirectory)/android-tools to path +- script: echo "##vso[task.prependpath]$(Agent.ToolsDirectory)" + displayName: add $(Agent.ToolsDirectory) to path diff --git a/build-tools/automation/yaml-templates/run-msbuild-tests.yaml b/build-tools/automation/yaml-templates/run-msbuild-tests.yaml index 052f2bc9458..62be739a9a9 100644 --- a/build-tools/automation/yaml-templates/run-msbuild-tests.yaml +++ b/build-tools/automation/yaml-templates/run-msbuild-tests.yaml @@ -16,7 +16,7 @@ jobs: displayName: ${{ parameters.jobDisplayName }} ${{ if eq(parameters.testOS, 'Windows') }}: pool: - name: Maui-1ESPT + name: MAUI-1ESPT image: $(WindowsPoolImage1ESPT) os: windows ${{ if eq(parameters.testOS, 'macOS') }}: diff --git a/build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml b/build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml index 51705f5f7a2..b81af9b0943 100644 --- a/build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml +++ b/build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml @@ -8,7 +8,7 @@ parameters: steps: - ${{if parameters.testFilter}}: - pwsh: >- - $(Agent.ToolsDirectory)/android-tools/dotnet-test-slicer slice + $(Agent.ToolsDirectory)/dotnet-test-slicer slice --test-assembly="${{ parameters.testAssembly }}" --test-filter="${{ parameters.testFilter }}" --slice-number=$(System.JobPositionInPhase) @@ -18,7 +18,7 @@ steps: failOnStderr: true - ${{ else }}: - pwsh: >- - $(Agent.ToolsDirectory)/android-tools/dotnet-test-slicer slice + $(Agent.ToolsDirectory)/dotnet-test-slicer slice --test-assembly="${{ parameters.testAssembly }}" --slice-number=$(System.JobPositionInPhase) --total-slices=$(System.TotalJobsInPhase) @@ -49,7 +49,7 @@ steps: workingDirectory: ${{ parameters.xaSourcePath }} - pwsh: | - $(Agent.ToolsDirectory)/android-tools/dotnet-test-slicer ` + $(Agent.ToolsDirectory)/dotnet-test-slicer ` retry ` --trx="$(Agent.TempDirectory)" ` --outfile="${{ parameters.testAssembly }}.runsettings" diff --git a/build-tools/automation/yaml-templates/setup-test-environment.yaml b/build-tools/automation/yaml-templates/setup-test-environment.yaml index 00b056ddeea..45901d9770a 100644 --- a/build-tools/automation/yaml-templates/setup-test-environment.yaml +++ b/build-tools/automation/yaml-templates/setup-test-environment.yaml @@ -65,7 +65,7 @@ steps: toolName: boots version: $(BootsToolVersion) continueOnError: false - - pwsh: $(Agent.ToolsDirectory)/android-tools/boots --stable Xamarin.Android + - pwsh: $(Agent.ToolsDirectory)/boots --stable Xamarin.Android displayName: install Xamarin.Android stable - template: /build-tools/automation/yaml-templates/run-xaprepare.yaml@self diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/BaseTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/BaseTest.cs index 8a909c4b752..440c5656f73 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/BaseTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/BaseTest.cs @@ -108,10 +108,16 @@ protected static (int code, string stdOutput, string stdError) RunApkDiffCommand try { return RunProcessWithExitCode ("apkdiff" + ext, args); } catch (System.ComponentModel.Win32Exception) { - // apkdiff's location might not be in the $PATH, try known location + // apkdiff's location might not be in the $PATH, try known locations var profileDir = Environment.GetFolderPath (Environment.SpecialFolder.UserProfile); - - return RunProcessWithExitCode (Path.Combine (profileDir, ".dotnet", "tools", "apkdiff" + ext), args); + var apkdiffPath = Path.Combine (profileDir, ".dotnet", "tools", "apkdiff" + ext); + if (!File.Exists (apkdiffPath)) { + var agentToolsDir = Environment.GetEnvironmentVariable ("AGENT_TOOLSDIRECTORY"); + if (Directory.Exists (agentToolsDir)) { + apkdiffPath = Path.Combine (agentToolsDir, "apkdiff" + ext); + } + } + return RunProcessWithExitCode (apkdiffPath, args); } } From ff8af4f195796d5d25f9671afd0a23ba24e841c9 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Thu, 29 Feb 2024 15:14:12 -0800 Subject: [PATCH 33/36] Fix macos pool condition --- build-tools/automation/yaml-templates/build-macos.yaml | 2 +- .../automation/yaml-templates/commercial-build.yaml | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/build-tools/automation/yaml-templates/build-macos.yaml b/build-tools/automation/yaml-templates/build-macos.yaml index e2a88a7a1f3..e62fdc933c8 100644 --- a/build-tools/automation/yaml-templates/build-macos.yaml +++ b/build-tools/automation/yaml-templates/build-macos.yaml @@ -28,7 +28,7 @@ stages: - job: ${{ parameters.jobName }} displayName: ${{ parameters.jobDisplayName }} pool: - ${{ if eq(variables['MicroBuildSignType'], 'Real') }}: + ${{ if and(or(eq(variables['Build.DefinitionName'], 'Xamarin.Android'), eq(variables['Build.DefinitionName'], 'Xamarin.Android-Private')), ne(variables['Build.Reason'], 'PullRequest')) }}: name: Azure Pipelines vmImage: $(HostedMacImage) ${{ else }}: diff --git a/build-tools/automation/yaml-templates/commercial-build.yaml b/build-tools/automation/yaml-templates/commercial-build.yaml index d8937b1f877..7024dbd6dc5 100644 --- a/build-tools/automation/yaml-templates/commercial-build.yaml +++ b/build-tools/automation/yaml-templates/commercial-build.yaml @@ -28,13 +28,6 @@ steps: # https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops#checkout-path - checkout: maui -- script: > - ls -l /Applications && - sudo xcode-select --switch /Applications/Xcode_14.2.app && - xcode-select --print-path - displayName: Use Xcode 14.2 - condition: and(succeeded(), eq(variables['MicroBuildSignType'], 'Real')) - - ${{ if ne(variables['System.PullRequest.IsFork'], 'True') }}: # Clone 'monodroid' without submodules - checkout: monodroid From a839e16c5f48b623b17a263331fc755d80b7003f Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Fri, 1 Mar 2024 12:42:16 -0800 Subject: [PATCH 34/36] Testing powershell on image --- build-tools/automation/azure-pipelines.yaml | 2 +- build-tools/automation/yaml-templates/build-windows.yaml | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index b59aac5362b..b8102110abc 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -330,7 +330,7 @@ extends: - job: maui_tests_integration displayName: MAUI Integration pool: - name: AzurePipelines-EO + name: MAUI-1ESPT image: $(WindowsPoolImage1ESPT) os: windows timeoutInMinutes: 180 diff --git a/build-tools/automation/yaml-templates/build-windows.yaml b/build-tools/automation/yaml-templates/build-windows.yaml index e3867113a22..b71e653e89c 100644 --- a/build-tools/automation/yaml-templates/build-windows.yaml +++ b/build-tools/automation/yaml-templates/build-windows.yaml @@ -28,6 +28,13 @@ stages: os: windows timeoutInMinutes: 240 steps: + - script: | + where.exe powershell + where.exe pwsh + displayName: test powershell + + + - template: sdk-unified/steps/checkout/v1.yml@yaml-templates parameters: resource: ${{ parameters.repositoryAlias }} From a82985e2b0c774017f02137f13d254815c5e255c Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Fri, 1 Mar 2024 12:56:37 -0800 Subject: [PATCH 35/36] Try to add powershell to path for maui test job --- build-tools/automation/azure-pipelines.yaml | 3 +++ build-tools/automation/yaml-templates/build-windows.yaml | 7 ------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index b8102110abc..b54da059e77 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -360,6 +360,9 @@ extends: echo ##vso[task.setvariable variable=JAVA_HOME]%JAVA_HOME_17_X64% displayName: set JI_JAVA_HOME, JAVA_HOME to $(JAVA_HOME_17_X64) + - script: echo "##vso[task.prependpath]C:\Windows\System32\WindowsPowerShell\v1.0\" + displayName: add powershell to path + - task: DownloadPipelineArtifact@2 inputs: artifactName: $(NuGetArtifactName) diff --git a/build-tools/automation/yaml-templates/build-windows.yaml b/build-tools/automation/yaml-templates/build-windows.yaml index b71e653e89c..e3867113a22 100644 --- a/build-tools/automation/yaml-templates/build-windows.yaml +++ b/build-tools/automation/yaml-templates/build-windows.yaml @@ -28,13 +28,6 @@ stages: os: windows timeoutInMinutes: 240 steps: - - script: | - where.exe powershell - where.exe pwsh - displayName: test powershell - - - - template: sdk-unified/steps/checkout/v1.yml@yaml-templates parameters: resource: ${{ parameters.repositoryAlias }} From 18d700ae6dbad5298838a2279305bf48f746c686 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Fri, 1 Mar 2024 13:42:31 -0800 Subject: [PATCH 36/36] Simplify macos PR build pool condition --- build-tools/automation/yaml-templates/build-macos.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build-tools/automation/yaml-templates/build-macos.yaml b/build-tools/automation/yaml-templates/build-macos.yaml index e62fdc933c8..2d12c21573a 100644 --- a/build-tools/automation/yaml-templates/build-macos.yaml +++ b/build-tools/automation/yaml-templates/build-macos.yaml @@ -28,12 +28,12 @@ stages: - job: ${{ parameters.jobName }} displayName: ${{ parameters.jobDisplayName }} pool: - ${{ if and(or(eq(variables['Build.DefinitionName'], 'Xamarin.Android'), eq(variables['Build.DefinitionName'], 'Xamarin.Android-Private')), ne(variables['Build.Reason'], 'PullRequest')) }}: - name: Azure Pipelines - vmImage: $(HostedMacImage) - ${{ else }}: + ${{ if or(eq(variables['Build.DefinitionName'], 'Xamarin.Android-PR'), eq(variables['Build.DefinitionName'], 'Xamarin.Android Nightly')) }}: name: VSEng-Xamarin-RedmondMac-Android-Untrusted demands: macOS.Name -equals Monterey + ${{ else }}: + name: Azure Pipelines + vmImage: $(HostedMacImage) os: macOS timeoutInMinutes: 240 cancelTimeoutInMinutes: 5