Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions .github/workflows/integration-test-xros.yaml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you using the name "xrOS" here? Isn't this old terminology?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: "Integration Test"

on:
workflow_dispatch:
pull_request:
push:
branches:
- main

# IMPORTANT NOTES:
# - Changes made to this file needs to replicated across other integration-test-*.yaml files.
# - The Fastlane lane name is duplicated in more than one place within this workflow.

jobs:
check:
runs-on: macos-13-xlarge

strategy:
fail-fast: false
matrix:
include:

- platform: visionOS
lane: test_visionOS_1_0

env:
LC_CTYPE: en_US.UTF-8
LANG: en_US.UTF-8
ABLY_ENV: sandbox

steps:
- name: Check out repo
uses: actions/checkout@v2

- name: Select Xcode (15.2)
run: |
sudo xcode-select -s /Applications/Xcode_15.2.app
echo "Selected Xcode version:"
xcodebuild -version

- name: Environment Info
run: ./Scripts/log-environment-information.sh

- name: Check out xcparse repo
uses: actions/checkout@v3
with:
repository: ably-forks/xcparse
ref: emit-test-case-info
path: xcparse

- id: get-xcparse-commit-sha
name: Get xcparse commit SHA
run: |
cd xcparse
echo "::set-output name=sha::$(git rev-parse HEAD)"

- name: "actions/cache@v3 (xcparse binary)"
uses: actions/cache@v3
with:
path: xcparse/.build/debug/xcparse
key: ${{ runner.os }}-xcparse-${{ steps.get-xcparse-commit-sha.outputs.sha }}

- name: Reset Simulators
run: xcrun simctl erase all

- name: Install Dependencies
run: |
brew install xcbeautify
make submodules
bundle install

- name: Run Tests
run: bundle exec fastlane ${{ matrix.lane }}

- name: Check Static Analyzer Output
id: analyzer-output
run: |
if [[ -z $(find ./derived_data -name "report-*.html") ]]; then
echo "Static Analyzer found no issues."
else
echo "Static Analyzer found some issues. HTML report will be available in Artifacts section. Failing build."
exit 1
fi

