Skip to content

Commit

Permalink
Add support for AppleTV (#3174)
Browse files Browse the repository at this point in the history
Co-authored-by: Nikola Irinchev <[email protected]>
  • Loading branch information
fealebenpae and nirinchev authored Feb 2, 2023
1 parent 89d95d4 commit c9e0546
Show file tree
Hide file tree
Showing 83 changed files with 2,174 additions and 347 deletions.
13 changes: 7 additions & 6 deletions .github/templates/common.lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
#@ actionDownloadArtifact = "actions/download-artifact@v3"
#@ actionSetupMSBuild = "microsoft/setup-msbuild@0b44c6745b7e81956596964100aadb92d667c497"
#@ actionSetupDotnet = "actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a"
#@ actionRuniOSSimulator = "realm/ci-actions/run-ios-simulator@e7b65d7d587e1abc358968d7ff816cc0163906d2"
#@ actionRuniOSSimulator = "realm/ci-actions/run-ios-simulator@187889c026eb16673dba3152906a46ed87406e30"
#@ actionCodeQLInit = "github/codeql-action/init@40542d38bc4936c2ca7da883aeb050a6081b4b31"
#@ actionCodeQLAnalyze = "github/codeql-action/analyze@40542d38bc4936c2ca7da883aeb050a6081b4b31"
#@ actionSetupNode = "actions/setup-node@16352bb09bc672a073e326c2cc1d3d7d2a3e577e"
#@ actionAWSConfigureCredentials = "aws-actions/configure-aws-credentials@v1-node16"
#@ actionReleaseToSlack = "realm/ci-actions/release-to-slack@e7b65d7d587e1abc358968d7ff816cc0163906d2"
#@ actionReleaseToSlack = "realm/ci-actions/release-to-slack@187889c026eb16673dba3152906a46ed87406e30"
#@ actionSetupXcode = "maxim-lobanov/setup-xcode@9a697e2b393340c3cacd97468baa318e4c883d98"

#@ androidABIs = [ 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' ]
#@ windowsArchs = [ 'Win32', 'x64', 'ARM64' ]
#@ windowsUWPArchs = [ 'Win32', 'x64', 'ARM', 'ARM64' ]
#@ iOSArchs = [ 'Simulator', 'Device', 'Catalyst' ]
#@ applePlatforms = [ 'iOS', 'tvOS' ]

#@ actionDockerLayerCaching = "jpribyl/action-docker-layer-caching@c632825d12ec837065f49726ea27ddd40bcc7894" #! 0.1.1
#@ actionDockerBuild = "docker/build-push-action@6e95f19fb8c9e00a1a391941edbc0ae30c1799f7" #! 2.7.0
Expand Down Expand Up @@ -145,9 +145,10 @@ with:
#@ end

#@ def getWrapperBinaryNames():
#@ wrapperPlatforms = [ 'macos', 'linux' ]
#@ for iOSArch in iOSArchs:
#@ wrapperPlatforms.append("ios-" + iOSArch)
#@ wrapperPlatforms = [ 'macos', 'catalyst', 'linux' ]
#@ for platform in applePlatforms:
#@ wrapperPlatforms.append(platform + "-Device")
#@ wrapperPlatforms.append(platform + "-Simulator")
#@ end
#@ for androidABI in androidABIs:
#@ wrapperPlatforms.append("android-" + androidABI)
Expand Down
1 change: 1 addition & 0 deletions .github/templates/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
_: #@ template.replace(runNetCoreTests("[\"netcoreapp3.1\", \"net6.0\"]"))
_: #@ template.replace(runTests("macOS"))
_: #@ template.replace(runTests("iOS"))
_: #@ template.replace(runTests("tvOS", runSyncTests = False))
_: #@ template.replace(runTests("Android", additionalSecrets=["AWS_DEVICEFARM_ACCESS_KEY_ID", "AWS_DEVICEFARM_SECRET_ACCESS_KEY", "DEVICEFARM_PROJECT_ARN", "DEVICEFARM_ANDROID_POOL_ARN"]))
test-xunit:
runs-on: windows-latest
Expand Down
1 change: 1 addition & 0 deletions .github/templates/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
_: #@ template.replace(runNetCoreTests('["net6.0"]'))
_: #@ template.replace(runTests("macOS", runSyncTests = False))
_: #@ template.replace(runTests("iOS", runSyncTests = False))
_: #@ template.replace(runTests("tvOS", runSyncTests = False))
_: #@ template.replace(runTests("Android", runSyncTests = False, additionalSecrets=["AWS_DEVICEFARM_ACCESS_KEY_ID", "AWS_DEVICEFARM_SECRET_ACCESS_KEY", "DEVICEFARM_PROJECT_ARN", "DEVICEFARM_ANDROID_POOL_ARN"]))
_: #@ template.replace(runWovenClassesTests())
_: #@ template.replace(runSourceGenerationTests())
Expand Down
4 changes: 2 additions & 2 deletions .github/templates/test-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
- name: Set XCode Version
shell: bash
run: |
sudo xcode-select -s "/Applications/Xcode_14.1.app"
echo "MD_APPLE_SDK_ROOT=/Applications/Xcode_14.1.app" >> $GITHUB_ENV
sudo xcode-select -s "/Applications/Xcode_14.2.app"
echo "MD_APPLE_SDK_ROOT=/Applications/Xcode_14.2.app" >> $GITHUB_ENV
- name: Setup workloads
run: |
dotnet workload install maui
Expand Down
24 changes: 24 additions & 0 deletions .github/templates/test-tvos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#@ load("@ytt:template", "template")
#@ load("common.lib.yml", "checkoutCode", "configuration", "actionRuniOSSimulator", "setupDotnet")
#@ load("test.lib.yml", "fetchPackageArtifacts", "baasTestArgs", "publishTestsResults", "testDefinition", "buildTests", "prepareTest")

---
name: test-tvos
_: #@ template.replace(testDefinition())
jobs:
test-xamarin:
runs-on: macos-latest
name: Xamarin.tvOS
timeout-minutes: 45
steps:
- #@ template.replace(prepareTest())
- #@ template.replace(buildTests("Tests/Tests.XamarinTVOS", Platform="iPhoneSimulator"))
- name: Run the tests
uses: #@ actionRuniOSSimulator
with:
appPath: #@ "Tests/Tests.XamarinTVOS/bin/iPhoneSimulator/" + configuration + "/Tests.XamarinTVOS.app"
bundleId: 'io.realm.Tests-XamarinTVOS'
iphoneToSimulate: 'Apple-TV-1080p'
arguments: #@ "--headless --result=${{ github.workspace }}/TestResults.tvOS.xml --labels=All" + baasTestArgs("tvos")
os: 'tvOS'
- #@ publishTestsResults("TestResults.tvOS.xml", "Xamarin.tvOS")
2 changes: 1 addition & 1 deletion .github/templates/test.lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ env:
#@ else:
- #@ template.replace(fetchPackageArtifacts())
#@ end
- uses: realm/ci-actions/mdb-realm/deploy@e7b65d7d587e1abc358968d7ff816cc0163906d2
- uses: realm/ci-actions/mdb-realm/deploy@187889c026eb16673dba3152906a46ed87406e30
if: ${{ inputs.realmUrl }}
with:
projectId: ${{ secrets.AtlasProjectId}}
Expand Down
17 changes: 11 additions & 6 deletions .github/templates/wrappers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#@ load("@ytt:template", "template")
#@ load("common.lib.yml", "configuration", "checkoutCode", "actionCache", "actionDownloadArtifact", "getWrapperBinaryNames", "androidABIs", "windowsArchs", "windowsUWPArchs", "iOSArchs", "actionDockerLayerCaching", "actionDockerBuild", "actionDockerRun", "uploadArtifacts", "setupXcode")
#@ load("common.lib.yml", "configuration", "checkoutCode", "actionCache", "actionDownloadArtifact", "getWrapperBinaryNames", "androidABIs", "windowsArchs", "windowsUWPArchs", "applePlatforms", "actionDockerLayerCaching", "actionDockerBuild", "actionDockerRun", "uploadArtifacts", "setupXcode")

#@ wrappersTimeout = 90
#@ wrappersCacheCondition = "steps.check-cache.outputs.cache-hit != 'true'"
Expand Down Expand Up @@ -86,15 +86,20 @@ jobs:
runs-on: macos-12
name: macOS
_: #@ template.replace(buildWrappers("./wrappers/build-macos.sh", "wrappers-macos"))
ios:
catalyst:
runs-on: macos-12
name: iOS
name: Catalyst
_: #@ template.replace(buildWrappers("pwsh ./wrappers/build-apple-platform.ps1 Catalyst", "wrappers-catalyst"))
apple-platforms:
runs-on: macos-12
name: Apple Platform
strategy:
matrix:
arch: #@ iOSArchs
_: #@ template.replace(buildWrappers("pwsh ./wrappers/build-ios.ps1 ${{ matrix.arch }}", "wrappers-ios-${{ matrix.arch }}", enableLto = False, intermediateSteps = [setupXcode()]))
platform: #@ applePlatforms
target: [ 'Device', 'Simulator' ]
_: #@ template.replace(buildWrappers("pwsh ./wrappers/build-apple-platform.ps1 ${{ matrix.platform }} -Targets ${{ matrix.target }}", "wrappers-${{ matrix.platform }}-${{ matrix.target }}", enableLto = False, intermediateSteps = [setupXcode()]))
#@yaml/map-key-override
if: #@ " || ".join([ "needs.check-cache.outputs.wrappers-ios-" + x + " != 'true'" for x in iOSArchs ])
if: #@ " || ".join([ "needs.check-cache.outputs.wrappers-" + x + "-Device != 'true'" for x in applePlatforms ])
linux:
runs-on: ubuntu-latest
name: Linux
Expand Down
22 changes: 16 additions & 6 deletions .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,35 @@ jobs:
with:
name: wrappers-macos
path: wrappers/build
- name: Fetch artifacts for catalyst
uses: actions/download-artifact@v3
with:
name: wrappers-catalyst
path: wrappers/build
- name: Fetch artifacts for linux
uses: actions/download-artifact@v3
with:
name: wrappers-linux
path: wrappers/build
- name: Fetch artifacts for ios-Simulator
- name: Fetch artifacts for iOS-Device
uses: actions/download-artifact@v3
with:
name: wrappers-iOS-Device
path: wrappers/build
- name: Fetch artifacts for iOS-Simulator
uses: actions/download-artifact@v3
with:
name: wrappers-ios-Simulator
name: wrappers-iOS-Simulator
path: wrappers/build
- name: Fetch artifacts for ios-Device
- name: Fetch artifacts for tvOS-Device
uses: actions/download-artifact@v3
with:
name: wrappers-ios-Device
name: wrappers-tvOS-Device
path: wrappers/build
- name: Fetch artifacts for ios-Catalyst
- name: Fetch artifacts for tvOS-Simulator
uses: actions/download-artifact@v3
with:
name: wrappers-ios-Catalyst
name: wrappers-tvOS-Simulator
path: wrappers/build
- name: Fetch artifacts for android-armeabi-v7a
uses: actions/download-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cleanup-baas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
submodules: false
ref: ${{ github.event.pull_request.head.sha }}
- uses: realm/ci-actions/mdb-realm/cleanup@e7b65d7d587e1abc358968d7ff816cc0163906d2
- uses: realm/ci-actions/mdb-realm/cleanup@187889c026eb16673dba3152906a46ed87406e30
with:
projectId: ${{ secrets.AtlasProjectId}}
realmUrl: ${{ inputs.BaseUrl }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-baas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
with:
submodules: false
ref: ${{ github.event.pull_request.head.sha }}
- uses: realm/ci-actions/mdb-realm/deploy@e7b65d7d587e1abc358968d7ff816cc0163906d2
- uses: realm/ci-actions/mdb-realm/deploy@187889c026eb16673dba3152906a46ed87406e30
id: deploy-cluster
with:
projectId: ${{ secrets.AtlasProjectId}}
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,15 @@ jobs:
AtlasProjectId: ${{ secrets.ATLAS_QA_PROJECT_ID }}
AtlasPublicKey: ${{ secrets.ATLAS_QA_PUBLIC_API_KEY }}
AtlasPrivateKey: ${{ secrets.ATLAS_QA_PRIVATE_API_KEY }}
test-tvos:
uses: ./.github/workflows/test-tvos.yml
name: Test
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
needs:
- build-packages
with:
version: ${{ needs.build-packages.outputs.package_version }}
secrets: {}
test-android:
uses: ./.github/workflows/test-android.yml
name: Test
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ jobs:
with:
version: ${{ needs.build-packages.outputs.package_version }}
secrets: {}
test-tvos:
uses: ./.github/workflows/test-tvos.yml
name: Test
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
needs:
- build-packages
with:
version: ${{ needs.build-packages.outputs.package_version }}
secrets: {}
test-android:
uses: ./.github/workflows/test-android.yml
name: Test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: actions/checkout@v3
- name: Update Changelog
id: update-changelog
uses: realm/ci-actions/update-changelog@e7b65d7d587e1abc358968d7ff816cc0163906d2
uses: realm/ci-actions/update-changelog@187889c026eb16673dba3152906a46ed87406e30
with:
changelog: ${{ github.workspace }}/CHANGELOG.md
- name: Update package.json
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
number: ${{ steps.vnext-pr.outputs.pull-request-number }}
method: squash
- name: 'Post to #realm-releases'
uses: realm/ci-actions/release-to-slack@e7b65d7d587e1abc358968d7ff816cc0163906d2
uses: realm/ci-actions/release-to-slack@187889c026eb16673dba3152906a46ed87406e30
with:
changelog: Realm/packages/ExtractedChangelog/ExtractedChangelog.md
sdk: .NET
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
with:
name: Realm.SourceGenerator.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- uses: realm/ci-actions/mdb-realm/deploy@e7b65d7d587e1abc358968d7ff816cc0163906d2
- uses: realm/ci-actions/mdb-realm/deploy@187889c026eb16673dba3152906a46ed87406e30
if: ${{ inputs.realmUrl }}
with:
projectId: ${{ secrets.AtlasProjectId}}
Expand Down
24 changes: 17 additions & 7 deletions .github/workflows/test-code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,35 @@ jobs:
with:
name: wrappers-macos
path: wrappers/build
- name: Fetch artifacts for catalyst
uses: actions/download-artifact@v3
with:
name: wrappers-catalyst
path: wrappers/build
- name: Fetch artifacts for linux
uses: actions/download-artifact@v3
with:
name: wrappers-linux
path: wrappers/build
- name: Fetch artifacts for ios-Simulator
- name: Fetch artifacts for iOS-Device
uses: actions/download-artifact@v3
with:
name: wrappers-iOS-Device
path: wrappers/build
- name: Fetch artifacts for iOS-Simulator
uses: actions/download-artifact@v3
with:
name: wrappers-ios-Simulator
name: wrappers-iOS-Simulator
path: wrappers/build
- name: Fetch artifacts for ios-Device
- name: Fetch artifacts for tvOS-Device
uses: actions/download-artifact@v3
with:
name: wrappers-ios-Device
name: wrappers-tvOS-Device
path: wrappers/build
- name: Fetch artifacts for ios-Catalyst
- name: Fetch artifacts for tvOS-Simulator
uses: actions/download-artifact@v3
with:
name: wrappers-ios-Catalyst
name: wrappers-tvOS-Simulator
path: wrappers/build
- name: Fetch artifacts for android-armeabi-v7a
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -123,7 +133,7 @@ jobs:
with:
name: wrappers-windows-uwp-ARM64
path: wrappers/build
- uses: realm/ci-actions/mdb-realm/deploy@e7b65d7d587e1abc358968d7ff816cc0163906d2
- uses: realm/ci-actions/mdb-realm/deploy@187889c026eb16673dba3152906a46ed87406e30
if: ${{ inputs.realmUrl }}
with:
projectId: ${{ secrets.AtlasProjectId}}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
with:
name: Realm.SourceGenerator.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- uses: realm/ci-actions/mdb-realm/deploy@e7b65d7d587e1abc358968d7ff816cc0163906d2
- uses: realm/ci-actions/mdb-realm/deploy@187889c026eb16673dba3152906a46ed87406e30
if: ${{ inputs.realmUrl }}
with:
projectId: ${{ secrets.AtlasProjectId}}
Expand All @@ -69,7 +69,7 @@ jobs:
- name: Build Tests/Tests.iOS
run: msbuild Tests/Tests.iOS -p:Configuration=Release -restore -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }} -p:Platform=iPhoneSimulator
- name: Run the tests
uses: realm/ci-actions/run-ios-simulator@e7b65d7d587e1abc358968d7ff816cc0163906d2
uses: realm/ci-actions/run-ios-simulator@187889c026eb16673dba3152906a46ed87406e30
with:
appPath: Tests/Tests.iOS/bin/iPhoneSimulator/Release/Tests.iOS.app
bundleId: io.realm.dotnettests
Expand Down Expand Up @@ -122,15 +122,15 @@ jobs:
- name: Set XCode Version
shell: bash
run: |
sudo xcode-select -s "/Applications/Xcode_14.1.app"
echo "MD_APPLE_SDK_ROOT=/Applications/Xcode_14.1.app" >> $GITHUB_ENV
sudo xcode-select -s "/Applications/Xcode_14.2.app"
echo "MD_APPLE_SDK_ROOT=/Applications/Xcode_14.2.app" >> $GITHUB_ENV
- name: Setup workloads
run: |
dotnet workload install maui
- name: Build the tests
run: dotnet build Tests/Tests.Maui -c Release -f net6.0-ios -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }}
- name: Run the tests
uses: realm/ci-actions/run-ios-simulator@e7b65d7d587e1abc358968d7ff816cc0163906d2
uses: realm/ci-actions/run-ios-simulator@187889c026eb16673dba3152906a46ed87406e30
with:
appPath: Tests/Tests.Maui/bin/Release/net6.0-ios/iossimulator-x64/Tests.Maui.app
bundleId: io.realm.mauitests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
with:
name: Realm.SourceGenerator.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- uses: realm/ci-actions/mdb-realm/deploy@e7b65d7d587e1abc358968d7ff816cc0163906d2
- uses: realm/ci-actions/mdb-realm/deploy@187889c026eb16673dba3152906a46ed87406e30
if: ${{ inputs.realmUrl }}
with:
projectId: ${{ secrets.AtlasProjectId}}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-net-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
with:
name: Realm.SourceGenerator.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- uses: realm/ci-actions/mdb-realm/deploy@e7b65d7d587e1abc358968d7ff816cc0163906d2
- uses: realm/ci-actions/mdb-realm/deploy@187889c026eb16673dba3152906a46ed87406e30
if: ${{ inputs.realmUrl }}
with:
projectId: ${{ secrets.AtlasProjectId}}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-net-framework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
with:
name: Realm.SourceGenerator.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- uses: realm/ci-actions/mdb-realm/deploy@e7b65d7d587e1abc358968d7ff816cc0163906d2
- uses: realm/ci-actions/mdb-realm/deploy@187889c026eb16673dba3152906a46ed87406e30
if: ${{ inputs.realmUrl }}
with:
projectId: ${{ secrets.AtlasProjectId}}
Expand Down
Loading

0 comments on commit c9e0546

Please sign in to comment.