Skip to content

Commit 06dcc17

Browse files
committed
Update CI to use swift-package-action@2.0
1 parent 43f9c45 commit 06dcc17

File tree

1 file changed

+75
-62
lines changed

1 file changed

+75
-62
lines changed

.github/workflows/ci.yml

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

1616
jobs:
17+
xcodebuild-latest:
18+
name: xcodebuild (16)
19+
runs-on: macos-15
20+
strategy:
21+
matrix:
22+
command: [test, '']
23+
platform: [iOS, macOS]
24+
xcode: ['16.2']
25+
steps:
26+
- uses: actions/checkout@v4
27+
- name: Debug
28+
uses: capturecontext/swift-package-action@2.0
29+
with:
30+
xcode: ${{ matrix.xcode }}
31+
cache-derived-data: true
32+
command: xcodebuild
33+
subcommand: ${{ matrix.command }}
34+
platform: ${{ matrix.platform }}
35+
workspace: '.github/package.xcworkspace'
36+
scheme: ComposableArchitecture
37+
config: Debug
38+
1739
xcodebuild:
18-
name: xcodebuild
40+
name: xcodebuild (15)
1941
runs-on: macos-14
2042
strategy:
2143
matrix:
2244
command: [test, '']
23-
platform: [iOS, macOS, tvOS, watchOS, visionOS, macCatalyst]
24-
xcode: [15.2, 15.4, '16.0']
45+
platform: [iOS, macOS, macCatalyst, tvOS, visionOS, watchOS]
46+
xcode: [15.2, 15.4]
2547
exclude:
2648
- {xcode: 15.2, command: test}
2749
- {xcode: 15.4, command: ''}
28-
- {xcode: 15.2, platform: macCatalyst}
29-
- {xcode: 15.2, platform: tvOS}
30-
- {xcode: 15.2, platform: visionOS}
31-
- {xcode: 15.2, platform: watchOS}
32-
- {xcode: '16.0', command: ''}
33-
- {xcode: '16.0', platform: macCatalyst}
34-
- {xcode: '16.0', platform: tvOS}
35-
- {xcode: '16.0', platform: visionOS}
36-
- {xcode: '16.0', platform: watchOS}
50+
- {xcode: 15.2, platform: MAC_CATALYST}
51+
- {xcode: 15.2, platform: TVOS}
52+
- {xcode: 15.2, platform: VISIONOS}
53+
- {xcode: 15.2, platform: WATCHOS}
3754
include:
3855
- {xcode: 15.2, skip_release: 1}
3956
steps:
4057
- uses: actions/checkout@v4
41-
- name: Select Xcode ${{ matrix.xcode }}
42-
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
43-
- name: Cache derived data
44-
uses: actions/cache@v3
45-
with:
46-
path: |
47-
~/.derivedData
48-
key: |
49-
deriveddata-xcodebuild-${{ matrix.platform }}-${{ matrix.xcode }}-${{ matrix.command }}-${{ hashFiles('**/Sources/**/*.swift', '**/Tests/**/*.swift') }}
50-
restore-keys: |
51-
deriveddata-xcodebuild-${{ matrix.platform }}-${{ matrix.xcode }}-${{ matrix.command }}-
52-
- name: Set IgnoreFileSystemDeviceInodeChanges flag
53-
run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES
54-
- name: Update mtime for incremental builds
55-
uses: chetan/git-restore-mtime-action@v2
5658
- name: Debug
57-
uses: capturecontext/swift-package-action@1.0
59+
uses: capturecontext/swift-package-action@2.0
5860
with:
61+
xcode: ${{ matrix.xcode }}
62+
cache-derived-data: true
5963
command: xcodebuild
6064
subcommand: ${{ matrix.command }}
6165
platform: ${{ matrix.platform }}
66+
workspace: '.github/package.xcworkspace'
6267
scheme: ComposableArchitecture
6368
config: Debug
6469
- name: Release
6570
if: matrix.skip_release != '1'
66-
uses: capturecontext/swift-package-action@1.0
71+
uses: capturecontext/swift-package-action@2.0
6772
with:
73+
xcode: ${{ matrix.xcode }}
74+
cache-derived-data: true
6875
command: xcodebuild
6976
subcommand: ${{ matrix.command }}
7077
platform: ${{ matrix.platform }}
78+
workspace: '.github/package.xcworkspace'
7179
scheme: ComposableArchitecture
7280
config: Release
7381

