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
16 changes: 5 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,23 @@ concurrency:
jobs:
unit-tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.runsOn }}
env:
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
runs-on: [self-hosted, macOS, mobile-ci]
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- name: 'iOS 18.2, Xcode 16.2'
destination: 'OS=18.2,name=iPhone 16 Pro'
xcode: 'Xcode_16.2'
runsOn: macos-15
- name: 'macOS 15, Xcode 16.2'
- name: 'iOS Simulator'
destination: 'platform=iOS Simulator,name=iPhone 17 Pro,OS=latest'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is this simulator installed on CI?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, they are. The CI tests passed 😊

- name: 'macOS'
destination: 'platform=macOS'
xcode: 'Xcode_16.2'
runsOn: macos-15
steps:
- uses: actions/checkout@v4

- name: 'Running unit tests on ${{ matrix.name }}'
run: |
set -o pipefail && \
xcodebuild clean test -resultBundlePath "TestResults-${{ matrix.name }}" -skipPackagePluginValidation -scheme "Networking" -destination "${{ matrix.destination }}" | tee "build-log-${{ matrix.name }}.txt" | xcpretty
xcodebuild clean test -resultBundlePath "TestResults-${{ matrix.name }}" -skipPackagePluginValidation -scheme "Networking" -destination "${{ matrix.destination }}" | tee "build-log-${{ matrix.name }}.txt"

# Missing Xcode 16 support
# https://github.com/kishikawakatsumi/xcresulttool/issues/765
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import PackageDescription
let package = Package(
name: "Networking",
platforms: [
.iOS(SupportedPlatform.IOSVersion.v14),
.iOS(SupportedPlatform.IOSVersion.v15),
.macOS(SupportedPlatform.MacOSVersion.v12),
.watchOS(SupportedPlatform.WatchOSVersion.v9)
],
Expand Down
5 changes: 0 additions & 5 deletions Sources/Networking/Core/Upload/UploadAPIManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import Foundation
4. You can retry a specific task in case of failure with ``retry(taskId:)``
5. In case you are not using a singleton instance don't forget to call ``invalidateSession(shouldFinishTasks:)`` once the instance is not needed anymore in order to prevent memory leaks, since the `UploadAPIManager` is not automatically deallocated from memory because of a `URLSession` holding a reference to it.
*/
@available(iOS 15.0, *)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'm glad we can get rid of these :)

open class UploadAPIManager: NSObject, UploadAPIManaging {
// MARK: - Public Properties
public var activeTasks: [UploadTask] {
Expand Down Expand Up @@ -77,7 +76,6 @@ open class UploadAPIManager: NSObject, UploadAPIManaging {
}

// MARK: URLSessionDataDelegate
@available(iOS 15.0, *)
extension UploadAPIManager: URLSessionDataDelegate {
nonisolated public func urlSession(
_ session: URLSession,
Expand Down Expand Up @@ -112,7 +110,6 @@ extension UploadAPIManager: URLSessionDataDelegate {
}

// MARK: - URLSessionTaskDelegate
@available(iOS 15.0, *)
extension UploadAPIManager: URLSessionTaskDelegate {
nonisolated public func urlSession(
_ session: URLSession,
Expand Down Expand Up @@ -149,7 +146,6 @@ extension UploadAPIManager: URLSessionTaskDelegate {
}

// MARK: - UploadAPIManaging
@available(iOS 15.0, *)
public extension UploadAPIManager {
func upload(_ type: UploadType, to endpoint: Requestable) async throws -> UploadTask {
let endpointRequest = EndpointRequest(endpoint, sessionId: sessionId)
Expand Down Expand Up @@ -220,7 +216,6 @@ public extension UploadAPIManager {
}

// MARK: - Private API
@available(iOS 15.0, *)
private extension UploadAPIManager {
@discardableResult
func uploadRequest(
Expand Down
2 changes: 0 additions & 2 deletions Sources/Networking/Core/Upload/UploadAPIManaging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import Foundation
/// A definition of an API layer with methods for handling data uploading.
///
/// Recommended to be used as singleton. If you wish to use multiple instances, make sure you manually invalidate url session by calling the `invalidateSession` method.
@available(iOS 15.0, *)
@NetworkingActor
public protocol UploadAPIManaging: Sendable {
typealias StateStream = AsyncStream<UploadTask.State>
Expand Down Expand Up @@ -49,7 +48,6 @@ public protocol UploadAPIManaging: Sendable {
func invalidateSession(shouldFinishTasks: Bool)
}

@available(iOS 15.0, *)
public extension UploadAPIManaging {
/// Initiates a data upload request for the specified endpoint.
/// - Parameters:
Expand Down
1 change: 0 additions & 1 deletion Sources/Networking/Core/Upload/UploadTask.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public extension UploadTask {
}

// MARK: - Internal API
@available(iOS 15.0, *)
extension UploadTask {
/// The identifier of the underlying `URLSessionUploadTask`.
var taskIdentifier: Int {
Expand Down
1 change: 0 additions & 1 deletion Tests/NetworkingTests/UploadAPIManagerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import XCTest

@NetworkingActor
@available(iOS 15.0, *)
final class UploadAPIManagerTests: XCTestCase {
enum UploadRouter: Requestable {
case mock
Expand Down
Loading