Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CONFIG: Update GH to use macOS 15 #213

Merged
merged 4 commits into from
Nov 5, 2024
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
36 changes: 18 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ concurrency:
cancel-in-progress: true

env:
DEVELOPER_DIR: /Applications/Xcode_16.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_16.1.app/Contents/Developer

jobs:
build-test:
name: Build and Test
runs-on: macos-14
runs-on: macos-15
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:

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

# build-test-linux:
# name: Build and Test (Linux)
# runs-on: ubuntu-latest
# container: swiftlang/swift:nightly-6.0-jammy
# steps:
# - name: Checkout
# uses: actions/checkout@v4
build-test-linux:
name: Build and Test (Linux)
runs-on: ubuntu-latest
container: swift:6.0.2-jammy
steps:
- name: Checkout
uses: actions/checkout@v4

# - name: Build
# run: swift build --build-tests -Xswiftc -warnings-as-errors
- name: Build
run: swift build --build-tests -Xswiftc -warnings-as-errors

# - name: Test
# run: swift test --skip-build --filter TMDbTests
- name: Test
run: swift test --skip-build --filter TMDbTests

# - name: Build for Release
# run: swift build -c release -Xswiftc -warnings-as-errors
- name: Build for Release
run: swift build -c release -Xswiftc -warnings-as-errors
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ concurrency:
cancel-in-progress: true

env:
DEVELOPER_DIR: /Applications/Xcode_16.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_16.1.app/Contents/Developer

jobs:
analyze:
name: Analyze
runs-on: macos-14
runs-on: macos-15
timeout-minutes: 120
permissions:
actions: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ concurrency:
cancel-in-progress: true

env:
DEVELOPER_DIR: /Applications/Xcode_16.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_16.1.app/Contents/Developer

jobs:
integration-test:
name: Integration Test
runs-on: macos-14
runs-on: macos-15
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ concurrency:
jobs:
swiftLint:
name: SwiftLint
runs-on: macos-14
runs-on: macos-15
env:
DEVELOPER_DIR: /Applications/Xcode_16.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_16.1.app/Contents/Developer
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ WATCHOS_DESINTATION = 'platform=watchOS Simulator,name=Apple Watch Series 9 (45m
TVOS_DESTINATION = 'platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=18.0'
VISIONOS_DESTINATION = 'platform=visionOS Simulator,name=Apple Vision Pro,OS=2.0'

SWIFT_CONTAINER_IMAGE = swiftlang/swift:nightly-6.0-jammy
SWIFT_CONTAINER_IMAGE = swift:6.0.2-jammy

.PHONY: clean
clean:
Expand Down
4 changes: 4 additions & 0 deletions Sources/TMDb/Networking/TMDbAPIClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@

import Foundation

#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

final class TMDbAPIClient: APIClient, Sendable {

private let apiKey: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,22 @@ import Foundation
import Testing
@testable import TMDb

#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

private let isLinux = {
#if os(Linux)
return true
#else
return false
#endif
}()

@Suite(
.serialized,
.tags(.adapter)
.tags(.adapter),
.disabled(if: isLinux)
)
final class URLSessionHTTPClientAdapterTests {

Expand Down
2 changes: 1 addition & 1 deletion Tests/TMDbTests/Domain/Models/MovieTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ extension MovieTests {
backdropPath: URL(string: "/fCayJrkfRaCRCTh8GqN30f8oyQF.jpg"),
budget: 63_000_000,
revenue: 100_853_753,
homepageURL: URL(string: ""),
homepageURL: nil,
imdbID: "tt0137523",
status: .released,
productionCompanies: [
Expand Down
2 changes: 1 addition & 1 deletion Tests/TMDbTests/Domain/Models/ShowTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct ShowTests {
#expect(tvSeriesShow.date == expectedResult)
}

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

Expand Down
4 changes: 4 additions & 0 deletions Tests/TMDbTests/Networking/HTTPClient/MockURLProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@

import Foundation

#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

final class MockURLProtocol: URLProtocol, @unchecked Sendable {

@MainActor static var data: Data?
Expand Down
10 changes: 9 additions & 1 deletion Tests/TMDbTests/Networking/TMDbAPIClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ import Foundation
import Testing
@testable import TMDb

#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

@Suite(.tags(.networking))
struct TMDbAPIClientTests {

Expand Down Expand Up @@ -59,7 +63,11 @@ struct TMDbAPIClientTests {
error = err as? TMDbAPIError
}

#expect(error == .invalidURL(path))
#if canImport(FoundationNetworking)
#expect(error == .unknown)
#else
#expect(error == .invalidURL(path))
#endif
}

@Test("perform has correct URL")
Expand Down