From d9e0bb80e788dca6331dd847465047c8cf4c20c3 Mon Sep 17 00:00:00 2001 From: Hokila Jan <1647434+Hokila@users.noreply.github.com> Date: Fri, 25 Sep 2026 16:07:48 +0800 Subject: [PATCH] CI: use Xcode Swift for macOS tests while retaining Swiftly build Swiftly on macOS can fail to import XCTest while compiling test support. Keep the Swiftly build focused on production targets and run both test modes with Xcode Swift. SwiftPM build plugins invoke swift through PATH, so prepend Xcode Swift before tests; otherwise the static build config plugin may write a Swiftly configuration error instead of JSON. --- .github/workflows/pull_request.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 872ac7fc7..bdf459660 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -224,11 +224,14 @@ jobs: env: SWIFT_VERSION: "${{ matrix.swift_version }}" - name: Swift Build - run: "swift build --build-tests --disable-sandbox" + run: swift build --disable-sandbox + - name: Use Xcode Swift for tests + # Build plugins resolve `swift` through PATH, bypassing xcrun. + run: echo "$(dirname "$(xcrun --find swift)")" >> "$GITHUB_PATH" - name: Swift Test (swift-testing) - run: swift test --disable-xctest + run: xcrun swift test --disable-xctest - name: Swift Test (XCTest) - run: swift test --disable-experimental-swift-testing + run: xcrun swift test --disable-experimental-swift-testing build-swift-android: name: Sample SwiftJavaExtractJNISampleApp (Android) (swift:${{ matrix.swift_version }} android:${{matrix.sdk_triple}} NDK:${{matrix.ndk_version}})