10000 CONFIG: Update GH to use macOS 15 (#213) · adamayoung/TMDb@b16c263 · GitHub
[go: up one dir, main page]

Skip to content

Commit

Permalink
CONFIG: Update GH to use macOS 15 (#213)
Browse files Browse the repository at this point in the history
* CONFIG: Update GH to use macOS 15

* Update linux swift container

* Fix tests for Linux

* Fix lint error
  • Loading branch information
adamayoung authored Nov 5, 2024
1 parent 08a71c9 commit b16c263
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 29 deletions.
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
15 changes: 14 additions & 1 deletion Tests/TMDbTests/Adapters/URLSessionHTTPClientAdapterTests.swift
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/Dom 6D4E ain/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

0 comments on commit b16c263

Please sign in to comment.
0