-
Notifications
You must be signed in to change notification settings - Fork 215
[Swift shipping] Setup MacCatalyst tests on the CI #2998
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
Changes from all commits
a39b893
3022225
23fd0a4
2e1ca77
5cffd2c
19a9b6e
d1dd21d
df86efe
1fee60e
56128ee
6e86096
a2bbd0d
fc83fdf
a06afa4
1446e7f
aa83e02
18afe00
7e8953d
1030042
99ad0a7
3ff5a68
30d764f
8dfe24e
9a08713
5ffb536
78661cc
6f621dc
f10daaf
b4eb5a0
cbd1d6a
7bfbad4
a2edc27
bade761
ad6f05d
d29a319
d65d665
52ab08a
a244547
c0247d7
6290875
ff039fd
5968cc2
edaa045
ff28586
3715e98
6cdffec
0d2fb39
b4c5d61
b70d7cb
fb31cbe
651f549
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 |
|---|---|---|
|
|
@@ -203,4 +203,4 @@ launchSettings.json | |
| # Testing artifacts | ||
| testing/ | ||
| src/samples/ | ||
| GeneratedBindings/ | ||
| GeneratedBindings/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| parameters: | ||
| variables: {} | ||
| osGroup: '' | ||
| platform: '' | ||
| archType: '' | ||
| container: '' | ||
| pool: {} | ||
|
|
||
| jobs: | ||
|
|
||
| - template: /eng/common/templates/jobs/jobs.yml | ||
| parameters: | ||
| enableTelemetry: true | ||
| helixRepo: dotnet/runtimelab | ||
| pool: ${{ parameters.pool }} | ||
| enableMicrobuild: true | ||
| graphFileGeneration: | ||
| enabled: false | ||
| includeToolset: false | ||
|
|
||
| jobs: | ||
| - job: ${{ format('{0}_{1}_{2}', parameters.osGroup, parameters.platform, parameters.archType) }} | ||
| displayName: ${{ format('{0} {1} {2}', parameters.osGroup, parameters.platform, parameters.archType) }} | ||
| strategy: | ||
| matrix: | ||
| Release: | ||
| _BuildConfig: Release | ||
| Debug: | ||
| _BuildConfig: Debug | ||
|
|
||
| steps: | ||
| # Use .NET 9 as MAUI workloads are not available for the default SDK | ||
| - script: | | ||
| cat << 'EOF' > global.json | ||
| { | ||
| "sdk": { | ||
| "version": "9.0.102", | ||
| "allowPrerelease": true, | ||
| "rollForward": "major" | ||
| }, | ||
| "tools": { | ||
| "dotnet": "9.0.102", | ||
| "runtimes": { | ||
| "dotnet": [ | ||
| "$(MicrosoftNETCoreAppVersion)" | ||
| ] | ||
| } | ||
| }, | ||
| "msbuild-sdks": { | ||
| "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.24515.3" | ||
| } | ||
| } | ||
| EOF | ||
| ./build.sh | ||
| ./dotnet.sh workload install maui maccatalyst --version 9.0.103 --source https://api.nuget.org/v3/index.json | ||
| ./dotnet.sh new tool-manifest && ./dotnet.sh tool install microsoft.dotnet.xharness.cli --version "9.0.0-prerelease*" | ||
| sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer | ||
| displayName: Install dependencies | ||
|
|
||
| - script: | | ||
| ./dotnet.sh build ./src/Swift.Bindings/tests/FrameworkTests/Swift.Bindings.Framework.Tests.csproj \ | ||
| -f net9.0-${{ parameters.platform }} \ | ||
| -c $(_BuildConfig) \ | ||
| -r ${{ parameters.platform }}-${{ parameters.archType }} \ | ||
| /p:UseMaui=true | ||
| displayName: Publish app | ||
|
|
||
| - script: | | ||
| ./dotnet.sh xharness apple test \ | ||
| --target ${{ parameters.platform }} \ | ||
| --timeout="00:02:00" \ | ||
| --launch-timeout=00:06:00 \ | ||
| --app ./src/Swift.Bindings/tests/FrameworkTests/bin/$(_BuildConfig)/net9.0-${{ parameters.platform }}/${{ parameters.platform }}-${{ parameters.archType }}/Swift.Bindings.Framework.Tests.app \ | ||
| --output-directory artifacts | ||
| displayName: Run device tests | ||
|
|
||
| - script: | | ||
| cat artifacts/Swift.Bindings.Framework.Tests.log | ||
| displayName: Display logs |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,21 +53,18 @@ stages: | |
| - template: /eng/pipelines/common/templates/build-job.yml | ||
| parameters: | ||
| osGroup: OSX | ||
| archType: arm64 | ||
| archType: x64 | ||
| runTests: true | ||
| pool: | ||
| vmImage: 'macOS-latest' | ||
| bindings: | ||
| isBindingsBuild: true | ||
| scriptArgs: '--platform MacOSX --arch arm64e-apple-macos --framework StoreKit' | ||
| scriptArgs: '--platform MacOSX --arch x86_64-apple-macos --framework StoreKit' | ||
|
|
||
| - template: /eng/pipelines/common/templates/build-job.yml | ||
| - template: /eng/pipelines/common/templates/test-job.yml | ||
| parameters: | ||
| osGroup: OSX | ||
| platform: maccatalyst | ||
| archType: x64 | ||
|
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. Why x64? Is this a HW availability limitation?
Member
Author
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. Yes, this is the default image. There is a macOS-arm64 image and we need to figure out how to use it. https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml
Member
Author
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.
Member
Author
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. @akoeplinger Do you know if we can run macOS-arm64 containers?
Member
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. not if you run tests directly on the AzDO build machine, the arm64 macOS pool is only available in internal builds, not in public.
Member
Author
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. Is the arm64 job redundant? Should we use Helix instead for arm64 jobs?
Member
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. which arm64 job? the one in this file only builds for arm64 which does work on x64. if you can send to Helix then yeah you could send to an arm64 queue
Member
Author
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.
Yes, that was my question. So even it builds for arm64, it runs on x64.
Member
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. Yes |
||
| runTests: true | ||
| pool: | ||
| vmImage: 'macOS-latest' | ||
| bindings: | ||
| isBindingsBuild: true | ||
| scriptArgs: '--platform MacOSX --arch x86_64-apple-macos --framework StoreKit' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| using DeviceRunners.UITesting; | ||
| using DeviceRunners.VisualRunners; | ||
| using DeviceRunners.XHarness; | ||
| using Microsoft.Extensions.Logging; | ||
| using Microsoft.Maui.Hosting; | ||
|
|
||
| namespace BindingsGeneration.FrameworkTests; | ||
|
|
||
| public static class MauiProgram | ||
| { | ||
| public static MauiApp CreateMauiApp() | ||
| { | ||
| var builder = MauiApp.CreateBuilder(); | ||
| builder | ||
| .ConfigureUITesting() | ||
| .UseXHarnessTestRunner(conf => conf | ||
| .AddTestAssembly(typeof(MauiProgram).Assembly) | ||
| .AddXunit()) | ||
| .UseVisualTestRunner(conf => conf | ||
| .AddConsoleResultChannel() | ||
| .AddTestAssembly(typeof(MauiProgram).Assembly) | ||
| .AddXunit()); | ||
|
|
||
| builder.Logging.AddDebug(); | ||
|
|
||
| return builder.Build(); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| using Foundation; | ||
|
|
||
| namespace BindingsGeneration.FrameworkTests; | ||
|
|
||
| [Register("AppDelegate")] | ||
| public class AppDelegate : MauiUIApplicationDelegate | ||
| { | ||
| protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <!-- See https://aka.ms/maui-publish-app-store#add-entitlements for more information about adding entitlements.--> | ||
| <dict> | ||
| <!-- App Sandbox must be enabled to distribute a MacCatalyst app through the Mac App Store. --> | ||
| <key>com.apple.security.app-sandbox</key> | ||
| <true/> | ||
| <!-- When App Sandbox is enabled, this value is required to open outgoing network connections. --> | ||
| <key>com.apple.security.network.client</key> | ||
| <true/> | ||
| </dict> | ||
| </plist> | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict> | ||
| <!-- The Mac App Store requires you specify if the app uses encryption. --> | ||
| <!-- Please consult https://developer.apple.com/documentation/bundleresources/information_property_list/itsappusesnonexemptencryption --> | ||
| <!-- <key>ITSAppUsesNonExemptEncryption</key> --> | ||
| <!-- Please indicate <true/> or <false/> here. --> | ||
|
|
||
| <!-- Specify the category for your app here. --> | ||
| <!-- Please consult https://developer.apple.com/documentation/bundleresources/information_property_list/lsapplicationcategorytype --> | ||
| <!-- <key>LSApplicationCategoryType</key> --> | ||
| <!-- <string>public.app-category.YOUR-CATEGORY-HERE</string> --> | ||
| <key>UIDeviceFamily</key> | ||
| <array> | ||
| <integer>2</integer> | ||
| </array> | ||
| <key>UIRequiredDeviceCapabilities</key> | ||
| <array> | ||
| <string>arm64</string> | ||
| </array> | ||
| <key>UISupportedInterfaceOrientations</key> | ||
| <array> | ||
| <string>UIInterfaceOrientationPortrait</string> | ||
| <string>UIInterfaceOrientationLandscapeLeft</string> | ||
| <string>UIInterfaceOrientationLandscapeRight</string> | ||
| </array> | ||
| <key>UISupportedInterfaceOrientations~ipad</key> | ||
| <array> | ||
| <string>UIInterfaceOrientationPortrait</string> | ||
| <string>UIInterfaceOrientationPortraitUpsideDown</string> | ||
| <string>UIInterfaceOrientationLandscapeLeft</string> | ||
| <string>UIInterfaceOrientationLandscapeRight</string> | ||
| </array> | ||
| <key>XSAppIconAssets</key> | ||
| <string>Assets.xcassets/appicon.appiconset</string> | ||
| </dict> | ||
| </plist> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| using ObjCRuntime; | ||
| using UIKit; | ||
|
|
||
| namespace BindingsGeneration.FrameworkTests; | ||
|
|
||
| public class Program | ||
| { | ||
| // This is the main entry point of the application. | ||
| static void Main(string[] args) | ||
| { | ||
| // if you want to use a different Application Delegate class from "AppDelegate" | ||
| // you can specify it here. | ||
| UIApplication.Main(args, null, typeof(AppDelegate)); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| using Foundation; | ||
|
|
||
| namespace BindingsGeneration.FrameworkTests; | ||
|
|
||
| [Register("AppDelegate")] | ||
| public class AppDelegate : MauiUIApplicationDelegate | ||
| { | ||
| protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict> | ||
| <key>LSRequiresIPhoneOS</key> | ||
| <true/> | ||
| <key>UIDeviceFamily</key> | ||
| <array> | ||
| <integer>1</integer> | ||
| <integer>2</integer> | ||
| </array> | ||
| <key>UIRequiredDeviceCapabilities</key> | ||
| <array> | ||
| <string>arm64</string> | ||
| </array> | ||
| <key>UISupportedInterfaceOrientations</key> | ||
| <array> | ||
| <string>UIInterfaceOrientationPortrait</string> | ||
| <string>UIInterfaceOrientationLandscapeLeft</string> | ||
| <string>UIInterfaceOrientationLandscapeRight</string> | ||
| </array> | ||
| <key>UISupportedInterfaceOrientations~ipad</key> | ||
| <array> | ||
| <string>UIInterfaceOrientationPortrait</string> | ||
| <string>UIInterfaceOrientationPortraitUpsideDown</string> | ||
| <string>UIInterfaceOrientationLandscapeLeft</string> | ||
| <string>UIInterfaceOrientationLandscapeRight</string> | ||
| </array> | ||
| <key>XSAppIconAssets</key> | ||
| <string>Assets.xcassets/appicon.appiconset</string> | ||
| </dict> | ||
| </plist> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| using ObjCRuntime; | ||
| using UIKit; | ||
|
|
||
| namespace BindingsGeneration.FrameworkTests; | ||
|
|
||
| public class Program | ||
| { | ||
| // This is the main entry point of the application. | ||
| static void Main(string[] args) | ||
| { | ||
| // if you want to use a different Application Delegate class from "AppDelegate" | ||
| // you can specify it here. | ||
| UIApplication.Main(args, null, typeof(AppDelegate)); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| This is the minimum required version of the Apple Privacy Manifest for .NET MAUI apps. | ||
| The contents below are needed because of APIs that are used in the .NET framework and .NET MAUI SDK. | ||
|
|
||
| You are responsible for adding extra entries as needed for your application. | ||
|
|
||
| More information: https://aka.ms/maui-privacy-manifest | ||
| --> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict> | ||
| <key>NSPrivacyAccessedAPITypes</key> | ||
| <array> | ||
| <dict> | ||
| <key>NSPrivacyAccessedAPIType</key> | ||
| <string>NSPrivacyAccessedAPICategoryFileTimestamp</string> | ||
| <key>NSPrivacyAccessedAPITypeReasons</key> | ||
| <array> | ||
| <string>C617.1</string> | ||
| </array> | ||
| </dict> | ||
| <dict> | ||
| <key>NSPrivacyAccessedAPIType</key> | ||
| <string>NSPrivacyAccessedAPICategorySystemBootTime</string> | ||
| <key>NSPrivacyAccessedAPITypeReasons</key> | ||
| <array> | ||
| <string>35F9.1</string> | ||
| </array> | ||
| </dict> | ||
| <dict> | ||
| <key>NSPrivacyAccessedAPIType</key> | ||
| <string>NSPrivacyAccessedAPICategoryDiskSpace</string> | ||
| <key>NSPrivacyAccessedAPITypeReasons</key> | ||
| <array> | ||
| <string>E174.1</string> | ||
| </array> | ||
| </dict> | ||
| <!-- | ||
| The entry below is only needed when you're using the Preferences API in your app. | ||
| <dict> | ||
| <key>NSPrivacyAccessedAPIType</key> | ||
| <string>NSPrivacyAccessedAPICategoryUserDefaults</string> | ||
| <key>NSPrivacyAccessedAPITypeReasons</key> | ||
| <array> | ||
| <string>CA92.1</string> | ||
| </array> | ||
| </dict> --> | ||
| </array> | ||
| </dict> | ||
| </plist> |
Uh oh!
There was an error while loading. Please reload this page.