diff --git a/tools/devops/automation/run-post-ci-build-macos-tests.yml b/tools/devops/automation/run-post-ci-build-macos-tests.yml deleted file mode 100644 index bbdb367de5d7..000000000000 --- a/tools/devops/automation/run-post-ci-build-macos-tests.yml +++ /dev/null @@ -1,20 +0,0 @@ -# YAML pipeline for post build operations. -# This pipeline will execute the tests for the CI as soon as the workloads have been complited. - -trigger: none -pr: none - - -# we cannot use a template in a pipeline context -resources: - pipelines: - - pipeline: macios - source: xamarin-macios-ci - trigger: - stages: - - build_macos_tests - -extends: - template: templates/pipelines/run-macos-tests-pipeline.yml - parameters: - isPR: false diff --git a/tools/devops/automation/run-post-ci-build-tests.yml b/tools/devops/automation/run-post-ci-build-tests.yml index 5ffbfa0917f6..a8a20442aa95 100644 --- a/tools/devops/automation/run-post-ci-build-tests.yml +++ b/tools/devops/automation/run-post-ci-build-tests.yml @@ -13,6 +13,7 @@ resources: trigger: stages: - build_packages + - build_macos_tests extends: template: templates/pipelines/run-tests-pipeline.yml diff --git a/tools/devops/automation/run-post-pr-build-macos-tests.yml b/tools/devops/automation/run-post-pr-build-macos-tests.yml deleted file mode 100644 index e324fe5d8b3e..000000000000 --- a/tools/devops/automation/run-post-pr-build-macos-tests.yml +++ /dev/null @@ -1,19 +0,0 @@ -# YAML pipeline for post build operations. -# This pipeline will execute the tests for the CI on PR as soon as the workloads have been complited. - -trigger: none -pr: none - -# we cannot use a template in a pipeline context -resources: - pipelines: - - pipeline: macios - source: xamarin-macios-pr - trigger: - stages: - - build_macos_tests - -extends: - template: templates/pipelines/run-macos-tests-pipeline.yml - parameters: - isPR: true diff --git a/tools/devops/automation/run-post-pr-build-tests.yml b/tools/devops/automation/run-post-pr-build-tests.yml index 45a676699994..84d8d1e58e72 100644 --- a/tools/devops/automation/run-post-pr-build-tests.yml +++ b/tools/devops/automation/run-post-pr-build-tests.yml @@ -12,6 +12,7 @@ resources: trigger: stages: - build_packages + - build_macos_tests extends: template: templates/pipelines/run-tests-pipeline.yml diff --git a/tools/devops/automation/templates/pipelines/run-macos-tests-pipeline.yml b/tools/devops/automation/templates/pipelines/run-macos-tests-pipeline.yml deleted file mode 100644 index e4f4672fb821..000000000000 --- a/tools/devops/automation/templates/pipelines/run-macos-tests-pipeline.yml +++ /dev/null @@ -1,130 +0,0 @@ -# template to be extended by those pipelines that will run tests after a build. -parameters: - - - name: isPR - displayName: State if the tests are ran for a PR build - type: boolean - default: false - - - name: repositoryAlias - type: string - default: self - - - name: commit - type: string - default: HEAD - - - name: stageDisplayNamePrefix - type: string - default: '' - - - name: macTestsConfigurations - displayName: macOS test configurations to run - type: object - default: [ - { - stageName: 'mac_11_m1', - displayName: 'M1 - Mac Big Sur (11)', - macPool: 'VSEng-VSMac-Xamarin-Shared', - useImage: false, - statusContext: 'M1 - Mac Big Sur (11)', - demands: [ - "Agent.OS -equals Darwin", - "macOS.Name -equals BigSur", - "macOS.Architecture -equals arm64", - "Agent.HasDevices -equals False", - "Agent.IsPaired -equals False" - ] - }, - { - stageName: 'mac_12_m1', - displayName: 'M1 - Mac Ventura (12)', - macPool: 'VSEng-VSMac-Xamarin-Shared', - useImage: false, - statusContext: 'M1 - Mac Monterey (12)', - demands: [ - "Agent.OS -equals Darwin", - "macOS.Name -equals Monterey", - "macOS.Architecture -equals arm64", - "Agent.HasDevices -equals False", - "Agent.IsPaired -equals False" - ] - }, - { - stageName: 'mac_13_m1', - displayName: 'M1 - Mac Ventura (13)', - macPool: 'VSEng-VSMac-Xamarin-Shared', - useImage: false, - statusContext: 'M1 - Mac Ventura (13)', - demands: [ - "Agent.OS -equals Darwin", - "macOS.Name -equals Ventura", - "macOS.Architecture -equals arm64", - "Agent.HasDevices -equals False", - "Agent.IsPaired -equals False" - ] - }, - { - stageName: 'mac_14_x64', - displayName: 'X64 - Mac Sonoma (14)', - macPool: 'VSEng-Xamarin-RedmondMacBuildPool-iOS-Untrusted', - useImage: false, - statusContext: 'X64 - Mac Sonoma (14)', - demands: [ - "Agent.OS -equals Darwin", - "macOS.Name -equals Sonoma", - "macOS.Architecture -equals x64", - "Agent.HasDevices -equals False", - "Agent.IsPaired -equals False" - ] - }] - - -resources: - repositories: - - repository: self - checkoutOptions: - submodules: true - - - repository: yaml-templates - type: github - name: xamarin/yaml-templates - ref: refs/heads/main - endpoint: xamarin - - - repository: maccore - type: github - name: xamarin/maccore - ref: refs/heads/main - endpoint: xamarin - - - repository: release-scripts - type: github - name: xamarin/release-scripts - ref: refs/heads/only_codesign - endpoint: xamarin - -variables: - - ${{ if contains(variables['Build.DefinitionName'], 'private') }}: - - template: ../vsts-variables.yml - - template: ../variables.yml - - name: MaciosUploadPrefix - value: '' - - name: DisablePipelineConfigDetector - value: true - -stages: - - ${{ each config in parameters.macTestsConfigurations }}: - - template: ../mac/stage.yml - parameters: - isPR: ${{ parameters.isPR }} - repositoryAlias: ${{ parameters.repositoryAlias }} - commit: ${{ parameters.commit }} - stageName: ${{ config.stageName }} - displayName: ' ${{ parameters.stageDisplayNamePrefix }}${{ config.displayName }}' - macPool: ${{ config.macPool }} - useImage: ${{ config.useImage }} - statusContext: ${{ config.statusContext }} - keyringPass: $(pass--lab--mac--builder--keychain) - demands: ${{ config.demands }} - postPipeline: true diff --git a/tools/devops/automation/templates/pipelines/run-tests-pipeline.yml b/tools/devops/automation/templates/pipelines/run-tests-pipeline.yml index bfa780b0c41e..a1b127a464f5 100644 --- a/tools/devops/automation/templates/pipelines/run-tests-pipeline.yml +++ b/tools/devops/automation/templates/pipelines/run-tests-pipeline.yml @@ -84,6 +84,68 @@ parameters: ] }] + - name: macTestsConfigurations + displayName: macOS test configurations to run + type: object + default: [ + { + stageName: 'mac_11_m1', + displayName: 'M1 - Mac Big Sur (11)', + macPool: 'VSEng-VSMac-Xamarin-Shared', + useImage: false, + statusContext: 'M1 - Mac Big Sur (11)', + demands: [ + "Agent.OS -equals Darwin", + "macOS.Name -equals BigSur", + "macOS.Architecture -equals arm64", + "Agent.HasDevices -equals False", + "Agent.IsPaired -equals False" + ] + }, + { + stageName: 'mac_12_m1', + displayName: 'M1 - Mac Ventura (12)', + macPool: 'VSEng-VSMac-Xamarin-Shared', + useImage: false, + statusContext: 'M1 - Mac Monterey (12)', + demands: [ + "Agent.OS -equals Darwin", + "macOS.Name -equals Monterey", + "macOS.Architecture -equals arm64", + "Agent.HasDevices -equals False", + "Agent.IsPaired -equals False" + ] + }, + { + stageName: 'mac_13_m1', + displayName: 'M1 - Mac Ventura (13)', + macPool: 'VSEng-VSMac-Xamarin-Shared', + useImage: false, + statusContext: 'M1 - Mac Ventura (13)', + demands: [ + "Agent.OS -equals Darwin", + "macOS.Name -equals Ventura", + "macOS.Architecture -equals arm64", + "Agent.HasDevices -equals False", + "Agent.IsPaired -equals False" + ] + }, + { + stageName: 'mac_14_x64', + displayName: 'X64 - Mac Sonoma (14)', + macPool: 'VSEng-Xamarin-RedmondMacBuildPool-iOS-Untrusted', + useImage: false, + statusContext: 'X64 - Mac Sonoma (14)', + demands: [ + "Agent.OS -equals Darwin", + "macOS.Name -equals Sonoma", + "macOS.Architecture -equals x64", + "Agent.HasDevices -equals False", + "Agent.IsPaired -equals False" + ] + }] + + resources: repositories: - repository: self @@ -127,9 +189,11 @@ stages: pool: ${{ parameters.pool }} runTests: ${{ parameters.runTests }} runDeviceTests: ${{ parameters.runDeviceTests }} + runOldMacOSTests: ${{ parameters.runOldMacOSTests }} runWindowsIntegration: ${{ parameters.runWindowsIntegration }} runSamples: ${{ parameters.runSamples }} ${{ if ne(length(parameters.testConfigurations), 0)}}: testConfigurations: ${{ parameters.testConfigurations }} deviceTestsConfigurations: ${{ parameters.deviceTestsConfigurations }} + macTestsConfigurations: ${{ parameters.macTestsConfigurations }} diff --git a/tools/devops/automation/templates/tests-stage.yml b/tools/devops/automation/templates/tests-stage.yml index 94d8f1c2dfc3..7d69332b8591 100644 --- a/tools/devops/automation/templates/tests-stage.yml +++ b/tools/devops/automation/templates/tests-stage.yml @@ -20,6 +20,10 @@ parameters: type: boolean default: false +- name: runOldMacOSTests + type: boolean + default: true + - name: runWindowsIntegration type: boolean default: true @@ -153,6 +157,9 @@ parameters: - name: deviceTestsConfigurations type: object +- name: macTestsConfigurations + type: object + - name: stageDisplayNamePrefix type: string default: '' @@ -258,6 +265,22 @@ stages: commit: ${{ parameters.commit }} postPipeline: true +- ${{ if eq(parameters.runOldMacOSTests, true) }}: + - ${{ each config in parameters.macTestsConfigurations }}: + - template: ./mac/stage.yml + parameters: + isPR: ${{ parameters.isPR }} + repositoryAlias: ${{ parameters.repositoryAlias }} + commit: ${{ parameters.commit }} + stageName: ${{ config.stageName }} + displayName: ' ${{ parameters.stageDisplayNamePrefix }}${{ config.displayName }}' + macPool: ${{ config.macPool }} + useImage: ${{ config.useImage }} + statusContext: ${{ config.statusContext }} + keyringPass: $(pass--lab--mac--builder--keychain) + demands: ${{ config.demands }} + postPipeline: true + - ${{ if eq(parameters.runWindowsIntegration, true) }}: - template: ./windows/stage.yml parameters: