Skip to content
Merged
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
78 changes: 40 additions & 38 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
with:
submodules: true

# This step can be removed once the runners’ default version of Xcode is 16 or above
# This step can be removed once the runners’ default version of Xcode is 26 or above
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 16.3
xcode-version: 26.0

# We use caching for Mint because at the time of writing SwiftLint took about 5 minutes to build in CI, which is unacceptably slow.
# https://github.com/actions/cache/blob/40c3b67b2955d93d83b27ed164edd0756bc24049/examples.md#swift---mint
Expand All @@ -50,7 +50,7 @@ jobs:
# This step can be removed once the runners’ default version of Xcode is 16 or above
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 16.3
xcode-version: 26.0

- name: Spec coverage
run: swift run BuildTool spec-coverage
Expand All @@ -69,7 +69,7 @@ jobs:
# This step can be removed once the runners’ default version of Xcode is 16 or above
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 16.3
xcode-version: 26.0

- id: generation-step
run: swift run BuildTool generate-matrices >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -139,38 +139,39 @@ jobs:
- name: Run tests
run: swift run BuildTool test-library --platform ${{ matrix.platform }}

code-coverage:
name: Generate code coverage
runs-on: macos-15

steps:
- uses: actions/checkout@v4
with:
submodules: true

# This step can be removed once the runners’ default version of Xcode is 16 or above
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 16.3

- run: swift run BuildTool generate-code-coverage --result-bundle-path CodeCoverage.xcresult

# Generate a Markdown report of the code coverage information and add it to the workflow run.
#
# This tool is the best option that I could find after a brief look at the options. There are a few things that I wish it could do:
#
# - post a message on the pull request, like they do on Kotlin
# - offer more fine-grained configuration about which data to include in the report (I only care about code coverage, not test results, and I don't care about code coverage of the AblyChatTests target)
#
# but it'll do for now (we can always fork or have another look for tooling later).
- uses: slidoapp/xcresulttool@v3.1.0
with:
path: CodeCoverage.xcresult
# This title will be used for the sidebar item that this job adds to GitHub results page for this workflow
title: Code coverage results
# Turning off as much non-code-coverage information as it lets me
show-passed-tests: false
if: success() || failure()
# TODO: Disabled after this started failing when we switched to Xcode 26; investigate https://github.com/ably/ably-chat-swift/issues/361
# code-coverage:
# name: Generate code coverage
# runs-on: macos-15
#
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: true
#
# # This step can be removed once the runners’ default version of Xcode is 16 or above
# - uses: maxim-lobanov/setup-xcode@v1
# with:
# xcode-version: 26.0
#
# - run: swift run BuildTool generate-code-coverage --result-bundle-path CodeCoverage.xcresult
#
# # Generate a Markdown report of the code coverage information and add it to the workflow run.
# #
# # This tool is the best option that I could find after a brief look at the options. There are a few things that I wish it could do:
# #
# # - post a message on the pull request, like they do on Kotlin
# # - offer more fine-grained configuration about which data to include in the report (I only care about code coverage, not test results, and I don't care about code coverage of the AblyChatTests target)
# #
# # but it'll do for now (we can always fork or have another look for tooling later).
# - uses: slidoapp/xcresulttool@v3.1.0
# with:
# path: CodeCoverage.xcresult
# # This title will be used for the sidebar item that this job adds to GitHub results page for this workflow
# title: Code coverage results
# # Turning off as much non-code-coverage information as it lets me
# show-passed-tests: false
# if: success() || failure()

build-release-configuration-xcode:
name: Xcode, `release` configuration, ${{matrix.platform}} (Xcode ${{ matrix.tooling.xcodeVersion }})
Expand Down Expand Up @@ -228,7 +229,7 @@ jobs:
# This step can be removed once the runners’ default version of Xcode is 16 or above
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 16.3
xcode-version: 26.0

# Dry run upload-action to get base-path url
- name: Dry-Run Upload (to get url)
Expand Down Expand Up @@ -281,7 +282,8 @@ jobs:
- build-release-configuration-xcode
- check-example-app
- check-documentation
- code-coverage
# TODO restore
# - code-coverage

