Skip to content

Commit

Permalink
[ci] Run Mac MSBuild tests on macos-14-arm64 (#9665)
Browse files Browse the repository at this point in the history
Azure Pipelines now provides the `macos-14-arm64` image.  We can use this image to run our MSBuild tests on.  This is a benefit because it's nearly twice as fast and nowadays our Mac users are probably more likely to be running arm64.

Unfortunately it [does not support nested virtualization](actions/runner-images#9460), so we can't run our emulator tests on this image.  Supposedly Apple added nested virtualization in MacOS 15, but Azure does not have `macos-15-arm64` images yet.  Hopefully we will be able to use those for emulator tests in the future.

Additionally:
- Update `apkdiff` to a [newer version with Apple Silicon support](radekdoulik/apkdiff#8).
- Tweak agent count since we now need fewer Mac agents, but could use a couple more Windows agents.
- Bugfix to make sure we're using the right JDK path for ARM64.
  • Loading branch information
jpobst authored Jan 15, 2025
1 parent 7aed4e3 commit db357c7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
parameters:
jdkMajorVersion: $(DefaultJavaSdkMajorVersion)
useAgentJdkPath: true
jdkMajorVersion: $(DefaultJavaSdkMajorVersion) # Generally 11|17|21
useAgentJdkPath: true # true to use preinstalled agent JDK, false to use 'android-toolchain/jdk-NN'

steps:
- pwsh: |
$agentOS="$(Agent.OS)"
$agentArch="$(Agent.OSArchitecture)"
$agentArch="$(Agent.OSArchitecture)" -eq "ARM64" ? "arm64" : "$(Agent.OSArchitecture)"
$jdkMajorVersion="${{ parameters.jdkMajorVersion }}"
$xaPrepareJdkPath="$env:HOME/android-toolchain/jdk-$jdkMajorVersion"
if ("$agentOS" -eq "Windows_NT") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ stages:
displayName: "macOS > Tests > MSBuild+Emulator"
pool:
name: Azure Pipelines
vmImage: $(HostedMacImage)
vmImage: $(HostedMacImageWithEmulator)
os: macOS
timeoutInMinutes: 180
cancelTimeoutInMinutes: 5
Expand Down Expand Up @@ -89,7 +89,7 @@ stages:
deviceName: wear_square
pool:
name: Azure Pipelines
vmImage: $(HostedMacImage)
vmImage: $(HostedMacImageWithEmulator)
os: macOS
workspace:
clean: all
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ stages:
testOS: macOS
jobName: mac_msbuild_tests
jobDisplayName: macOS > Tests > MSBuild
agentCount: 14
agentCount: 10
xaSourcePath: ${{ parameters.xaSourcePath }}
repositoryAlias: ${{ parameters.repositoryAlias }}
commit: ${{ parameters.commit }}
Expand All @@ -34,7 +34,7 @@ stages:
testOS: Windows
jobName: win_msbuild_tests
jobDisplayName: Windows > Tests > MSBuild
agentCount: 6
agentCount: 8
xaSourcePath: ${{ parameters.xaSourcePath }}
repositoryAlias: ${{ parameters.repositoryAlias }}
commit: ${{ parameters.commit }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ stages:
displayName: macOS > Tests > APKs 1
pool:
name: Azure Pipelines
vmImage: $(HostedMacImage)
vmImage: $(HostedMacImageWithEmulator)
os: macOS
timeoutInMinutes: 180
workspace:
Expand Down Expand Up @@ -120,7 +120,7 @@ stages:
displayName: macOS > Tests > APKs 2
pool:
name: Azure Pipelines
vmImage: $(HostedMacImage)
vmImage: $(HostedMacImageWithEmulator)
os: macOS
timeoutInMinutes: 180
workspace:
Expand Down
4 changes: 3 additions & 1 deletion build-tools/automation/yaml-templates/variables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ variables:
- name: WindowsToolchainPdbArtifactName
value: windows-toolchain-pdb
- name: ApkDiffToolVersion
value: 0.0.15
value: 0.0.17
- name: TestSlicerToolVersion
value: 0.1.0-alpha7
- name: BootsToolVersion
Expand All @@ -30,6 +30,8 @@ variables:
- name: GitHub.Token
value: $(github--pat--vs-mobiletools-engineering-service2)
- name: HostedMacImage
value: macOS-14-arm64
- name: HostedMacImageWithEmulator
value: macOS-14
- name: SharedMacPool
value: VSEng-VSMac-Xamarin-Shared
Expand Down

0 comments on commit db357c7

Please sign in to comment.