diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f81816b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +name: CI + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +jobs: + test: + name: Swift ${{ matrix.swift }} on Xcode ${{ matrix.xcode }} + runs-on: ${{ matrix.runs-on }} + env: + DEVELOPER_DIR: "/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" + strategy: + fail-fast: false + matrix: + include: + - swift: "6.0" + xcode: "16.0" + runs-on: macos-15 + - swift: "6.1" + xcode: "16.3" + runs-on: macos-15 + - swift: "6.2" + xcode: "26.0" + runs-on: macos-26 + + steps: + - uses: actions/checkout@v4 + + - name: Build + run: swift build -v + + - name: Test + run: swift test -v diff --git a/Package.swift b/Package.swift index bf23662..27611a6 100644 --- a/Package.swift +++ b/Package.swift @@ -28,7 +28,7 @@ let package = Package( dependencies: [ .product(name: "EventSource", package: "EventSource") ], - path: "Sources/HuggingFace", + path: "Sources/HuggingFace" ), .testTarget( name: "HuggingFaceTests", diff --git a/Tests/HuggingFaceTests/Helpers/MockURLProtocol.swift b/Tests/HuggingFaceTests/Helpers/MockURLProtocol.swift index 77f48b7..64afc1b 100644 --- a/Tests/HuggingFaceTests/Helpers/MockURLProtocol.swift +++ b/Tests/HuggingFaceTests/Helpers/MockURLProtocol.swift @@ -104,7 +104,7 @@ final class MockURLProtocol: URLProtocol, @unchecked Sendable { private init() {} - func withLock(_ operation: @Sendable () async throws -> T) async rethrows -> T { + func withLock(_ operation: @Sendable () async throws -> T) async rethrows -> T { // Wait for lock to be available while isLocked { try? await Task.sleep(for: .milliseconds(10))