Skip to content

Commit

Permalink
Bump Xcode (#16)
Browse files Browse the repository at this point in the history
* Adopt enableUpcomingFeature with StrictConcurrency

* Adopt fulfillment(of:timeout:) as waitForExpectations(timeout:) is deprecated in an async context

* Bump minimum supported version to Xcode 14.3.0

* Update macOS version

* Use cached ruby version – no need to install the latest

* Bump simulator versions to match newer Xcode

* Bump macOS version in build.swift
  • Loading branch information
dfed committed Apr 25, 2023
1 parent 63c36d7 commit a232ddb
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 38 deletions.
23 changes: 7 additions & 16 deletions .github/workflows/ci.yml
Expand Up @@ -9,22 +9,19 @@ on:
jobs:
pod-lint:
name: Pod Lint
runs-on: macOS-12
runs-on: macos-13
steps:
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7.6'
- name: Checkout Repo
uses: actions/checkout@v3
- name: Bundle Install
run: bundle install
- name: Select Xcode Version
run: sudo xcode-select --switch /Applications/Xcode_14.1.0.app/Contents/Developer
run: sudo xcode-select --switch /Applications/Xcode_14.3.0.app/Contents/Developer
- name: Lint Podspec
run: bundle exec pod lib lint --verbose --fail-fast --swift-version=5.7
run: bundle exec pod lib lint --verbose --fail-fast --swift-version=5.8
spm-14:
name: Build Xcode 14
runs-on: macOS-12
runs-on: macos-13
strategy:
matrix:
platforms: [
Expand All @@ -33,15 +30,12 @@ jobs:
]
fail-fast: false
steps:
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7.6'
- name: Checkout Repo
uses: actions/checkout@v3
- name: Bundle Install
run: bundle install
- name: Select Xcode Version
run: sudo xcode-select --switch /Applications/Xcode_14.1.0.app/Contents/Developer
run: sudo xcode-select --switch /Applications/Xcode_14.3.0.app/Contents/Developer
- name: Build and Test Framework
run: Scripts/build.swift ${{ matrix.platforms }}
- name: Prepare Coverage Reports
Expand All @@ -51,16 +45,13 @@ jobs:
uses: codecov/codecov-action@v3
spm-14-swift:
name: Swift Build Xcode 14
runs-on: macOS-12
runs-on: macos-13
steps:
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7.6'
- name: Checkout Repo
uses: actions/checkout@v3
- name: Bundle Install
run: bundle install
- name: Select Xcode Version
run: sudo xcode-select --switch /Applications/Xcode_14.1.0.app/Contents/Developer
run: sudo xcode-select --switch /Applications/Xcode_14.3.0.app/Contents/Developer
- name: Build and Test Framework
run: xcrun swift test -c release -Xswiftc -enable-testing
2 changes: 1 addition & 1 deletion .ruby-version
@@ -1 +1 @@
2.7.6
3.0.6
4 changes: 2 additions & 2 deletions AsyncQueue.podspec
@@ -1,12 +1,12 @@
Pod::Spec.new do |s|
s.name = 'AsyncQueue'
s.version = '0.3.1'
s.version = '0.4.0'
s.license = 'MIT'
s.summary = 'A queue that enables ordered sending of events from synchronous to asynchronous code.'
s.homepage = 'https://github.com/dfed/swift-async-queue'
s.authors = 'Dan Federman'
s.source = { :git => 'https://github.com/dfed/swift-async-queue.git', :tag => s.version }
s.swift_version = '5.7'
s.swift_version = '5.8'
s.source_files = 'Sources/**/*.{swift}'
s.ios.deployment_target = '13.0'
s.tvos.deployment_target = '13.0'
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
@@ -1,4 +1,4 @@
ruby '2.7.6'
ruby '3.0.6'

source 'https://rubygems.org'

Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Expand Up @@ -92,7 +92,7 @@ DEPENDENCIES
cocoapods (~> 1.12.0)

RUBY VERSION
ruby 2.7.6p219
ruby 3.0.6p216

BUNDLED WITH
2.3.15
2.4.12
6 changes: 2 additions & 4 deletions Package.swift
@@ -1,4 +1,4 @@
// swift-tools-version: 5.7
// swift-tools-version: 5.8
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand All @@ -24,9 +24,7 @@ let package = Package(
name: "AsyncQueueTests",
dependencies: ["AsyncQueue"],
swiftSettings: [
// TODO: Adopt `enableUpcomingFeature` once available.
// https://github.com/apple/swift-evolution/blob/main/proposals/0362-piecemeal-future-features.md
.unsafeFlags(["-Xfrontend", "-strict-concurrency=complete"])
.enableUpcomingFeature("StrictConcurrency")
]),
]
)
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -171,12 +171,12 @@ func testMainActorQueueOrdering() async {

## Requirements

* Xcode 14.1 or later.
* Xcode 14.3 or later.
* iOS 13 or later.
* tvOS 13 or later.
* watchOS 6 or later.
* macOS 10.15 or later.
* Swift 5.7 or later.
* Swift 5.8 or later.

## Installation

Expand All @@ -186,7 +186,7 @@ To install swift-async-queue in your iOS project with [Swift Package Manager](ht

```swift
dependencies: [
.package(url: "https://github.com/dfed/swift-async-queue", from: "0.3.0"),
.package(url: "https://github.com/dfed/swift-async-queue", from: "0.4.0"),
]
```

Expand Down
8 changes: 4 additions & 4 deletions Scripts/build.swift
Expand Up @@ -47,7 +47,7 @@ enum Platform: String, CaseIterable, CustomStringConvertible {
case .iOS_15:
return "platform=iOS Simulator,OS=15.5,name=iPad Pro (12.9-inch) (5th generation)"
case .iOS_16:
return "platform=iOS Simulator,OS=16.1,name=iPad Pro (12.9-inch) (5th generation)"
return "platform=iOS Simulator,OS=16.4,name=iPad Pro (12.9-inch) (6th generation)"

case .tvOS_13:
return "platform=tvOS Simulator,OS=13.4,name=Apple TV"
Expand All @@ -56,7 +56,7 @@ enum Platform: String, CaseIterable, CustomStringConvertible {
case .tvOS_15:
return "platform=tvOS Simulator,OS=15.4,name=Apple TV"
case .tvOS_16:
return "platform=tvOS Simulator,OS=16.1,name=Apple TV"
return "platform=tvOS Simulator,OS=16.4,name=Apple TV"

case .macOS_10_15,
.macOS_11,
Expand All @@ -71,7 +71,7 @@ enum Platform: String, CaseIterable, CustomStringConvertible {
case .watchOS_8:
return "OS=8.5,name=Apple Watch Series 6 - 44mm"
case .watchOS_9:
return "OS=9.0,name=Apple Watch Series 7 (45mm)"
return "OS=9.4,name=Apple Watch Series 7 (45mm)"
}
}

Expand All @@ -96,7 +96,7 @@ enum Platform: String, CaseIterable, CustomStringConvertible {
case .macOS_12:
return "macosx12.3"
case .macOS_13:
return "macosx13.0"
return "macosx13.3"

case .watchOS_6,
.watchOS_7,
Expand Down
4 changes: 2 additions & 2 deletions Tests/AsyncQueueTests/ActorQueueTests.swift
Expand Up @@ -133,7 +133,7 @@ final class ActorQueueTests: XCTestCase {
// Signal the semaphore to unlock the enqueued tasks.
await semaphore.signal()

await waitForExpectations(timeout: 1.0)
await fulfillment(of: [expectation], timeout: 1.0)
}

func test_enqueue_doesNotRetainTaskAfterExecution() async {
Expand Down Expand Up @@ -177,7 +177,7 @@ final class ActorQueueTests: XCTestCase {
// Allow the enqueued task to complete.
await asyncSemaphore.signal()
// Make sure the task has completed.
await waitForExpectations(timeout: 1.0)
await fulfillment(of: [expectation], timeout: 1.0)

XCTAssertNil(referenceHolder.weakReference)
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/AsyncQueueTests/FIFOQueueTests.swift
Expand Up @@ -216,7 +216,7 @@ final class FIFOQueueTests: XCTestCase {
// Signal the semaphore to unlock the remaining enqueued tasks.
await semaphore.signal()

await waitForExpectations(timeout: 1.0)
await fulfillment(of: [expectation], timeout: 1.0)
}

func test_enqueueOn_executesAfterReceiverIsDeallocated() async {
Expand All @@ -241,7 +241,7 @@ final class FIFOQueueTests: XCTestCase {
// Signal the semaphore to unlock the remaining enqueued tasks.
await semaphore.signal()

await waitForExpectations(timeout: 1.0)
await fulfillment(of: [expectation], timeout: 1.0)
}

func test_enqueue_doesNotRetainTaskAfterExecution() async {
Expand Down
2 changes: 1 addition & 1 deletion Tests/AsyncQueueTests/MainActorQueueTests.swift
Expand Up @@ -128,7 +128,7 @@ final class MainActorQueueTests: XCTestCase {
// Allow the enqueued task to complete.
await asyncSemaphore.signal()
// Make sure the task has completed.
await waitForExpectations(timeout: 1.0)
await fulfillment(of: [expectation], timeout: 1.0)

XCTAssertNil(referenceHolder.weakReference)
}
Expand Down

0 comments on commit a232ddb

Please sign in to comment.