Skip to content

Commit 71686e8

Browse files
authored
Merge pull request #52 from strvcom/feat/concurrency-improvements
[feat] Concurrency improvements
2 parents 9b3b52a + aff66a9 commit 71686e8

70 files changed

Lines changed: 823 additions & 366 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,14 @@ jobs:
2323
fail-fast: false
2424
matrix:
2525
include:
26-
- name: 'iOS 17.2'
27-
destination: 'OS=17.2,name=iPhone 15 Pro'
28-
xcode: 'Xcode_15.2'
29-
runsOn: macos-14
30-
# - name: 'iOS 16.4'
31-
# destination: 'OS=16.4,name=iPhone 14 Pro'
32-
# xcode: 'Xcode_14.3.1'
33-
# runsOn: macos-13
34-
- name: 'macOS 13, Xcode 15.2'
26+
- name: 'iOS 18.2, Xcode 16.2'
27+
destination: 'OS=18.2,name=iPhone 16 Pro'
28+
xcode: 'Xcode_16.2'
29+
runsOn: macos-15
30+
- name: 'macOS 15, Xcode 16.2'
3531
destination: 'platform=macOS'
36-
xcode: 'Xcode_15.2'
37-
runsOn: macos-14
32+
xcode: 'Xcode_16.2'
33+
runsOn: macos-15
3834
steps:
3935
- uses: actions/checkout@v4
4036

@@ -43,11 +39,13 @@ jobs:
4339
set -o pipefail && \
4440
xcodebuild clean test -resultBundlePath "TestResults-${{ matrix.name }}" -skipPackagePluginValidation -scheme "Networking" -destination "${{ matrix.destination }}" | tee "build-log-${{ matrix.name }}.txt" | xcpretty
4541
46-
- uses: kishikawakatsumi/xcresulttool@v1
47-
with:
48-
path: 'TestResults-${{ matrix.name }}.xcresult'
49-
title: '${{ matrix.name }} Test Results'
50-
if: success() || failure()
42+
# Missing Xcode 16 support
43+
# https://github.com/kishikawakatsumi/xcresulttool/issues/765
44+
# - uses: kishikawakatsumi/xcresulttool@v1
45+
# with:
46+
# path: 'TestResults-${{ matrix.name }}.xcresult'
47+
# title: '${{ matrix.name }} Test Results'
48+
# if: success() || failure()
5149

5250
- name: 'Upload Build Log'
5351
uses: actions/upload-artifact@v4

.swiftlint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ analyzer_rules:
1111
# Rule identifiers to exclude from running.
1212
#
1313
disabled_rules:
14+
- opening_brace
1415

1516
#
1617
# Some rules are only opt-in. Find all the available rules by running: swiftlint rules

.swiftpm/xcode/xcshareddata/xcschemes/Networking.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1500"
3+
LastUpgradeVersion = "1620"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

NetworkingSampleApp/NetworkingSampleApp.xcodeproj/project.pbxproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@
302302
attributes = {
303303
BuildIndependentTargetsInParallel = YES;
304304
LastSwiftUpdateCheck = 1240;
305-
LastUpgradeCheck = 1500;
305+
LastUpgradeCheck = 1620;
306306
TargetAttributes = {
307307
23A575B025F8B9DA00617551 = {
308308
CreatedOnToolsVersion = 12.4;
@@ -537,7 +537,8 @@
537537
);
538538
PRODUCT_BUNDLE_IDENTIFIER = "com.strv.networking-sample-app";
539539
PRODUCT_NAME = "$(TARGET_NAME)";
540-
SWIFT_VERSION = 5.0;
540+
SWIFT_STRICT_CONCURRENCY = complete;
541+
SWIFT_VERSION = 6.0;
541542
TARGETED_DEVICE_FAMILY = "1,2";
542543
};
543544
name = Debug;
@@ -557,7 +558,8 @@
557558
);
558559
PRODUCT_BUNDLE_IDENTIFIER = "com.strv.networking-sample-app";
559560
PRODUCT_NAME = "$(TARGET_NAME)";
560-
SWIFT_VERSION = 5.0;
561+
SWIFT_STRICT_CONCURRENCY = complete;
562+
SWIFT_VERSION = 6.0;
561563
TARGETED_DEVICE_FAMILY = "1,2";
562564
};
563565
name = Release;

NetworkingSampleApp/NetworkingSampleApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 86 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

NetworkingSampleApp/NetworkingSampleApp.xcodeproj/xcshareddata/xcschemes/NetworkingSampleApp.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1500"
3+
LastUpgradeVersion = "1620"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

NetworkingSampleApp/NetworkingSampleApp/API/SampleAuthorizationManager.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import Networking
99
import Foundation
1010

11+
@NetworkingActor
1112
final class SampleAuthorizationManager: AuthorizationManaging {
1213
let storage: AuthorizationStorageManaging = SampleAuthorizationStorageManager()
1314

NetworkingSampleApp/NetworkingSampleApp/API/SampleAuthorizationStorageManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Networking
99

10-
actor SampleAuthorizationStorageManager: AuthorizationStorageManaging {
10+
final class SampleAuthorizationStorageManager: AuthorizationStorageManaging {
1111
private var storage: AuthorizationData?
1212

1313
func saveData(_ data: AuthorizationData) async throws {

NetworkingSampleApp/NetworkingSampleApp/API/SampleErrorProcessor.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import Foundation
1010

1111
/// Maps NetworkError's unacceptableStatusCode 400 error to SampleAPIError.
1212
final class SampleErrorProcessor: ErrorProcessing {
13-
private lazy var decoder = JSONDecoder()
14-
13+
private let decoder = JSONDecoder()
14+
1515
func process(_ error: Error, for endpointRequest: EndpointRequest) -> Error {
1616
guard let networkError = error as? NetworkError,
1717
case let .unacceptableStatusCode(statusCode, _, response) = networkError,

NetworkingSampleApp/NetworkingSampleApp/Extensions/ByteCountFormatter+Convenience.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import Foundation
99

1010
extension ByteCountFormatter {
11+
@MainActor
1112
static let megaBytesFormatter: ByteCountFormatter = {
1213
let formatter = ByteCountFormatter()
1314
formatter.allowedUnits = [.useMB]

0 commit comments

Comments
 (0)