-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ci] Add MAUI integration job #8200
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,11 @@ resources: | |
name: xamarin/release-scripts | ||
ref: refs/heads/sign-and-notarized | ||
endpoint: xamarin | ||
- repository: maui | ||
type: github | ||
name: dotnet/maui | ||
ref: refs/heads/net8.0 | ||
endpoint: xamarin | ||
|
||
parameters: | ||
- name: provisionatorChannel | ||
|
@@ -277,13 +282,139 @@ stages: | |
artifactName: Test Results - MSBuild Smoke - Linux | ||
|
||
- template: yaml-templates/fail-on-issue.yaml | ||
|
||
- template: yaml-templates/stage-msbuild-tests.yaml | ||
|
||
- template: yaml-templates/stage-msbuild-emulator-tests.yaml | ||
parameters: | ||
usesCleanImages: ${{ parameters.macTestAgentsUseCleanImages }} | ||
|
||
- stage: maui_tests | ||
displayName: MAUI Tests | ||
dependsOn: mac_build | ||
condition: 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 | ||
provisionatorChannel: ${{ parameters.provisionatorChannel }} | ||
installLegacyDotNet: false | ||
restoreNUnitConsole: false | ||
updateMono: false | ||
androidSdkPlatforms: 23,24,25,26,27,28,29,30,31,32,$(DefaultTestSdkPlatforms) | ||
|
||
- task: NuGetAuthenticate@0 | ||
displayName: authenticate with azure artifacts | ||
inputs: | ||
forceReinstallCredentialProvider: true | ||
|
||
- script: | | ||
echo ##vso[task.setvariable variable=JI_JAVA_HOME]%JAVA_HOME_11_X64% | ||
echo ##vso[task.setvariable variable=JAVA_HOME]%JAVA_HOME_11_X64% | ||
displayName: set JI_JAVA_HOME, JAVA_HOME | ||
|
||
- 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 | ||
|
||
- 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought this would be easier than trying to edit the target frameworks of the template project file, but we can revisit this if it becomes problematic at all in the future. |
||
|
||
- 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 | ||
|
||
- 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: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's nice this doesn't actually take that long: