From 09daa0cf0f2f5dc366f04b4bdc61c6a758cb59d6 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Fri, 14 Apr 2023 15:30:45 -0400 Subject: [PATCH 1/3] [CI] Allow to pass the xa checkout dir to nested templates. --- build-tools/automation/yaml-templates/run-msbuild-tests.yaml | 4 +++- .../yaml-templates/stage-msbuild-emulator-tests.yaml | 3 +++ .../automation/yaml-templates/stage-msbuild-tests.yaml | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/build-tools/automation/yaml-templates/run-msbuild-tests.yaml b/build-tools/automation/yaml-templates/run-msbuild-tests.yaml index 5a3d482c04f..231407a3ea9 100644 --- a/build-tools/automation/yaml-templates/run-msbuild-tests.yaml +++ b/build-tools/automation/yaml-templates/run-msbuild-tests.yaml @@ -4,6 +4,7 @@ parameters: jobDisplayName: # Display name of the job agentCount: # Number of build agents to run in parallel testFilter: # Filter used to select tests (NUnit test selection language, not dotnet test filter language) + xaSourcePath: $(System.DefaultWorkingDirectory) jobs: - job: ${{ parameters.jobName }} @@ -31,7 +32,8 @@ jobs: installLegacyDotNet: false restoreNUnitConsole: false updateMono: false - + xaSourcePath: ${{ parameters.xaSourcePath }} + - task: DownloadPipelineArtifact@2 inputs: artifactName: $(TestAssembliesArtifactName) 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 e5c3c33e857..158543d68a7 100644 --- a/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml +++ b/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml @@ -7,6 +7,7 @@ parameters: agent_count: 8 stageCondition: succeeded() stagePrefix: '' + xaSourcePath: $(System.DefaultWorkingDirectory) stages: - stage: ${{ parameters.stageName }} @@ -33,6 +34,7 @@ stages: restoreNUnitConsole: false updateMono: false androidSdkPlatforms: $(androidSdkPlatforms) + xaSourcePath: ${{ parameters.xaSourcePath }} - template: run-xaprepare.yaml parameters: @@ -87,6 +89,7 @@ stages: installLegacyDotNet: false restoreNUnitConsole: false androidSdkPlatforms: $(androidSdkPlatforms) + xaSourcePath: ${{ parameters.xaSourcePath }} - template: run-xaprepare.yaml parameters: diff --git a/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml b/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml index 032984683f6..b71c9a4cfc9 100644 --- a/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml +++ b/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml @@ -5,6 +5,7 @@ parameters: stageCondition: succeeded() dependsOn: mac_build stagePrefix: '' + xaSourcePath: $(System.DefaultWorkingDirectory) stages: - stage: ${{ parameters.stageName }} @@ -19,6 +20,7 @@ stages: jobDisplayName: macOS > Tests > MSBuild agentCount: 10 testFilter: cat != Dummy # This is because $(ExcludedNUnitCategories) gets appended which starts with '&' + xaSourcePath: ${{ parameters.xaSourcePath }} - template: run-msbuild-tests.yaml parameters: @@ -27,3 +29,4 @@ stages: jobDisplayName: Windows > Tests > MSBuild agentCount: 6 testFilter: cat != Dummy # This is because $(ExcludedNUnitCategories) gets appended which starts with '&' + xaSourcePath: ${{ parameters.xaSourcePath }} From 73d0acc26750a2cabb325e27900f80582678502c Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Mon, 17 Apr 2023 12:24:29 -0400 Subject: [PATCH 2/3] Allow to pass the repo reference name and commit. --- .../yaml-templates/run-msbuild-tests.yaml | 6 +++++- .../yaml-templates/setup-test-environment.yaml | 16 +++++++++++----- .../stage-msbuild-emulator-tests.yaml | 6 ++++++ 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/build-tools/automation/yaml-templates/run-msbuild-tests.yaml b/build-tools/automation/yaml-templates/run-msbuild-tests.yaml index 231407a3ea9..1d7b5801e51 100644 --- a/build-tools/automation/yaml-templates/run-msbuild-tests.yaml +++ b/build-tools/automation/yaml-templates/run-msbuild-tests.yaml @@ -5,7 +5,9 @@ parameters: agentCount: # Number of build agents to run in parallel testFilter: # Filter used to select tests (NUnit test selection language, not dotnet test filter language) xaSourcePath: $(System.DefaultWorkingDirectory) - + repositoryAlias: 'self' + commit: 'HEAD' + jobs: - job: ${{ parameters.jobName }} strategy: @@ -33,6 +35,8 @@ jobs: restoreNUnitConsole: false updateMono: false xaSourcePath: ${{ parameters.xaSourcePath }} + repositoryAlias: ${{ parameters.repositoryAlias }} + commit: ${{ parameters.commit }} - task: DownloadPipelineArtifact@2 inputs: diff --git a/build-tools/automation/yaml-templates/setup-test-environment.yaml b/build-tools/automation/yaml-templates/setup-test-environment.yaml index c07a00c5d5c..6b5310dc68f 100644 --- a/build-tools/automation/yaml-templates/setup-test-environment.yaml +++ b/build-tools/automation/yaml-templates/setup-test-environment.yaml @@ -10,13 +10,19 @@ parameters: restoreNUnitConsole: true updateMono: true androidSdkPlatforms: $(DefaultTestSdkPlatforms) + repositoryAlias: 'self' + commit: 'HEAD' steps: -- checkout: self - clean: true - submodules: recursive - ${{ if ne(parameters.xaSourcePath, variables['System.DefaultWorkingDirectory']) }}: - path: s/xamarin-android + +- template: sdk-unified/steps/checkout/v1.yml@yaml-templates + parameters: + resource: ${{ parameters.repositoryAlias }} + commit: ${{ parameters.commit }} + clean: true + submodules: recursive + ${{ if ne(parameters.xaSourcePath, variables['System.DefaultWorkingDirectory']) }}: + path: s/xamarin-android - ${{ if eq(parameters.updateVS, true) }}: - template: update-vs.yaml 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 158543d68a7..768c2b706f0 100644 --- a/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml +++ b/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml @@ -8,6 +8,8 @@ parameters: stageCondition: succeeded() stagePrefix: '' xaSourcePath: $(System.DefaultWorkingDirectory) + repositoryAlias: 'self' + commit: 'HEAD' stages: - stage: ${{ parameters.stageName }} @@ -35,6 +37,8 @@ stages: updateMono: false androidSdkPlatforms: $(androidSdkPlatforms) xaSourcePath: ${{ parameters.xaSourcePath }} + repositoryAlias: ${{ parameters.repositoryAlias }} + commit: ${{ parameters.commit }} - template: run-xaprepare.yaml parameters: @@ -90,6 +94,8 @@ stages: restoreNUnitConsole: false androidSdkPlatforms: $(androidSdkPlatforms) xaSourcePath: ${{ parameters.xaSourcePath }} + repositoryAlias: ${{ parameters.repositoryAlias }} + commit: ${{ parameters.commit }} - template: run-xaprepare.yaml parameters: From c29a286a4949fb8ee509b930366c3c1a99c7f1f6 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Mon, 17 Apr 2023 12:32:53 -0400 Subject: [PATCH 3/3] Address reviews. --- .../automation/yaml-templates/run-msbuild-tests.yaml | 2 +- .../automation/yaml-templates/setup-test-environment.yaml | 2 +- .../yaml-templates/stage-msbuild-emulator-tests.yaml | 2 +- .../automation/yaml-templates/stage-msbuild-tests.yaml | 6 ++++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/build-tools/automation/yaml-templates/run-msbuild-tests.yaml b/build-tools/automation/yaml-templates/run-msbuild-tests.yaml index 1d7b5801e51..1acd3e8fdce 100644 --- a/build-tools/automation/yaml-templates/run-msbuild-tests.yaml +++ b/build-tools/automation/yaml-templates/run-msbuild-tests.yaml @@ -6,7 +6,7 @@ parameters: testFilter: # Filter used to select tests (NUnit test selection language, not dotnet test filter language) xaSourcePath: $(System.DefaultWorkingDirectory) repositoryAlias: 'self' - commit: 'HEAD' + commit: '' jobs: - job: ${{ parameters.jobName }} diff --git a/build-tools/automation/yaml-templates/setup-test-environment.yaml b/build-tools/automation/yaml-templates/setup-test-environment.yaml index 6b5310dc68f..30db8d66110 100644 --- a/build-tools/automation/yaml-templates/setup-test-environment.yaml +++ b/build-tools/automation/yaml-templates/setup-test-environment.yaml @@ -11,7 +11,7 @@ parameters: updateMono: true androidSdkPlatforms: $(DefaultTestSdkPlatforms) repositoryAlias: 'self' - commit: 'HEAD' + commit: '' steps: 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 768c2b706f0..a45bda8d962 100644 --- a/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml +++ b/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml @@ -9,7 +9,7 @@ parameters: stagePrefix: '' xaSourcePath: $(System.DefaultWorkingDirectory) repositoryAlias: 'self' - commit: 'HEAD' + commit: '' stages: - stage: ${{ parameters.stageName }} diff --git a/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml b/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml index b71c9a4cfc9..24f71d052f3 100644 --- a/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml +++ b/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml @@ -6,6 +6,8 @@ parameters: dependsOn: mac_build stagePrefix: '' xaSourcePath: $(System.DefaultWorkingDirectory) + repositoryAlias: 'self' + commit: '' stages: - stage: ${{ parameters.stageName }} @@ -21,6 +23,8 @@ stages: agentCount: 10 testFilter: cat != Dummy # This is because $(ExcludedNUnitCategories) gets appended which starts with '&' xaSourcePath: ${{ parameters.xaSourcePath }} + repositoryAlias: ${{ parameters.repositoryAlias }} + commit: ${{ parameters.commit }} - template: run-msbuild-tests.yaml parameters: @@ -30,3 +34,5 @@ stages: agentCount: 6 testFilter: cat != Dummy # This is because $(ExcludedNUnitCategories) gets appended which starts with '&' xaSourcePath: ${{ parameters.xaSourcePath }} + repositoryAlias: ${{ parameters.repositoryAlias }} + commit: ${{ parameters.commit }}