Skip to content

Commit 3ef0adc

Browse files
authored
Update CI to use macOS 13 (#2060)
* Update CI to use macOS 13 * wip * wip * wip * wip * wip * wip
1 parent 14c11ad commit 3ef0adc

File tree

8 files changed

+78
-47
lines changed

8 files changed

+78
-47
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,45 +14,60 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
jobs:
17-
library:
18-
runs-on: macos-12
17+
library-swift-latest:
18+
name: Library (swift-latest)
19+
runs-on: macos-13
1920
strategy:
2021
matrix:
21-
xcode: ['13.4.1', '14.2']
22-
config: ['debug', 'release']
22+
config:
23+
- debug
24+
- release
2325
steps:
2426
- uses: actions/checkout@v3
25-
- name: Select Xcode ${{ matrix.xcode }}
26-
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
27+
- name: Select Xcode 14.3
28+
run: sudo xcode-select -s /Applications/Xcode_14.3.app
2729
- name: Run ${{ matrix.config }} tests
2830
run: CONFIG=${{ matrix.config }} make test-library
2931

30-
library-evolution:
32+
library-swift-5-6:
33+
name: Library (swift-5.6)
3134
runs-on: macos-12
3235
strategy:
3336
matrix:
34-
xcode: ['13.4.1', '14.2']
37+
config:
38+
- debug
39+
- release
3540
steps:
3641
- uses: actions/checkout@v3
37-
- name: Select Xcode ${{ matrix.xcode }}
38-
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
42+
- name: Select Xcode 13.4.1
43+
run: sudo xcode-select -s /Applications/Xcode_13.4.1.app
44+
- name: Run ${{ matrix.config }} tests
45+
run: CONFIG=${{ matrix.config }} make test-library
46+
47+
library-evolution:
48+
name: Library (evolution)
49+
runs-on: macos-13
50+
steps:
51+
- uses: actions/checkout@v3
52+
- name: Select Xcode 14.3
53+
run: sudo xcode-select -s /Applications/Xcode_14.3.app
3954
- name: Build for library evolution
4055
run: make build-for-library-evolution
4156

4257
benchmarks:
43-
runs-on: macos-12
58+
runs-on: macos-13
4459
steps:
4560
- uses: actions/checkout@v3
46-
- name: Select Xcode 14.1
47-
run: sudo xcode-select -s /Applications/Xcode_14.2.app
61+
- name: Select Xcode 14.3
62+
run: sudo xcode-select -s /Applications/Xcode_14.3.app
4863
- name: Run benchmark
4964
run: make benchmark
5065

5166
examples:
52-
runs-on: macos-12
67+
runs-on: macos-13
5368
steps:
5469
- uses: actions/checkout@v3
5570
- name: Select Xcode ${{ matrix.xcode }}
56-
run: sudo xcode-select -s /Applications/Xcode_14.2.app
71+
run: sudo xcode-select -s /Applications/Xcode_14.3.app
5772
- name: Run tests
5873
run: make test-examples

.github/workflows/documentation.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ concurrency:
1717

1818
jobs:
1919
build:
20-
runs-on: macos-12
20+
runs-on: macos-13
2121
steps:
22-
- name: Select Xcode 14.1
23-
run: sudo xcode-select -s /Applications/Xcode_14.1.app
22+
- name: Select Xcode 14.3
23+
run: sudo xcode-select -s /Applications/Xcode_14.3.app
2424

2525
- name: Checkout Package
26-
uses: actions/checkout@v2
26+
uses: actions/checkout@v3
2727
with:
2828
fetch-depth: 0
2929

3030
- name: Checkout gh-pages Branch
31-
uses: actions/checkout@v2
31+
uses: actions/checkout@v3
3232
with:
3333
ref: gh-pages
3434
path: docs-out

.github/workflows/format.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ concurrency:
1212
jobs:
1313
swift_format:
1414
name: swift-format
15-
runs-on: macos-12
15+
runs-on: macos-13
1616
steps:
1717
- uses: actions/checkout@v2
18-
- name: Xcode Select
19-
run: sudo xcode-select -s /Applications/Xcode_14.0.1.app
20-
- name: Tap
21-
run: brew tap pointfreeco/formulae
22-
- name: Install
23-
run: brew install Formulae/[email protected]
18+
- name: Select Xcode 14.3
19+
run: sudo xcode-select -s /Applications/Xcode_14.3.app
20+
- name: Install swift-format
21+
run: brew install swift-format
2422
- name: Format
2523
run: make format
2624
- uses: stefanzweifel/git-auto-commit-action@v4

ComposableArchitecture.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
PLATFORM_IOS = iOS Simulator,name=iPhone 11 Pro Max
1+
CONFIG = debug
2+
PLATFORM_IOS = iOS Simulator,id=$(call udid_for,iPhone)
23
PLATFORM_MACOS = macOS
34
PLATFORM_MAC_CATALYST = macOS,variant=Mac Catalyst
4-
PLATFORM_TVOS = tvOS Simulator,name=Apple TV
5-
PLATFORM_WATCHOS = watchOS Simulator,name=Apple Watch Series 7 (45mm)
5+
PLATFORM_TVOS = tvOS Simulator,id=$(call udid_for,TV)
6+
PLATFORM_WATCHOS = watchOS Simulator,id=$(call udid_for,Watch)
67

78
default: test-all
89

@@ -58,3 +59,7 @@ format:
5859
./Examples ./Package.swift ./Sources ./Tests
5960

6061
.PHONY: format test-all test-swift test-workspace
62+
63+
define udid_for
64+
$(shell xcrun simctl list --json devices available $(1) | jq -r '.devices | to_entries | map(select(.value | add)) | sort_by(.key) | last.value | last.udid')
65+
endef

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ let package = Package(
1919
dependencies: [
2020
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
2121
.package(url: "https://github.com/google/swift-benchmark", from: "0.1.0"),
22-
.package(url: "https://github.com/pointfreeco/combine-schedulers", from: "0.8.0"),
22+
.package(url: "https://github.com/pointfreeco/combine-schedulers", from: "0.9.2"),
2323
.package(url: "https://github.com/pointfreeco/swift-case-paths", from: "0.14.0"),
2424
.package(url: "https://github.com/apple/swift-collections", from: "1.0.2"),
2525
.package(url: "https://github.com/pointfreeco/swift-custom-dump", from: "0.10.0"),
@@ -60,13 +60,14 @@ let package = Package(
6060
]
6161
)
6262

63-
//for target in package.targets {
63+
//for target in package.targets where target.type != .system {
6464
// target.swiftSettings = target.swiftSettings ?? []
6565
// target.swiftSettings?.append(
6666
// .unsafeFlags([
67+
// "-c", "release",
68+
// "-emit-module-interface", "-enable-library-evolution",
6769
// "-Xfrontend", "-warn-concurrency",
6870
// "-Xfrontend", "-enable-actor-data-race-checks",
69-
// "-enable-library-evolution",
7071
// ])
7172
// )
7273
//}

Sources/ComposableArchitecture/ReducerProtocol.swift

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,29 @@
169169
associatedtype Action
170170

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

175-
/// A type representing the body of this reducer.
176-
///
177-
/// When you create a custom reducer by implementing the ``body-swift.property-7foai``, Swift
178-
/// infers this type from the value returned.
179-
///
180-
/// If you create a custom reducer by implementing the ``reduce(into:action:)-8yinq``, Swift
181-
/// infers this type to be `Never`.
182-
typealias Body = _Body
177+
/// A type representing the body of this reducer.
178+
///
179+
/// When you create a custom reducer by implementing the ``body-swift.property-7foai``, Swift
180+
/// infers this type from the value returned.
181+
///
182+
/// If you create a custom reducer by implementing the ``reduce(into:action:)-8yinq``, Swift
183+
/// infers this type to be `Never`.
184+
typealias Body = _Body
185+
#else
186+
/// A type representing the body of this reducer.
187+
///
188+
/// When you create a custom reducer by implementing the ``body-swift.property-7foai``, Swift
189+
/// infers this type from the value returned.
190+
///
191+
/// If you create a custom reducer by implementing the ``reduce(into:action:)-8yinq``, Swift
192+
/// infers this type to be `Never`.
193+
associatedtype Body
194+
#endif
183195

184196
/// Evolves the current state of the reducer to the next state.
185197
///

0 commit comments

Comments
 (0)