Skip to content

Commit db357c7

Browse files
authoredJan 15, 2025
[ci] Run Mac MSBuild tests on macos-14-arm64 (#9665)
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.
1 parent 7aed4e3 commit db357c7

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed
 

‎build-tools/automation/yaml-templates/setup-jdk-variables.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
parameters:
2-
jdkMajorVersion: $(DefaultJavaSdkMajorVersion)
3-
useAgentJdkPath: true
2+
jdkMajorVersion: $(DefaultJavaSdkMajorVersion) # Generally 11|17|21
3+
useAgentJdkPath: true # true to use preinstalled agent JDK, false to use 'android-toolchain/jdk-NN'
44

55
steps:
66
- pwsh: |
77
$agentOS="$(Agent.OS)"
8-
$agentArch="$(Agent.OSArchitecture)"
8+
$agentArch="$(Agent.OSArchitecture)" -eq "ARM64" ? "arm64" : "$(Agent.OSArchitecture)"
99
$jdkMajorVersion="${{ parameters.jdkMajorVersion }}"
1010
$xaPrepareJdkPath="$env:HOME/android-toolchain/jdk-$jdkMajorVersion"
1111
if ("$agentOS" -eq "Windows_NT") {

‎build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ stages:
2727
displayName: "macOS > Tests > MSBuild+Emulator"
2828
pool:
2929
name: Azure Pipelines
30-
vmImage: $(HostedMacImage)
30+
vmImage: $(HostedMacImageWithEmulator)
3131
os: macOS
3232
timeoutInMinutes: 180
3333
cancelTimeoutInMinutes: 5
@@ -89,7 +89,7 @@ stages:
8989
deviceName: wear_square
9090
pool:
9191
name: Azure Pipelines
92-
vmImage: $(HostedMacImage)
92+
vmImage: $(HostedMacImageWithEmulator)
9393
os: macOS
9494
workspace:
9595
clean: all

‎build-tools/automation/yaml-templates/stage-msbuild-tests.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ stages:
2222
testOS: macOS
2323
jobName: mac_msbuild_tests
2424
jobDisplayName: macOS > Tests > MSBuild
25-
agentCount: 14
25+
agentCount: 10
2626
xaSourcePath: ${{ parameters.xaSourcePath }}
2727
repositoryAlias: ${{ parameters.repositoryAlias }}
2828
commit: ${{ parameters.commit }}
@@ -34,7 +34,7 @@ stages:
3434
testOS: Windows
3535
jobName: win_msbuild_tests
3636
jobDisplayName: Windows > Tests > MSBuild
37-
agentCount: 6
37+
agentCount: 8
3838
xaSourcePath: ${{ parameters.xaSourcePath }}
3939
repositoryAlias: ${{ parameters.repositoryAlias }}
4040
commit: ${{ parameters.commit }}

‎build-tools/automation/yaml-templates/stage-package-tests.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ stages:
1313
displayName: macOS > Tests > APKs 1
1414
pool:
1515
name: Azure Pipelines
16-
vmImage: $(HostedMacImage)
16+
vmImage: $(HostedMacImageWithEmulator)
1717
os: macOS
1818
timeoutInMinutes: 180
1919
workspace:
@@ -120,7 +120,7 @@ stages:
120120
displayName: macOS > Tests > APKs 2
121121
pool:
122122
name: Azure Pipelines
123-
vmImage: $(HostedMacImage)
123+
vmImage: $(HostedMacImageWithEmulator)
124124
os: macOS
125125
timeoutInMinutes: 180
126126
workspace:

‎build-tools/automation/yaml-templates/variables.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ variables:
1414
- name: WindowsToolchainPdbArtifactName
1515
value: windows-toolchain-pdb
1616
- name: ApkDiffToolVersion
17-
value: 0.0.15
17+
value: 0.0.17
1818
- name: TestSlicerToolVersion
1919
value: 0.1.0-alpha7
2020
- name: BootsToolVersion
@@ -30,6 +30,8 @@ variables:
3030
- name: GitHub.Token
3131
value: $(github--pat--vs-mobiletools-engineering-service2)
3232
- name: HostedMacImage
33+
value: macOS-14-arm64
34+
- name: HostedMacImageWithEmulator
3335
value: macOS-14
3436
- name: SharedMacPool
3537
value: VSEng-VSMac-Xamarin-Shared

0 commit comments

Comments
 (0)