Skip to content

Update CI to use macOS 13 #2060

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 26, 2023
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
45 changes: 30 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,45 +14,60 @@ concurrency:
cancel-in-progress: true

jobs:
library:
runs-on: macos-12
library-swift-latest:
name: Library (swift-latest)
runs-on: macos-13
strategy:
matrix:
xcode: ['13.4.1', '14.2']
config: ['debug', 'release']
config:
- debug
- release
steps:
- uses: actions/checkout@v3
- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
- name: Select Xcode 14.3
run: sudo xcode-select -s /Applications/Xcode_14.3.app
- name: Run ${{ matrix.config }} tests
run: CONFIG=${{ matrix.config }} make test-library

library-evolution:
library-swift-5-6:
name: Library (swift-5.6)
runs-on: macos-12
strategy:
matrix:
xcode: ['13.4.1', '14.2']
config:
- debug
- release
steps:
- uses: actions/checkout@v3
- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
- name: Select Xcode 13.4.1
run: sudo xcode-select -s /Applications/Xcode_13.4.1.app
- name: Run ${{ matrix.config }} tests
run: CONFIG=${{ matrix.config }} make test-library

library-evolution:
name: Library (evolution)
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- name: Select Xcode 14.3
run: sudo xcode-select -s /Applications/Xcode_14.3.app
- name: Build for library evolution
run: make build-for-library-evolution

benchmarks:
runs-on: macos-12
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- name: Select Xcode 14.1
run: sudo xcode-select -s /Applications/Xcode_14.2.app
- name: Select Xcode 14.3
run: sudo xcode-select -s /Applications/Xcode_14.3.app
- name: Run benchmark
run: make benchmark

examples:
runs-on: macos-12
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select -s /Applications/Xcode_14.2.app
run: sudo xcode-select -s /Applications/Xcode_14.3.app
- name: Run tests
run: make test-examples
10 changes: 5 additions & 5 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ concurrency:

jobs:
build:
runs-on: macos-12
runs-on: macos-13
steps:
- name: Select Xcode 14.1
run: sudo xcode-select -s /Applications/Xcode_14.1.app
- name: Select Xcode 14.3
run: sudo xcode-select -s /Applications/Xcode_14.3.app

- name: Checkout Package
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Checkout gh-pages Branch
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: gh-pages
path: docs-out
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ concurrency:
jobs:
swift_format:
name: swift-format
runs-on: macos-12
runs-on: macos-13
steps:
- uses: actions/checkout@v2
- name: Xcode Select
run: sudo xcode-select -s /Applications/Xcode_14.0.1.app
- name: Tap
run: brew tap pointfreeco/formulae
- name: Install
run: brew install Formulae/[email protected]
- name: Select Xcode 14.3
run: sudo xcode-select -s /Applications/Xcode_14.3.app
- name: Install swift-format
run: brew install swift-format
- name: Format
run: make format
- uses: stefanzweifel/git-auto-commit-action@v4
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
PLATFORM_IOS = iOS Simulator,name=iPhone 11 Pro Max
CONFIG = debug
PLATFORM_IOS = iOS Simulator,id=$(call udid_for,iPhone)
PLATFORM_MACOS = macOS
PLATFORM_MAC_CATALYST = macOS,variant=Mac Catalyst
PLATFORM_TVOS = tvOS Simulator,name=Apple TV
PLATFORM_WATCHOS = watchOS Simulator,name=Apple Watch Series 7 (45mm)
PLATFORM_TVOS = tvOS Simulator,id=$(call udid_for,TV)
PLATFORM_WATCHOS = watchOS Simulator,id=$(call udid_for,Watch)

default: test-all

Expand Down Expand Up @@ -58,3 +59,7 @@ format:
./Examples ./Package.swift ./Sources ./Tests

.PHONY: format test-all test-swift test-workspace

define udid_for
$(shell xcrun simctl list --json devices available $(1) | jq -r '.devices | to_entries | map(select(.value | add)) | sort_by(.key) | last.value | last.udid')
endef
4 changes: 2 additions & 2 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let package = Package(
dependencies: [
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
.package(url: "https://github.com/google/swift-benchmark", from: "0.1.0"),
.package(url: "https://github.com/pointfreeco/combine-schedulers", from: "0.8.0"),
.package(url: "https://github.com/pointfreeco/combine-schedulers", from: "0.9.2"),
.package(url: "https://github.com/pointfreeco/swift-case-paths", from: "0.14.0"),
.package(url: "https://github.com/apple/swift-collections", from: "1.0.2"),
.package(url: "https://github.com/pointfreeco/swift-custom-dump", from: "0.10.0"),
Expand Down Expand Up @@ -60,13 +60,14 @@ let package = Package(
]
)

//for target in package.targets {
//for target in package.targets where target.type != .system {
// target.swiftSettings = target.swiftSettings ?? []
// target.swiftSettings?.append(
// .unsafeFlags([
// "-c", "release",
// "-emit-module-interface", "-enable-library-evolution",
// "-Xfrontend", "-warn-concurrency",
// "-Xfrontend", "-enable-actor-data-race-checks",
// "-enable-library-evolution",
// ])
// )
//}
32 changes: 22 additions & 10 deletions Sources/ComposableArchitecture/ReducerProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,29 @@
associatedtype Action

// NB: For Xcode to favor autocompleting `var body: Body` over `var body: Never` we must use a
// type alias.
associatedtype _Body
// type alias. We compile it out of release because this workaround is incompatible with
// library evolution.
#if DEBUG
associatedtype _Body

/// A type representing the body of this reducer.
///
/// When you create a custom reducer by implementing the ``body-swift.property-7foai``, Swift
/// infers this type from the value returned.
///
/// If you create a custom reducer by implementing the ``reduce(into:action:)-8yinq``, Swift
/// infers this type to be `Never`.
typealias Body = _Body
/// A type representing the body of this reducer.
///
/// When you create a custom reducer by implementing the ``body-swift.property-7foai``, Swift
/// infers this type from the value returned.
///
/// If you create a custom reducer by implementing the ``reduce(into:action:)-8yinq``, Swift
/// infers this type to be `Never`.
typealias Body = _Body
#else
/// A type representing the body of this reducer.
///
/// When you create a custom reducer by implementing the ``body-swift.property-7foai``, Swift
/// infers this type from the value returned.
///
/// If you create a custom reducer by implementing the ``reduce(into:action:)-8yinq``, Swift
/// infers this type to be `Never`.
associatedtype Body
#endif

/// Evolves the current state of the reducer to the next state.
///
Expand Down