steps:
- name: No-op
Expand Down
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.0
6.2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1610"
LastUpgradeVersion = "2600"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion .swiftpm/xcode/xcshareddata/xcschemes/AblyChat.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1600"
LastUpgradeVersion = "2600"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion .swiftpm/xcode/xcshareddata/xcschemes/BuildTool.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1610"
LastUpgradeVersion = "2600"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
10 changes: 9 additions & 1 deletion Example/AblyChatExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1540;
LastUpgradeCheck = 1600;
LastUpgradeCheck = 2600;
TargetAttributes = {
21F09A9B2C60CAF00025AF73 = {
CreatedOnToolsVersion = 15.4;
Expand Down Expand Up @@ -198,6 +198,7 @@
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_STRICT_CONCURRENCY = complete;
Expand Down Expand Up @@ -257,6 +258,7 @@
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_TREAT_WARNINGS_AS_ERRORS = YES;
Expand All @@ -274,7 +276,10 @@
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"AblyChatExample/Preview Content\"";
ENABLE_APP_SANDBOX = YES;
ENABLE_OUTGOING_NETWORK_CONNECTIONS = YES;
ENABLE_PREVIEWS = YES;
ENABLE_USER_SELECTED_FILES = readonly;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_CFBundleDisplayName = "Ably Chat";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools";
Expand Down Expand Up @@ -314,7 +319,10 @@
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"AblyChatExample/Preview Content\"";
ENABLE_APP_SANDBOX = YES;
ENABLE_OUTGOING_NETWORK_CONNECTIONS = YES;
ENABLE_PREVIEWS = YES;
ENABLE_USER_SELECTED_FILES = readonly;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_CFBundleDisplayName = "Ably Chat";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools";
Expand Down
9 changes: 1 addition & 8 deletions Example/AblyChatExample/AblyChatExample.entitlements
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
<?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>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
<dict/>
</plist>
26 changes: 13 additions & 13 deletions Example/AblyChatExample/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ private enum Environment: Equatable {
case .mock:
return MockChatClient(
realtime: MockRealtime(),
clientOptions: ChatClientOptions()
clientOptions: ChatClientOptions(),
)
case let .live(key: key, clientId: clientId):
let realtimeOptions = ARTClientOptions()
Expand Down Expand Up @@ -136,7 +136,7 @@ struct ContentView: View {
},
onDeleteReaction: { reaction in
deleteMessageReaction(reaction, messageSerial: messageItem.message.serial)
}
},
).id(item.id)
.flip()
}
Expand Down Expand Up @@ -262,19 +262,19 @@ struct ContentView: View {
.message(
.init(
message: message,
isSender: message.clientID == currentClientID
)
isSender: message.clientID == currentClientID,
),
),
at: 0
at: 0,
)
}
case .updated, .deleted:
if let index = listItems.firstIndex(where: { $0.id == message.id }) {
listItems[index] = .message(
.init(
message: message,
isSender: message.clientID == currentClientID
)
isSender: message.clientID == currentClientID,
),
)
}
}
Expand Down Expand Up @@ -308,8 +308,8 @@ struct ContentView: View {
listItems[index] = try .message(
.init(
message: reactedMessageItem.message.with(summaryEvent: summaryEvent),
isSender: reactedMessageItem.message.clientID == currentClientID
)
isSender: reactedMessageItem.message.clientID == currentClientID,
),
)
}
}
Expand All @@ -326,10 +326,10 @@ struct ContentView: View {
listItems.insert(
.presence(
.init(
presence: event
)
presence: event,
),
),
at: 0
at: 0,
)
}
}
Expand Down Expand Up @@ -482,7 +482,7 @@ extension ContentView {
opacity: 1.0,
rotationAngle: 0, // Initial angle
rotationSpeed: randomRotationSpeed,
duration: duration
duration: duration,
)

reactions.append(newReaction)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct MessageReactionSummaryView: View {
.confirmationDialog(
"Reaction Options",
isPresented: $showReactionMenu,
titleVisibility: .visible
titleVisibility: .visible,
) {
Button("Show who reacted") {
showAllReactionsSheet = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ struct MessageReactionsPicker: View {
#if os(iOS)
.background(
BlurView(style: .systemUltraThinMaterial)
.clipShape(RoundedRectangle(cornerRadius: 24, style: .continuous))
.clipShape(RoundedRectangle(cornerRadius: 24, style: .continuous)),
)
#elseif os(macOS)
.background(
BlurView(material: .hudWindow, blendingMode: .withinWindow)
.clipShape(RoundedRectangle(cornerRadius: 24, style: .continuous))
.clipShape(RoundedRectangle(cornerRadius: 24, style: .continuous)),
)
#endif
.padding(.horizontal, 0)
Expand Down
10 changes: 5 additions & 5 deletions Example/AblyChatExample/MessageViews/MessageReactionsSheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct MessageReactionsSheet: View {
reactions[key] = ReactionItem(
emoji: emoji,
author: clientId,
count: 1
count: 1,
)
}
}
Expand Down Expand Up @@ -78,12 +78,12 @@ struct MessageReactionsSheet: View {
#if os(iOS)
.background(
RoundedRectangle(cornerRadius: 16)
.fill(Color(.systemBackground).opacity(0.7))
.fill(Color(.systemBackground).opacity(0.7)),
)
#elseif os(macOS)
.background(
RoundedRectangle(cornerRadius: 16)
.fill(Color(NSColor.windowBackgroundColor).opacity(0.7))
.fill(Color(NSColor.windowBackgroundColor).opacity(0.7)),
)
#endif
}
Expand All @@ -101,12 +101,12 @@ struct MessageReactionsSheet: View {
#if os(iOS)
.background(
BlurView(style: .systemUltraThinMaterial)
.clipShape(RoundedRectangle(cornerRadius: 24, style: .continuous))
.clipShape(RoundedRectangle(cornerRadius: 24, style: .continuous)),
)
#elseif os(macOS)
.background(
BlurView(material: .hudWindow, blendingMode: .withinWindow)
.clipShape(RoundedRectangle(cornerRadius: 24, style: .continuous))
.clipShape(RoundedRectangle(cornerRadius: 24, style: .continuous)),
)
#endif
.padding(.horizontal, 0)
Expand Down
6 changes: 3 additions & 3 deletions Example/AblyChatExample/MessageViews/MessageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct MessageView: View {
showReactionPicker = true
},
onAddReaction: onAddReaction,
onDeleteReaction: onDeleteReaction
onDeleteReaction: onDeleteReaction,
)
.padding(left: 2)
}
Expand All @@ -52,11 +52,11 @@ struct MessageView: View {
isEditing = true
}, onDelete: {
isDeleteConfirmationPresented = true
}
},
)
.confirmationDialog(
"Are you sure?",
isPresented: $isDeleteConfirmationPresented
isPresented: $isDeleteConfirmationPresented,
) {
Button("Delete message", role: .destructive) {
onDeleteMessage()
Expand Down
4 changes: 2 additions & 2 deletions Example/AblyChatExample/Mocks/Misc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ final class MockMessagesPaginatedResult: PaginatedResult {
headers: [:],
version: .init(
serial: "",
timestamp: Date()
timestamp: Date(),
),
timestamp: Date()
timestamp: Date(),
)
}
}
Expand Down
Loading