Skip to content

Commit 28af420

Browse files
authored
tech(CI): Update workflows (#26)
1 parent 3631b75 commit 28af420

File tree

10 files changed

+31
-16
lines changed

10 files changed

+31
-16
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
trim_trailing_whitespace = true
6+
7+
# 4 space indentation
8+
[*.swift]
9+
indent_style = space
10+
indent_size = 4

.github/workflows/doc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ on:
77

88
jobs:
99
doc:
10-
runs-on: macos-latest
10+
runs-on: ubuntu-latest
1111

1212
steps:
1313
- name: Checkout repo
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v4
1515

1616
- name: Publish Jazzy Docs
1717
uses: steven0351/publish-jazzy-docs@v1

.github/workflows/test.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@ on:
1010

1111
jobs:
1212
test:
13-
runs-on: macos-11
13+
runs-on: macos-latest
1414

1515
steps:
1616
- name: Checkout repo
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v4
1818

19-
- name: Lint code
20-
run: swiftlint lint
19+
- name: Lint PR code
20+
uses: stanfordbdhg/action-swiftlint@v4
21+
env:
22+
DIFF_BASE: ${{ github.base_ref }}
2123

2224
- name: Run tests
23-
run: swift test --enable-test-discovery
25+
run: swift test

Sources/SimpleHTTP/Interceptor/CompositeInterceptor.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Foundation
2-
import Combine
32

43
/// Use an Array of `Interceptor` as a single `Interceptor`
54
public struct CompositeInterceptor: ExpressibleByArrayLiteral, Sequence {

Sources/SimpleHTTP/Interceptor/Interceptor.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Foundation
2-
import Combine
32

43
public typealias Interceptor = RequestInterceptor & ResponseInterceptor
54

Sources/SimpleHTTPFoundation/Foundation/URLRequest/URLRequest+URL.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import Foundation
22

3+
#if canImport(FoundationNetworking)
4+
import FoundationNetworking
5+
#endif
6+
37
extension URLRequest {
48
/// Return a new URLRequest whose path is relative to `baseURL`
59
public func relativeTo(_ baseURL: URL) -> URLRequest {

Sources/SimpleHTTPFoundation/Foundation/URLSession+Async.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import Foundation
22

3+
#if canImport(FoundationNetworking)
4+
import FoundationNetworking
5+
#endif
6+
37
extension URLSession {
48
@available(iOS, deprecated: 15.0, message: "Use built-in API instead")
59
public func data(for urlRequest: URLRequest) async throws -> (Data, URLResponse) {

Tests/SimpleHTTPFoundationTests/Foundation/URLRequest/URLRequestTests+URL.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import Foundation
22
import XCTest
33
@testable import SimpleHTTPFoundation
44

5+
#if canImport(FoundationNetworking)
6+
import FoundationNetworking
7+
#endif
8+
59
class URLRequestURLTests: XCTestCase {
610
func test_relativeTo_requestURLHasBaseURL() {
711
let request = URLRequest(url: URL(string: "path")!)

Tests/SimpleHTTPTests/Response/URLDataResponseTests.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
import XCTest
2-
import Combine
32
@testable import SimpleHTTP
43

54
class URLDataResponseTests: XCTestCase {
6-
var cancellables: Set<AnyCancellable> = []
7-
8-
override func tearDown() {
9-
cancellables = []
10-
}
115

126
func test_validate_responseIsError_dataIsEmpty_converterIsNotCalled() throws {
137
let response = URLDataResponse(data: Data(), response: HTTPURLResponse.notFound)

Tests/SimpleHTTPTests/Session/SessionTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import XCTest
2-
import Combine
32
@testable import SimpleHTTP
43

54
class SessionAsyncTests: XCTestCase {

0 commit comments

Comments
 (0)