- name: Upload Static Analyzer Reports
if: ${{ failure() && steps.analyzer-output.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: static-analyzer-reports-${{ matrix.lane }}
path: ./derived_data/**/report-*.html

- name: Upload Xcodebuild Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: xcodebuild-logs-${{ matrix.lane }}
path: ~/Library/Developer/Xcode/DerivedData/*/Logs

- name: Upload Test Output
if: always()
uses: actions/upload-artifact@v4
with:
name: test-output-${{ matrix.lane }}
path: fastlane/test_output

- name: Upload Test Results
if: always()
env:
TEST_OBSERVABILITY_SERVER_AUTH_KEY: ${{ secrets.TEST_OBSERVABILITY_SERVER_AUTH_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Scripts/upload_test_results.sh --job-name "check (${{ matrix.platform }}, ${{ matrix.lane }})"

1,138 changes: 1,124 additions & 14 deletions Ably.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

79 changes: 79 additions & 0 deletions Ably.xcodeproj/xcshareddata/xcschemes/Ably-visionOS.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1610"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "84E6D9C92DB69D9700E6A1AD"
BuildableName = "Ably.framework"
BlueprintName = "Ably-visionOS"
ReferencedContainer = "container:Ably.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "84B3FC732DB69F9C00037368"
BuildableName = "Ably-visionOS-Tests.xctest"
BlueprintName = "Ably-visionOS-Tests"
ReferencedContainer = "container:Ably.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "84E6D9C92DB69D9700E6A1AD"
BuildableName = "Ably.framework"
BlueprintName = "Ably-visionOS"
ReferencedContainer = "container:Ably.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
8 changes: 6 additions & 2 deletions Examples/AblyPush/AblyPushExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,11 @@
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = io.ably.AblyPushExample;
PRODUCT_NAME = "Ably Push";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
SUPPORTS_MACCATALYST = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = "1,2,7";
};
name = Debug;
};
Expand Down Expand Up @@ -535,9 +537,11 @@
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = io.ably.AblyPushExample;
PRODUCT_NAME = "Ably Push";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
SUPPORTS_MACCATALYST = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = "1,2,7";
};
name = Release;
};
Expand Down
4 changes: 4 additions & 0 deletions Examples/AblyPush/AblyPushExample/AblyHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ class AblyHelper: NSObject, ObservableObject {
UNUserNotificationCenter.current().delegate = self
locationManager = CLLocationManager()
locationManager.delegate = self
#if os(iOS)
locationManager.requestAlwaysAuthorization() // for simplicity we put it here, but in the real app you should care about particular moment, when you ask for any permissions
#endif
}
}

Expand All @@ -47,13 +49,15 @@ extension AblyHelper {
}

func activateLocationPush() {
#if os(iOS)
locationManager.startMonitoringLocationPushes { deviceToken, error in
guard error == nil else {
return ARTPush.didFailToRegisterForLocationNotificationsWithError(error!, realtime: self.realtime)
}
self.locationDeviceToken = deviceToken!.deviceTokenString
ARTPush.didRegisterForLocationNotifications(withDeviceToken: deviceToken!, realtime: self.realtime)
}
#endif
}

func deactivatePush() {
Expand Down
9 changes: 5 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// swift-tools-version:5.3.0
// swift-tools-version:5.9

import PackageDescription

let package = Package(
name: "ably-cocoa",
platforms: [
.macOS(.v10_11),
.iOS(.v9),
.tvOS(.v10)
.macOS(.v10_13),
.iOS(.v12),
.tvOS(.v12),
.visionOS(.v1)
],
products: [
.library(
Expand Down
6 changes: 3 additions & 3 deletions Source/ARTAuth.m
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ - (NSDate *)handleServerTime:(NSDate *)time {

- (void)setProtocolClientId:(NSString *)clientId {
_protocolClientId = clientId;
#if TARGET_OS_IOS
#if TARGET_SUPPORTS_APNS
[self setLocalDeviceClientId_nosync:_protocolClientId];
#endif
}
Expand Down Expand Up @@ -790,7 +790,7 @@ - (void)discardTimeOffset {

- (void)setTokenDetails:(ARTTokenDetails *)tokenDetails {
_tokenDetails = tokenDetails;
#if TARGET_OS_IOS
#if TARGET_SUPPORTS_APNS
[self setLocalDeviceClientId_nosync:tokenDetails.clientId];
#endif
}
Expand Down Expand Up @@ -822,7 +822,7 @@ - (NSString *_Nullable)appId {
return parts[0];
}

#if TARGET_OS_IOS
#if TARGET_SUPPORTS_APNS
- (void)setLocalDeviceClientId_nosync:(NSString *)clientId {
if (clientId == nil || [clientId isEqualToString:@"*"] || [clientId isEqualToString:_rest.device_nosync.clientId]) {
return;
Expand Down
2 changes: 2 additions & 0 deletions Source/ARTClientInformation.m
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ + (NSString *)osName {
@"watchOS"
#elif TARGET_OS_OSX
@"macOS"
#elif TARGET_OS_VISION
@"visionOS"
#else
nil
#endif
Expand Down
2 changes: 2 additions & 0 deletions Source/ARTLocalDevice.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
NSString *const ARTDeviceFormFactor = @"tv";
#elif TARGET_OS_WATCH
NSString *const ARTDeviceFormFactor = @"watch";
#elif TARGET_OS_VISION
NSString *const ARTDeviceFormFactor = @"vision";
#elif TARGET_OS_SIMULATOR
NSString *const ARTDeviceFormFactor = @"simulator";
#elif TARGET_OS_MAC
Expand Down
Loading
Loading