Skip to content

Commit

Permalink
use swift 6 in CI (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsky authored Sep 21, 2024
1 parent bcdad6b commit f0bc00d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
tag: ['5.9', '5.10']
tag: ['5.9', '6.0']
container:
image: swift:${{ matrix.tag }}-focal
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/swiftpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on: macos-14
strategy:
matrix:
xcode: ['15.4', '16.1_beta']
xcode: ['15.4', '16.0']
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
steps:
Expand All @@ -39,7 +39,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
tag: ['5.9', '5.10']
tag: ['5.9', '6.0']
container:
image: swift:${{ matrix.tag }}-focal
steps:
Expand Down
6 changes: 3 additions & 3 deletions Sources/AppStoreConnect/Networking/Transport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extension URLSession: Transport {
public func send(request: URLRequest, decoder: JSONDecoder) async throws -> Response<Data> {
// These depend on swift-corelibs-foundation, which have not implemented the
// Task-based API for URLSession.
#if os(Linux) || os(Windows)
#if (os(Linux) || os(Windows)) && swift(<6.0)
return try await withCheckedThrowingContinuation { continuation in
send(request: request, decoder: decoder, completion: continuation.resume)
}
Expand Down Expand Up @@ -120,7 +120,7 @@ extension URLSession: Transport {
public func download(request: URLRequest) async throws -> Response<URL> {
// These depend on swift-corelibs-foundation, which have not implemented the
// Task-based API for URLSession.
#if os(Linux) || os(Windows)
#if (os(Linux) || os(Windows)) && swift(<6.0)
return try await withCheckedThrowingContinuation { continuation in
download(request: request, completion: continuation.resume)
}
Expand Down Expand Up @@ -191,7 +191,7 @@ extension URLSession: Transport {
public func upload(request: URLRequest, data: Data, decoder: JSONDecoder) async throws -> Response<Data> {
// These depend on swift-corelibs-foundation, which have not implemented the
// Task-based API for URLSession.
#if os(Linux) || os(Windows)
#if (os(Linux) || os(Windows)) && swift(<6.0)
return try await withCheckedThrowingContinuation { continuation in
upload(request: request, data: data, decoder: decoder, completion: continuation.resume)
}
Expand Down
28 changes: 14 additions & 14 deletions Tests/AppStoreConnectTests/FormattersTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@ final class FormattersTests: XCTestCase {
// yyyy-MM-dd'T'HH:mm:ssXXXXX
XCTAssertNotNil(iso8601Formatter.date(from: "2022-11-19T12:00:01Z"))
}
#endif

func testFormattersCodable() throws {
struct Foo: Codable, Equatable {
var date: Date
}
func testFormattersCodable() throws {
struct Foo: Codable, Equatable {
var date: Date
}

let expected = Foo(date: Date(timeIntervalSince1970: 1584216283.567))
let expected = Foo(date: Date(timeIntervalSince1970: 1584216283.567))

let encoder = JSONEncoder()
encoder.dateEncodingStrategy = .custom(encodeISO8601Date(_:encoder:))
let data = try encoder.encode(expected)
let encoder = JSONEncoder()
encoder.dateEncodingStrategy = .custom(encodeISO8601Date(_:encoder:))
let data = try encoder.encode(expected)

let decoder = JSONDecoder()
decoder.dateDecodingStrategy = .custom(decodeISO8601Date(with:))
let actual = try decoder.decode(Foo.self, from: data)
let decoder = JSONDecoder()
decoder.dateDecodingStrategy = .custom(decodeISO8601Date(with:))
let actual = try decoder.decode(Foo.self, from: data)

XCTAssertEqual(expected, actual)
}
XCTAssertEqual(expected, actual)
}
#endif

func testFormattersCodableError() throws {
struct Foo: Codable, Equatable {
Expand Down

0 comments on commit f0bc00d

Please sign in to comment.