From 5fcd2b5966fdda5de692a9831c2bdb5d752a2920 Mon Sep 17 00:00:00 2001 From: Mattt Zmuda Date: Mon, 23 Mar 2026 04:58:20 -0700 Subject: [PATCH 1/5] Update CI workflow to run Linux directly on container --- .github/workflows/ci.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ba476a6..b4d5d52b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,10 +29,10 @@ jobs: 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 @@ -51,22 +51,29 @@ jobs: run: swift test --skip-build test-linux: - name: Swift ${{ matrix.swift-version }} on Linux + name: Swift ${{ matrix.swift }} on Linux runs-on: ubuntu-latest + container: swift:${{ matrix.swift }} strategy: fail-fast: false matrix: - swift-version: - - 6.1.0 + swift: + - "6.1.3" + - "6.2.4" 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 }}-spm-${{ hashFiles('**/Package.resolved') }} + restore-keys: | + ${{ runner.os }}-swift-${{ matrix.swift }}-spm- - name: Lint run: swift format lint --strict --recursive . From 74291669d085a6f3080b1a72fec6d8b200116ba8 Mon Sep 17 00:00:00 2001 From: Mattt Zmuda Date: Mon, 23 Mar 2026 05:04:25 -0700 Subject: [PATCH 2/5] Attempt to resolve hashFiles issue --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4d5d52b..7ad3a29d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,7 @@ jobs: path: | ~/.cache/org.swift.swiftpm .build - key: ${{ runner.os }}-swift-${{ matrix.swift }}-spm-${{ hashFiles('**/Package.resolved') }} + key: ${{ runner.os }}-swift-${{ matrix.swift }}-spm-${{ hashFiles('Package.resolved') }} restore-keys: | ${{ runner.os }}-swift-${{ matrix.swift }}-spm- From ad9e2c7b4d2d0f6ab0cd442f0281fe031d2ba416 Mon Sep 17 00:00:00 2001 From: Mattt Zmuda Date: Mon, 23 Mar 2026 05:11:27 -0700 Subject: [PATCH 3/5] Add --traits AsyncHTTPClient to test matrix --- .github/workflows/ci.yml | 42 +++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ad3a29d..aedd1100 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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" @@ -23,9 +23,19 @@ 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 @@ -37,29 +47,35 @@ jobs: 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 }} 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: - - "6.1.3" - - "6.2.4" + include: + - swift: "6.1.3" + traits: "" + - swift: "6.1.3" + traits: "AsyncHTTPClient" + - swift: "6.2.4" + traits: "" + - swift: "6.2.4" + traits: "AsyncHTTPClient" timeout-minutes: 10 steps: - name: Checkout code @@ -71,15 +87,15 @@ jobs: 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 + 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) || '' }} From 501d1c9ded3768f42b0483097f74ebfab7de7ffe Mon Sep 17 00:00:00 2001 From: Mattt Zmuda Date: Mon, 23 Mar 2026 05:17:30 -0700 Subject: [PATCH 4/5] Resolve warning about try with non-throwing expression --- Tests/AnyLanguageModelTests/InstructionsTests.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/AnyLanguageModelTests/InstructionsTests.swift b/Tests/AnyLanguageModelTests/InstructionsTests.swift index d43daf41..eb326d74 100644 --- a/Tests/AnyLanguageModelTests/InstructionsTests.swift +++ b/Tests/AnyLanguageModelTests/InstructionsTests.swift @@ -16,7 +16,7 @@ struct InstructionsTests { } @Test func builderCombinesLines() throws { - let instructions = try Instructions { + let instructions = Instructions { "First line" "Second line" } @@ -28,7 +28,7 @@ struct InstructionsTests { let includeConditional = true let includeOptional = false - let instructions = try Instructions { + let instructions = Instructions { "Always" if includeConditional { "Conditional" From 25ad1d7900e696135ea2a0d6da016f962bd2706e Mon Sep 17 00:00:00 2001 From: Mattt Zmuda Date: Mon, 23 Mar 2026 05:31:59 -0700 Subject: [PATCH 5/5] Temporarily disable failing case in CI matrix --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aedd1100..35a7d06e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,8 +70,11 @@ jobs: include: - swift: "6.1.3" traits: "" - - swift: "6.1.3" - traits: "AsyncHTTPClient" + # 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"