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
58 changes: 42 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:

jobs:
test-macos:
name: Swift ${{ matrix.swift }} on macOS ${{ matrix.macos }} with Xcode ${{ matrix.xcode }}
name: Swift ${{ matrix.swift }} on macOS ${{ matrix.macos }} with Xcode ${{ matrix.xcode }}${{ matrix.traits != '' && format(' and --traits {0}', matrix.traits) || '' }}
runs-on: macos-${{ matrix.macos }}
env:
DEVELOPER_DIR: "/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer"
Expand All @@ -23,56 +23,82 @@ jobs:
- macos: "15"
swift: "6.1"
xcode: "16.3"
traits: ""
- macos: "15"
swift: "6.1"
xcode: "16.3"
traits: "AsyncHTTPClient"
- macos: "26"
swift: "6.2"
xcode: "26.0"
traits: ""
- macos: "26"
swift: "6.2"
xcode: "26.0"
traits: "AsyncHTTPClient"
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Cache Swift Package Manager dependencies
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: |
~/.cache/org.swift.swiftpm
.build
key: ${{ runner.os }}-swift-${{ matrix.swift }}-spm-${{ hashFiles('**/Package.resolved') }}
key: ${{ runner.os }}-swift-${{ matrix.swift }}-${{ matrix.traits == '' && 'ahc-off' || 'ahc-on' }}-spm-${{ hashFiles('Package.swift', 'Package.resolved') }}
restore-keys: |
${{ runner.os }}-swift-${{ matrix.swift }}-spm-
${{ runner.os }}-swift-${{ matrix.swift }}-${{ matrix.traits == '' && 'ahc-off' || 'ahc-on' }}-spm-

- name: Lint
run: swift format lint --strict --recursive .

- name: Build
run: swift build --build-tests --traits MLX,Llama,CoreML
run: swift build --build-tests --traits MLX,Llama,CoreML${{ matrix.traits != '' && format(',{0}', matrix.traits) || '' }}

- name: Test
run: swift test --skip-build
run: swift test --skip-build --traits MLX,Llama,CoreML${{ matrix.traits != '' && format(',{0}', matrix.traits) || '' }}

test-linux:
name: Swift ${{ matrix.swift-version }} on Linux
name: Swift ${{ matrix.swift }} on Linux${{ matrix.traits != '' && format(' and --traits {0}', matrix.traits) || '' }}
runs-on: ubuntu-latest
container: swift:${{ matrix.swift }}
strategy:
fail-fast: false
matrix:
swift-version:
- 6.1.0
include:
- swift: "6.1.3"
traits: ""
# Temporary workaround: Skip AsyncHTTPClient on Linux Swift 6.1
# due to toolchain linker failure in libswiftObservation.so (undefined swift::threading::fatal).
# Keep AsyncHTTPClient coverage on Linux Swift 6.2 and re-enable here once fixed upstream.
# - swift: "6.1.3"
# traits: "AsyncHTTPClient"
- swift: "6.2.4"
traits: ""
- swift: "6.2.4"
traits: "AsyncHTTPClient"
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup Swift
uses: vapor/swiftly-action@v0.2
- name: Cache Swift Package Manager dependencies
uses: actions/cache@v5
with:
toolchain: ${{ matrix.swift-version }}
path: |
~/.cache/org.swift.swiftpm
.build
key: ${{ runner.os }}-swift-${{ matrix.swift }}-${{ matrix.traits == '' && 'ahc-off' || 'ahc-on' }}-spm-${{ hashFiles('Package.swift', 'Package.resolved') }}
restore-keys: |
${{ runner.os }}-swift-${{ matrix.swift }}-${{ matrix.traits == '' && 'ahc-off' || 'ahc-on' }}-spm-

- name: Lint
run: swift format lint --strict --recursive .

- name: Build
run: swift build
run: swift build${{ matrix.traits != '' && format(' --traits {0}', matrix.traits) || '' }}

- name: Test
run: swift test
run: swift test${{ matrix.traits != '' && format(' --traits {0}', matrix.traits) || '' }}
4 changes: 2 additions & 2 deletions Tests/AnyLanguageModelTests/InstructionsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct InstructionsTests {
}

@Test func builderCombinesLines() throws {
let instructions = try Instructions {
let instructions = Instructions {
"First line"
"Second line"
}
Expand All @@ -28,7 +28,7 @@ struct InstructionsTests {
let includeConditional = true
let includeOptional = false

let instructions = try Instructions {
let instructions = Instructions {
"Always"
if includeConditional {
"Conditional"
Expand Down