Skip to content

Commit

Permalink
[ci] See if we can provision by default on devdiv (#26170)
Browse files Browse the repository at this point in the history
* See if we can default this on devdiv

try again

Variables

Fix provisioning

is it this

try this

try again

try pass variable to all

* Try fix provision

* Try uitests also

* try again

* or this

* Not sure why it doesn t work

* teste

* again

* Again

* Fix provisionator on windows

* Try again fix uitest yml
  • Loading branch information
rmarinho authored Nov 28, 2024
1 parent 033317c commit bc16b83
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 62 deletions.
4 changes: 2 additions & 2 deletions eng/pipelines/common/device-tests-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ steps:
installDefaultAndroidApi: ${{ or(eq(parameters.platform, 'ios'), eq(parameters.platform, 'catalyst')) }}
provisionatorChannel: ${{ parameters.provisionatorChannel }}
${{ if not(parameters.skipProvisioning) }}:
skipProvisioning: false
skipProvisionator : false
gitHubToken: $(github--pat--vs-mobiletools-engineering-service2)
${{ else }}:
skipProvisioning: true
skipProvisionator: true

- pwsh: ./build.ps1 --target=dotnet --configuration="Release" --verbosity=diagnostic
displayName: 'Install .NET'
Expand Down
63 changes: 30 additions & 33 deletions eng/pipelines/common/provision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ parameters:
poolName: ''
clearCaches: true
skipXcode: false
skipProvisioning: true
skipProvisionator: true
skipAndroidSdks: false
skipAndroidImages: false
installDefaultAndroidApi: false
Expand Down Expand Up @@ -66,39 +66,28 @@ steps:
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
timeoutInMinutes: 30
# Provision Additional Software
- ${{ if ne(parameters.skipProvisioning, 'true') }}:
- ${{ if eq(variables['System.TeamProject'], 'devdiv') }}:
- task: xamops.azdevex.provisionator-task.provisionator@2
displayName: 'Provision Additional Software'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
continueOnError: true
inputs:
provisioning_script: ${{ parameters.checkoutDirectory }}/${{ parameters.provisionatorPath }}
provisioning_extra_args: ${{ parameters.provisionatorExtraArguments }}
github_token: ${{ parameters.gitHubToken }}
env:
PROVISIONATOR_CHANNEL: ${{ parameters.provisionatorChannel }}
AUTH_TOKEN_COMPONENTS_MAC_IOS_CERTIFICATE_P12: ${{ parameters.certPass }}
${{ if eq(parameters.skipAndroidSdks, true) }}:
SKIP_ANDROID_API_SDKS: 'true'
${{ if eq(parameters.skipAndroidImages, true) }}:
SKIP_ANDROID_API_IMAGES: 'true'
${{ if eq(parameters.installDefaultAndroidApi, true) }}:
INSTALL_DEFAULT_ANDROID_API: 'true'

# Setup JDK Paths (gradle needs it)
- bash: |
echo "##vso[task.setvariable variable=JI_JAVA_HOME]$(JAVA_HOME_17_X64)"
echo "##vso[task.setvariable variable=JAVA_HOME]$(JAVA_HOME_17_X64)"
# brew install --cask microsoft-openjdk@17
displayName: 'Setup JDK Paths'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
- ${{ if ne(parameters.skipProvisionator, true) }}:
# Prepare macOS
- task: xamops.azdevex.provisionator-task.provisionator@2
displayName: 'Provision Additional Software'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
continueOnError: true
inputs:
provisioning_script: ${{ parameters.checkoutDirectory }}/${{ parameters.provisionatorPath }}
provisioning_extra_args: ${{ parameters.provisionatorExtraArguments }}
github_token: ${{ parameters.gitHubToken }}
env:
PROVISIONATOR_CHANNEL: ${{ parameters.provisionatorChannel }}
AUTH_TOKEN_COMPONENTS_MAC_IOS_CERTIFICATE_P12: ${{ parameters.certPass }}
${{ if eq(parameters.skipAndroidSdks, true) }}:
SKIP_ANDROID_API_SDKS: 'true'
${{ if eq(parameters.skipAndroidImages, true) }}:
SKIP_ANDROID_API_IMAGES: 'true'
${{ if eq(parameters.installDefaultAndroidApi, true) }}:
INSTALL_DEFAULT_ANDROID_API: 'true'

# Prepare Windows
# Provision Additional Software
- ${{ if ne(parameters.skipProvisioning, 'true') }}:
# Prepare Windows
- task: xamops.azdevex.provisionator-task.provisionator@2
displayName: 'Provision Additional Software'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
Expand All @@ -115,6 +104,15 @@ steps:
${{ if eq(parameters.installDefaultAndroidApi, true) }}:
INSTALL_DEFAULT_ANDROID_API: 'true'

# Prepare Both
# Setup JDK Paths (gradle needs it)
- bash: |
echo "##vso[task.setvariable variable=JI_JAVA_HOME]$(JAVA_HOME_17_X64)"
echo "##vso[task.setvariable variable=JAVA_HOME]$(JAVA_HOME_17_X64)"
# brew install --cask microsoft-openjdk@17
displayName: 'Setup JDK Paths'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
- pwsh: |
if ($env:JAVA_HOME_17_X64) {
$env:JAVA_HOME = $env:JAVA_HOME_17_X64
Expand All @@ -133,7 +131,6 @@ steps:
displayName: 'Setup JDK Paths'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
# Prepare Both
- task: UseDotNet@2
displayName: 'Use .NET SDK $(DOTNET_VERSION)'
inputs:
Expand Down
7 changes: 6 additions & 1 deletion eng/pipelines/common/ui-tests-build-sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ parameters:
version: '' #the iOS version'
provisionatorChannel: 'latest'
agentPoolAccessToken: ''
skipProvisioning: true
configuration : "Release"
testFilter: ''
runtimeVariant: 'Mono'
Expand All @@ -22,11 +23,15 @@ steps:
- template: provision.yml
parameters:
skipProvisioning: true
# FIXME: 'Build the MSBuild Tasks' step fails for net9.0-android35 without API 35
skipAndroidSdks: false
skipXcode: ${{ or(eq(parameters.platform, 'android'), eq(parameters.platform, 'windows')) }}
provisionatorChannel: ${{ parameters.provisionatorChannel }}
${{ if parameters.skipProvisioning }}:
skipProvisionator: true
${{ else }}:
skipProvisionator: false
gitHubToken: $(github--pat--vs-mobiletools-engineering-service2)

- task: PowerShell@2
condition: ne('${{ parameters.platform }}' , 'windows')
Expand Down
4 changes: 2 additions & 2 deletions eng/pipelines/common/ui-tests-compatibility-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ steps:
parameters:
${{ if eq(parameters.platform, 'windows') }}:
platform: windows
skipProvisioning: true
skipProvisionator: true
${{ if ne(parameters.platform, 'windows') }}:
platform: macos
skipProvisioning: false
skipProvisionator: false
skipXcode: ${{ or(eq(parameters.platform, 'android'), eq(parameters.platform, 'windows')) }}
provisionatorChannel: ${{ parameters.provisionatorChannel }}

Expand Down
8 changes: 4 additions & 4 deletions eng/pipelines/common/ui-tests-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ steps:
skipAndroidSdks: ${{ ne(parameters.platform, 'android') }}
skipXcode: ${{ or(eq(parameters.platform, 'android'), eq(parameters.platform, 'windows')) }}
provisionatorChannel: ${{ parameters.provisionatorChannel }}
${{ if not(parameters.skipProvisioning) }}:
skipProvisioning: false
gitHubToken: $(github--pat--vs-mobiletools-engineering-service2)
${{ if parameters.skipProvisioning }}:
skipProvisionator: true
${{ else }}:
skipProvisioning: true
skipProvisionator: false
gitHubToken: $(github--pat--vs-mobiletools-engineering-service2)

- task: PowerShell@2
condition: ne('${{ parameters.platform }}' , 'windows')
Expand Down
8 changes: 5 additions & 3 deletions eng/pipelines/common/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ variables:
value: 'eng/provisioning/xcode.csx'
- name: provisionator.path
value: 'eng/provisioning/provisioning.csx'
- name: internalProvisioning
value: false
- name: provisionator.extraArguments
value: '-vvvv'
- name: DotNet.Dir
Expand All @@ -67,7 +69,9 @@ variables:
- group: Xamarin-Secrets

- ${{ if or(eq(variables['System.TeamProject'], 'DevDiv'), eq(variables['Build.DefinitionName'], 'dotnet-maui')) }}:
- ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
- name: internalProvisioning
value: true
- ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
- name: PrivateBuild
value: false
- name: _RunAsPublic
Expand All @@ -78,8 +82,6 @@ variables:
value: real
# - name: PostBuildSign
# value: true
# For eng/common/SetupNugetSources.ps1
# - group: Xamarin-Secrets

- group: DotNetBuilds storage account read tokens
- group: AzureDevOps-Artifact-Feeds-Pats
Expand Down
30 changes: 15 additions & 15 deletions eng/pipelines/handlers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,12 @@ stages:
skipAndroidImages: true
installDefaultAndroidApi: false
skipXcode: ${{ ne(BuildPlatform.name , 'macOS') }}
${{ if parameters.UseProvisionator }}:
skipProvisioning: false
${{ if or(eq(parameters.UseProvisionator, true), eq(variables['internalProvisioning'],'True') ) }}:
skipProvisionator: false
gitHubToken: $(github--pat--vs-mobiletools-engineering-service2)
${{ else }}:
skipProvisioning: true
${{ else }}:
skipProvisionator: true

- pwsh: ./build.ps1 --target=dotnet --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic
displayName: 'Install .NET'
retryCountOnTaskFailure: 3
Expand Down Expand Up @@ -270,11 +271,11 @@ stages:
skipAndroidImages: true
installDefaultAndroidApi: true
skipXcode: ${{ ne(PackPlatform.name , 'macOS') }}
${{ if parameters.UseProvisionator }}:
skipProvisioning: false
${{ if or(eq(parameters.UseProvisionator, 'True'), eq(variables['internalProvisioning'],'True') )}}:
skipProvisionator: false
gitHubToken: $(github--pat--vs-mobiletools-engineering-service2)
${{ else }}:
skipProvisioning: true
skipProvisionator: true

- stage: samples_net
displayName: Test .NET MAUI Samples
Expand All @@ -298,11 +299,11 @@ stages:
skipAndroidImages: true
installDefaultAndroidApi: true
skipXcode: ${{ ne(BuildPlatform.name , 'macOS') }}
${{ if parameters.UseProvisionator }}:
skipProvisioning: false
${{ if or(eq(parameters.UseProvisionator, true), eq(variables['internalProvisioning'],'True') ) }}:
skipProvisionator: false
gitHubToken: $(github--pat--vs-mobiletools-engineering-service2)
${{ else }}:
skipProvisioning: true
skipProvisionator: true
- task: DownloadBuildArtifacts@0
displayName: 'Download Packages'
inputs:
Expand Down Expand Up @@ -343,15 +344,14 @@ stages:
RunPlatforms: ${{ parameters.RunTemplatePlatforms }}
BuildPlatforms: ${{ parameters.BuildTemplatePlatforms }}
MacBuildPool: ${{ parameters.MacTemplatePool }}
${{ if parameters.UseProvisionator }}:
skipProvisioning: false
${{ else }}:
skipProvisioning: true
conditionMacTemplates: or(
${{ parameters.BuildEverything }},
ne(variables['Build.Reason'], 'PullRequest'),
eq(variables['System.TeamProject'], 'devdiv'))

${{ if or(eq(parameters.UseProvisionator, true), eq(variables['internalProvisioning'],'True') ) }}:
skipProvisioning: false


- ${{ if eq(variables['System.TeamProject'], 'devdiv') }}:
- template: common/localization-handoff.yml # Process outgoing strings [Localization Handoff]
- template: common/localization-handback.yml # Process incoming translations and Create PR to main [Localization Handback]
7 changes: 5 additions & 2 deletions eng/pipelines/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,17 @@ stages:
androidApiLevels: [ 30 ]
iosVersions: [ '18.0' ]
provisionatorChannel: ${{ parameters.provisionatorChannel }}
skipProvisioning: ${{ or(not(parameters.UseProvisionator), false) }}
${{ else }}:
androidApiLevels: [ 30 ]
iosVersions: [ '18.0' ]
provisionatorChannel: ${{ parameters.provisionatorChannel }}
skipProvisioning: ${{ not(parameters.UseProvisionator) }}
${{ if parameters.CompatibilityTests }}:
runCompatibilityTests: true
${{ if or(eq(parameters.UseProvisionator, true), eq(variables['internalProvisioning'],'True') ) }}:
skipProvisioning: false
gitHubToken: $(github--pat--vs-mobiletools-engineering-service2)
${{ else }}:
skipProvisioning: true
projects:
- name: controls
desc: Controls
Expand Down

0 comments on commit bc16b83

Please sign in to comment.