@@ -76,11 +84,10 @@ jobs:
7684
runs-on: macos-14
7785
steps:
7886
- uses: actions/checkout@v4
79-
- name: Select Xcode 15.4
80-
run: sudo xcode-select -s /Applications/Xcode_15.4.app
8187
- name: Build for library evolution
82-
uses: capturecontext/swift-package-action@1.0
88+
uses: capturecontext/swift-package-action@2.0
8389
with:
90+
xcode: 15.4
8491
command: build-for-library-evolution
8592
scheme: ComposableArchitecture
8693

@@ -89,65 +96,71 @@ jobs:
8996
runs-on: macos-14
9097
steps:
9198
- uses: actions/checkout@v4
92-
- name: Cache derived data
93-
uses: actions/cache@v3
94-
with:
95-
path: ~/.derivedData
96-
key: |
97-
deriveddata-examples-${{ hashFiles('**/Sources/**/*.swift', '**/Tests/**/*.swift', '**/Examples/**/*.swift') }}
98-
restore-keys: |
99-
deriveddata-examples-
100-
- name: Select Xcode 16
101-
run: sudo xcode-select -s /Applications/Xcode_16.0.app
102-
- name: Set IgnoreFileSystemDeviceInodeChanges flag
103-
run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES
104-
- name: Update mtime for incremental builds
105-
uses: chetan/git-restore-mtime-action@v2
10699
- name: CaseStudies (SwiftUI)
107-
uses: capturecontext/swift-package-action@1.0
100+
uses: capturecontext/swift-package-action@2.0
108101
with:
109-
command: test-example
102+
command: xcodebuild-raw
103+
cache-derived-data: true
110104
scheme: CaseStudies (SwiftUI)
111105
platform: iOS
112106
- name: CaseStudies (UIKit)
113-
uses: capturecontext/swift-package-action@1.0
107+
uses: capturecontext/swift-package-action@2.0
114108
with:
115-
command: test-example
109+
command: xcodebuild-raw
110+
cache-derived-data: true
116111
scheme: CaseStudies (UIKit)
117112
platform: iOS
118113
- name: Search
119-
uses: capturecontext/swift-package-action@1.0
114+
uses: capturecontext/swift-package-action@2.0
120115
with:
121-
command: test-example
116+
command: xcodebuild-raw
117+
cache-derived-data: true
122118
scheme: Search
123119
platform: iOS
124120
- name: SyncUps
125-
uses: capturecontext/swift-package-action@1.0
121+
uses: capturecontext/swift-package-action@2.0
126122
with:
127-
command: test-example
123+
command: xcodebuild-raw
124+
cache-derived-data: true
128125
scheme: SyncUps
129126
platform: iOS
130127
- name: SpeechRecognition
131-
uses: capturecontext/swift-package-action@1.0
128+
uses: capturecontext/swift-package-action@2.0
132129
with:
133-
command: test-example
130+
command: xcodebuild-raw
131+
cache-derived-data: true
134132
scheme: SpeechRecognition
135133
platform: iOS
136134
- name: TicTacToe
137-
uses: capturecontext/swift-package-action@1.0
135+
uses: capturecontext/swift-package-action@2.0
138136
with:
139-
command: test-example
137+
command: xcodebuild-raw
138+
cache-derived-data: true
140139
scheme: TicTacToe
141140
platform: iOS
142141
- name: Todos
143-
uses: capturecontext/swift-package-action@1.0
142+
uses: capturecontext/swift-package-action@2.0
144143
with:
145-
command: test-example
144+
command: xcodebuild-raw
145+
cache-derived-data: true
146146
scheme: Todos
147147
platform: iOS
148148
- name: VoiceMemos
149-
uses: capturecontext/swift-package-action@1.0
149+
uses: capturecontext/swift-package-action@2.0
150150
with:
151-
command: test-example
151+
command: xcodebuild-raw
152+
cache-derived-data: true
152153
scheme: VoiceMemos
153154
platform: iOS
155+
156+
check-macro-compatibility:
157+
name: Check Macro Compatibility
158+
runs-on: macos-latest
159+
steps:
160+
- name: Checkout repository
161+
uses: actions/checkout@v4
162+
- name: Run Swift Macro Compatibility Check
163+
uses: Matejkob/swift-macro-compatibility-check@v1
164+
with:
165+
run-tests: false
166+
major-versions-only: true

0 commit comments

Comments
 (0)