Skip to content
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
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,33 @@ jobs:
- name: Build tests for watchOS Simulator
run: xcodebuild build-for-testing -scheme AnyLanguageModel -destination 'generic/platform=watchOS Simulator' CODE_SIGNING_ALLOWED=NO

build-tvos:
permissions:
contents: read
name: Build for tvOS with Xcode ${{ matrix.xcode }}
runs-on: ${{ matrix.runner }}
env:
DEVELOPER_DIR: "/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer"
strategy:
fail-fast: false
matrix:
include:
- runner: macos-26
xcode: "26.4.1"
- runner: xcode-27
xcode: "27.0"
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Build for tvOS
run: xcodebuild build -scheme AnyLanguageModel -destination 'generic/platform=tvOS' CODE_SIGNING_ALLOWED=NO

- name: Build tests for tvOS Simulator
if: matrix.xcode == '27.0'
run: xcodebuild build-for-testing -scheme AnyLanguageModel -destination 'generic/platform=tvOS Simulator' CODE_SIGNING_ALLOWED=NO

test-linux:
permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion Sources/AnyLanguageModel/Models/SystemLanguageModel.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if canImport(FoundationModels)
#if canImport(FoundationModels) && (!os(tvOS) || compiler(<6.4))
import FoundationModels
import Foundation

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Testing

#if canImport(FoundationModels) && !os(watchOS)
#if canImport(FoundationModels) && (!os(tvOS) || compiler(<6.4)) && !os(watchOS)
import AnyLanguageModel

private let isSystemLanguageModelAvailable: Bool = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Testing

#if canImport(FoundationModels) && !os(watchOS)
#if canImport(FoundationModels) && (!os(tvOS) || compiler(<6.4)) && !os(watchOS)
import FoundationModels

private let isFoundationModelsSystemLanguageModelAvailable: Bool = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Foundation

@testable import AnyLanguageModel

#if canImport(FoundationModels)
#if canImport(FoundationModels) && (!os(tvOS) || compiler(<6.4))
import FoundationModels
import enum JSONSchema.JSONSchema

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Testing
@testable import AnyLanguageModel

#if canImport(FoundationModels)
#if canImport(FoundationModels) && (!os(tvOS) || compiler(<6.4))
import struct FoundationModels.GenerationOptions

@Suite("FoundationModels GenerationOptions")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Testing

@testable import AnyLanguageModel

#if canImport(FoundationModels)
#if canImport(FoundationModels) && (!os(tvOS) || compiler(<6.4))
import FoundationModels

private let isFoundationModelsAvailable: Bool = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Testing

@testable import AnyLanguageModel

#if canImport(FoundationModels)
#if canImport(FoundationModels) && (!os(tvOS) || compiler(<6.4))
import FoundationModels

@Suite("Inline objects for Foundation Models")
Expand Down
4 changes: 2 additions & 2 deletions Tests/AnyLanguageModelTests/PromptAttachmentTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ struct PromptAttachmentTests {
)
}

#if canImport(FoundationModels)
#if canImport(FoundationModels) && (!os(tvOS) || compiler(<6.4))
@available(macOS 26.0, iOS 26.0, watchOS 27.0, tvOS 26.0, visionOS 26.0, *)
@Test func duplicateSuppressionDoesNotReencodeRecordedAttachments() throws {
let encoded = try AnyLanguageModel.Prompt {
Expand Down Expand Up @@ -262,7 +262,7 @@ struct PromptAttachmentTests {
#endif
#endif

#if canImport(FoundationModels)
#if canImport(FoundationModels) && (!os(tvOS) || compiler(<6.4))
@Test func bridgeErrorsDescribeTheirCause() {
let unavailable = AnyLanguageModel.PromptBridgeError.attachmentsUnavailable
let nonFileURL = AnyLanguageModel.PromptBridgeError.nonFileImageURL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Testing

@testable import AnyLanguageModel

#if canImport(FoundationModels)
#if canImport(FoundationModels) && (!os(tvOS) || compiler(<6.4))
import FoundationModels

@Suite("Schema property order for Foundation Models")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Testing

@testable import AnyLanguageModel

#if canImport(FoundationModels)
#if canImport(FoundationModels) && (!os(tvOS) || compiler(<6.4))
import FoundationModels

private let isFoundationModelsAvailable: Bool = {
Expand Down
2 changes: 1 addition & 1 deletion Tests/AnyLanguageModelTests/SystemLanguageModelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Testing

@testable import AnyLanguageModel

#if canImport(FoundationModels) && !os(watchOS)
#if canImport(FoundationModels) && (!os(tvOS) || compiler(<6.4)) && !os(watchOS)
import class FoundationModels.LanguageModelSession

private typealias LanguageModelSession = AnyLanguageModel.LanguageModelSession
Expand Down
2 changes: 1 addition & 1 deletion Tests/AnyLanguageModelTests/TranscriptTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct TranscriptTests {
#expect(Transcript.Segment.image(image).id == "image-id")
}

#if canImport(FoundationModels)
#if canImport(FoundationModels) && (!os(tvOS) || compiler(<6.4))
@available(macOS 26.0, iOS 26.0, watchOS 27.0, tvOS 26.0, visionOS 26.0, *)
@Test func bridgesStructuredSegmentToFoundationModels() throws {
let content = try GeneratedContent(json: #"{"name":"Ana"}"#)
Expand Down
Loading