Skip to content

Commit b16c263

Browse files
authored
CONFIG: Update GH to use macOS 15 (#213)
* CONFIG: Update GH to use macOS 15 * Update linux swift container * Fix tests for Linux * Fix lint error
1 parent 08a71c9 commit b16c263

File tree

11 files changed

+58
-29
lines changed

11 files changed

+58
-29
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ concurrency:
1717
cancel-in-progress: true
1818

1919
env:
20-
DEVELOPER_DIR: /Applications/Xcode_16.app/Contents/Developer
20+
DEVELOPER_DIR: /Applications/Xcode_16.1.app/Contents/Developer
2121

2222
jobs:
2323
build-test:
2424
name: Build and Test
25-
runs-on: macos-14
25+
runs-on: macos-15
2626
steps:
2727
- name: Checkout
2828
uses: actions/checkout@v4
@@ -52,7 +52,7 @@ jobs:
5252

5353
build-and-test-platforms:
5454
name: Build and Test (${{ matrix.name }})
55-
runs-on: macos-14
55+
runs-on: macos-15
5656
continue-on-error: true
5757
strategy:
5858
matrix:
@@ -63,8 +63,8 @@ jobs:
6363
destination: platform=watchOS Simulator,name=Apple Watch Series 10 (46mm),OS=11.0
6464
- name: tvOS
6565
destination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=18.0
66-
# - name: visionOS
67-
# destination: platform=visionOS Simulator,name=Apple Vision Pro,OS=2.0
66+
- name: visionOS
67+
destination: platform=visionOS Simulator,name=Apple Vision Pro,OS=2.0
6868
steps:
6969
- name: Checkout
7070
uses: actions/checkout@v4
@@ -75,19 +75,19 @@ jobs:
7575
- name: Test
7676
run: set -o pipefail && NSUnbufferedIO=YES xcodebuild test-without-building -scheme TMDb -only-testing TMDbTests -destination '${{ matrix.destination }}'
7777

78-
# build-test-linux:
79-
# name: Build and Test (Linux)
80-
# runs-on: ubuntu-latest
81-
# container: swiftlang/swift:nightly-6.0-jammy
82-
# steps:
83-
# - name: Checkout
84-
# uses: actions/checkout@v4
78+
build-test-linux:
79+
name: Build and Test (Linux)
80+
runs-on: ubuntu-latest
81+
container: swift:6.0.2-jammy
82+
steps:
83+
- name: Checkout
84+
uses: actions/checkout@v4
8585

86-
# - name: Build
87-
# run: swift build --build-tests -Xswiftc -warnings-as-errors
86+
- name: Build
87+
run: swift build --build-tests -Xswiftc -warnings-as-errors
8888

89-
# - name: Test
90-
# run: swift test --skip-build --filter TMDbTests
89+
- name: Test
90+
run: swift test --skip-build --filter TMDbTests
9191

92-
# - name: Build for Release
93-
# run: swift build -c release -Xswiftc -warnings-as-errors
92+
- name: Build for Release
93+
run: swift build -c release -Xswiftc -warnings-as-errors

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ concurrency:
1717
cancel-in-progress: true
1818

1919
env:
20-
DEVELOPER_DIR: /Applications/Xcode_16.app/Contents/Developer
20+
DEVELOPER_DIR: /Applications/Xcode_16.1.app/Contents/Developer
2121

2222
jobs:
2323
analyze:
2424
name: Analyze
25-
runs-on: macos-14
25+
runs-on: macos-15
2626
timeout-minutes: 120
2727
permissions:
2828
actions: read

.github/workflows/integration.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ concurrency:
2020
cancel-in-progress: true
2121

2222
env:
23-
DEVELOPER_DIR: /Applications/Xcode_16.app/Contents/Developer
23+
DEVELOPER_DIR: /Applications/Xcode_16.1.app/Contents/Developer
2424

2525
jobs:
2626
integration-test:
2727
name: Integration Test
28-
runs-on: macos-14
28+
runs-on: macos-15
2929
steps:
3030
- name: Checkout
3131
uses: actions/checkout@v4

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ concurrency:
1919
jobs:
2020
swiftLint:
2121
name: SwiftLint
22-
runs-on: macos-14
22+
runs-on: macos-15
2323
env:
24-
DEVELOPER_DIR: /Applications/Xcode_16.app/Contents/Developer
24+
DEVELOPER_DIR: /Applications/Xcode_16.1.app/Contents/Developer
2525
steps:
2626
- name: Checkout
2727
uses: actions/checkout@v4

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ WATCHOS_DESINTATION = 'platform=watchOS Simulator,name=Apple Watch Series 9 (45m
77
TVOS_DESTINATION = 'platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=18.0'
88
VISIONOS_DESTINATION = 'platform=visionOS Simulator,name=Apple Vision Pro,OS=2.0'
99

10-
SWIFT_CONTAINER_IMAGE = swiftlang/swift:nightly-6.0-jammy
10+
SWIFT_CONTAINER_IMAGE = swift:6.0.2-jammy
1111

1212
.PHONY: clean
1313
clean:

Sources/TMDb/Networking/TMDbAPIClient.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919

2020
import Foundation
2121

22+
#if canImport(FoundationNetworking)
23+
import FoundationNetworking
24+
#endif
25+
2226
final class TMDbAPIClient: APIClient, Sendable {
2327

2428
private let apiKey: String

Tests/TMDbTests/Adapters/URLSessionHTTPClientAdapterTests.swift

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,22 @@ import Foundation
2121
import Testing
2222
@testable import TMDb
2323

24+
#if canImport(FoundationNetworking)
25+
import FoundationNetworking
26+
#endif
27+
28+
private let isLinux = {
29+
#if os(Linux)
30+
return true
31+
#else
32+
return false
33+
#endif
34+
}()
35+
2436
@Suite(
2537
.serialized,
26-
.tags(.adapter)
38+
.tags(.adapter),
39+
.disabled(if: isLinux)
2740
)
2841
final class URLSessionHTTPClientAdapterTests {
2942

Tests/TMDbTests/Domain/Models/MovieTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ extension MovieTests {
6464
backdropPath: URL(string: "/fCayJrkfRaCRCTh8GqN30f8oyQF.jpg"),
6565
budget: 63_000_000,
6666
revenue: 100_853_753,
67-
homepageURL: URL(string: ""),
67+
homepageURL: nil,
6868
imdbID: "tt0137523",
6969
status: .released,
7070
productionCompanies: [

Tests/TMDbTests/Domain/Models/ShowTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ struct ShowTests {
5858
#expect(tvSeriesShow.date == expectedResult)
5959
}
6060

61-
@Test("JSON decoding of Movie", .tags(.decoding))
61+
@Test("JSON decoding of Show", .tags(.decoding))
6262
func testDecodeReturnsMovie() throws {
6363
let result = try JSONDecoder.theMovieDatabase.decode(Show.self, fromResource: "show-movie")
6464

Tests/TMDbTests/Networking/HTTPClient/MockURLProtocol.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919

2020
import Foundation
2121

22+
#if canImport(FoundationNetworking)
23+
import FoundationNetworking
24+
#endif
25+
2226
final class MockURLProtocol: URLProtocol, @unchecked Sendable {
2327

2428
@MainActor static var data: Data?

Tests/TMDbTests/Networking/TMDbAPIClientTests.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ import Foundation
2121
import Testing
2222
@testable import TMDb
2323

24+
#if canImport(FoundationNetworking)
25+
import FoundationNetworking
26+
#endif
27+
2428
@Suite(.tags(.networking))
2529
struct TMDbAPIClientTests {
2630

@@ -59,7 +63,11 @@ struct TMDbAPIClientTests {
5963
error = err as? TMDbAPIError
6064
}
6165

62-
#expect(error == .invalidURL(path))
66+
#if canImport(FoundationNetworking)
67+
#expect(error == .unknown)
68+
#else
69+
#expect(error == .invalidURL(path))
70+
#endif
6371
}
6472

6573
@Test("perform has correct URL")

0 commit comments

Comments
 (0)