Skip to content

Commit

Permalink
πŸ‘·β€β™‚οΈ Try build in PR workflow (#146)
Browse files Browse the repository at this point in the history
* πŸ‘·β€β™‚οΈ Try build in PR workflow

* πŸ”§ Use recommended build settings

* 🚨 Solve some compiler warnings
  • Loading branch information
olejnjak authored Feb 7, 2024
1 parent 878fee9 commit 8eee630
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 97 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: PR
on: [pull_request]

jobs:
build:
name: Test build
uses: ./.github/workflows/build.yml
tests:
name: Tests
uses: ./.github/workflows/tests.yml
Expand Down
108 changes: 28 additions & 80 deletions ACKategories.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
LastUpgradeVersion = "1520"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1510"
LastUpgradeVersion = "1520"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1510"
LastUpgradeVersion = "1520"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1510"
LastUpgradeVersion = "1520"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down

This file was deleted.

2 changes: 2 additions & 0 deletions Sources/ACKategoriesTesting/Networking/APIServiceMock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public final class APIService_Mock: APIServicing {
case .url(let url): return url
case .path(let path):
return .ackeeCZ.appendingPathComponent(path)
@unknown default:
fatalError("Unknown case not supposed to be called")
}
}()

Expand Down
2 changes: 1 addition & 1 deletion Sources/ACKategoriesTesting/Networking/NetworkMock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Foundation
import Networking

@available(tvOS 13.0, iOS 13.0, watchOS 6.0, macOS 10.15, *)
public final class Network_Mock: Networking {
public final class Network_Mock: Network {
public var requestBody: (URLRequest) async throws -> HTTPResponse = { _ in .test() }

public init() {
Expand Down
4 changes: 2 additions & 2 deletions Sources/Networking/APIService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public final class APIService: APIServicing {
}

private let baseURLFactory: () -> URL
private let network: Networking
private let network: Network
private let requestInterceptors: [RequestInterceptor]
private let responseInterceptors: [ResponseInterceptor]

Expand All @@ -26,7 +26,7 @@ public final class APIService: APIServicing {
/// - responseInterceptors: List of response interceptors, useful for logging or token refresh
public init(
baseURL: @autoclosure @escaping () -> URL,
network: Networking,
network: Network,
requestInterceptors: [RequestInterceptor] = [],
responseInterceptors: [ResponseInterceptor] = []
) {
Expand Down
4 changes: 2 additions & 2 deletions Sources/Networking/Networking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import Foundation

/// Protocol wrapping raw network requests, basically URLSession
@available(tvOS 13.0, iOS 13.0, watchOS 6.0, macOS 10.15, *)
public protocol Networking {
public protocol Network {
/// Send given request
/// - Parameter request: Request to be sent
/// - Returns: Received response
func request(_ request: URLRequest) async throws -> HTTPResponse
}

@available(tvOS 13.0, iOS 13.0, watchOS 6.0, macOS 12.0, *)
extension URLSession: Networking {
extension URLSession: Network {
public func request(_ request: URLRequest) async throws -> HTTPResponse {
let (data, response) = try await data(for: request)

Expand Down

0 comments on commit 8eee630

Please sign in to comment.