8
8
pull_request :
9
9
paths :
10
10
- ' .swiftlint.yml'
11
- branches :
12
- - main
13
- - dev
14
-
15
- concurrency :
16
- group : ci
17
- cancel-in-progress : true
11
+ - " .github/workflows/**"
12
+ - " Package.swift"
13
+ - " Source/**"
14
+ - " Tests/**"
18
15
19
16
jobs :
20
17
SwiftLint :
@@ -27,39 +24,216 @@ jobs:
27
24
args : --strict
28
25
env :
29
26
DIFF_BASE : ${{ github.base_ref }}
30
- Latest :
31
- name : Test Latest (iOS, macOS, tvOS, watchOS)
32
- runs-on : macOS-12
27
+ macOS :
28
+ name : ${{ matrix.name }}
29
+ runs-on : ${{ matrix.runsOn }}
30
+ env :
31
+ DEVELOPER_DIR : " /Applications/${{ matrix.xcode }}.app/Contents/Developer"
32
+ timeout-minutes : 20
33
+ strategy :
34
+ fail-fast : false
35
+ matrix :
36
+ include :
37
+ - xcode : " Xcode_15.0"
38
+ runsOn : macos-13
39
+ name : " macOS 13, Xcode 15.0, Swift 5.9.0"
40
+ - xcode : " Xcode_14.3.1"
41
+ runsOn : macos-13
42
+ name : " macOS 13, Xcode 14.3.1, Swift 5.8.0"
43
+ - xcode : " Xcode_14.2"
44
+ runsOn : macOS-12
45
+ name : " macOS 12, Xcode 14.2, Swift 5.7.2"
46
+ - xcode : " Xcode_14.1"
47
+ runsOn : macOS-12
48
+ name : " macOS 12, Xcode 14.1, Swift 5.7.1"
49
+ steps :
50
+ - uses : actions/checkout@v3
51
+ - name : ${{ matrix.name }}
52
+ run : xcodebuild test -scheme "Flare" -destination "platform=macOS" clean -enableCodeCoverage YES -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1
53
+ - name : Upload coverage reports to Codecov
54
+ uses : codecov/codecov-action@v3.1.0
55
+ with :
56
+ token : ${{ secrets.CODECOV_TOKEN }}
57
+ xcode : true
58
+ xcode_archive_path : test_output/${{ matrix.name }}.xcresult
59
+ - uses : actions/upload-artifact@v4
60
+ with :
61
+ name : ${{ matrix.name }}
62
+ path : test_output
63
+
64
+ iOS :
65
+ name : ${{ matrix.name }}
66
+ runs-on : ${{ matrix.runsOn }}
67
+ env :
68
+ DEVELOPER_DIR : " /Applications/${{ matrix.xcode }}.app/Contents/Developer"
69
+ timeout-minutes : 20
70
+ strategy :
71
+ fail-fast : false
72
+ matrix :
73
+ include :
74
+ - destination : " OS=17.0.1,name=iPhone 14 Pro"
75
+ name : " iOS 17.0.1"
76
+ xcode : " Xcode_15.0"
77
+ runsOn : macos-13
78
+ - destination : " OS=16.4,name=iPhone 14 Pro"
79
+ name : " iOS 16.4"
80
+ xcode : " Xcode_14.3.1"
81
+ runsOn : macos-13
82
+ steps :
83
+ - uses : actions/checkout@v3
84
+ - name : Install Dependencies
85
+ run : make setup_build_tools
86
+ - name : Generate project
87
+ run : make generate
88
+ - name : ${{ matrix.name }}
89
+ run : xcodebuild test -scheme "Flare" -destination "${{ matrix.destination }}" -testPlan AllTests clean -enableCodeCoverage YES -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1
90
+ - uses : actions/upload-artifact@v4
91
+ with :
92
+ name : ${{ matrix.name }}
93
+ path : test_output
94
+
95
+ tvOS :
96
+ name : ${{ matrix.name }}
97
+ runs-on : ${{ matrix.runsOn }}
98
+ env :
99
+ DEVELOPER_DIR : " /Applications/${{ matrix.xcode }}.app/Contents/Developer"
100
+ timeout-minutes : 20
101
+ strategy :
102
+ fail-fast : false
103
+ matrix :
104
+ include :
105
+ - destination : " OS=17.0,name=Apple TV"
106
+ name : " tvOS 17.0"
107
+ xcode : " Xcode_15.0"
108
+ runsOn : macos-13
109
+ - destination : " OS=16.4,name=Apple TV"
110
+ name : " tvOS 16.4"
111
+ xcode : " Xcode_14.3.1"
112
+ runsOn : macos-13
113
+ steps :
114
+ - uses : actions/checkout@v3
115
+ - name : Install Dependencies
116
+ run : make setup_build_tools
117
+ - name : Generate project
118
+ run : make generate
119
+ - name : ${{ matrix.name }}
120
+ run : xcodebuild test -scheme "Flare" -destination "${{ matrix.destination }}" -testPlan AllTests clean -enableCodeCoverage YES -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1
121
+ - name : Upload coverage reports to Codecov
122
+ uses : codecov/codecov-action@v3.1.0
123
+ with :
124
+ token : ${{ secrets.CODECOV_TOKEN }}
125
+ xcode : true
126
+ xcode_archive_path : test_output/${{ matrix.name }}.xcresult
127
+ - uses : actions/upload-artifact@v4
128
+ with :
129
+ name : ${{ matrix.name }}
130
+ path : test_output
131
+
132
+ watchOS :
133
+ name : ${{ matrix.name }}
134
+ runs-on : ${{ matrix.runsOn }}
33
135
env :
34
- DEVELOPER_DIR : " /Applications/Xcode_14.1 .app/Contents/Developer"
35
- timeout-minutes : 10
136
+ DEVELOPER_DIR : " /Applications/${{ matrix.xcode }} .app/Contents/Developer"
137
+ timeout-minutes : 20
36
138
strategy :
37
139
fail-fast : false
38
140
matrix :
39
141
include :
40
- - destination : " OS=16.1,name=iPhone 14 Pro"
41
- name : " iOS"
42
- scheme : " Flare"
43
- sdk : iphonesimulator
44
- - destination : " OS=16.1,name=Apple TV"
45
- name : " tvOS"
46
- scheme : " Flare"
47
- sdk : appletvsimulator
48
- - destination : " OS=9.1,name=Apple Watch Series 8 (45mm)"
49
- name : " watchOS"
50
- scheme : " Flare"
51
- sdk : watchsimulator
52
- - destination : " platform=macOS"
53
- name : " macOS"
54
- scheme : " Flare"
55
- sdk : macosx
142
+ - destination : " OS=10.0,name=Apple Watch Series 9 (45mm)"
143
+ name : " watchOS 10.0"
144
+ xcode : " Xcode_15.0"
145
+ runsOn : macos-13
146
+ - destination : " OS=9.4,name=Apple Watch Series 8 (45mm)"
147
+ name : " watchOS 9.4"
148
+ xcode : " Xcode_14.3.1"
149
+ runsOn : macos-13
150
+ - destination : " OS=8.5,name=Apple Watch Series 7 (45mm)"
151
+ name : " watchOS 8.5"
152
+ xcode : " Xcode_14.3.1"
153
+ runsOn : macos-13
56
154
steps :
57
155
- uses : actions/checkout@v3
156
+ - name : Install Dependencies
157
+ run : make setup_build_tools
158
+ - name : Generate project
159
+ run : make generate
58
160
- name : ${{ matrix.name }}
59
- run : xcodebuild test -scheme "${{ matrix.scheme }} " -destination "${{ matrix.destination }}" clean -enableCodeCoverage YES -resultBundlePath ". /${{ matrix.sdk }}.xcresult" | xcpretty -r junit
161
+ run : xcodebuild test -scheme "Flare " -destination "${{ matrix.destination }}" -testPlan UnitTests clean -enableCodeCoverage YES -resultBundlePath "test_output /${{ matrix.name }}.xcresult" || exit 1
60
162
- name : Upload coverage reports to Codecov
61
163
uses : codecov/codecov-action@v3.1.0
62
164
with :
63
165
token : ${{ secrets.CODECOV_TOKEN }}
64
166
xcode : true
65
- xcode_archive_path : " ./${{ matrix.sdk }}.xcresult"
167
+ xcode_archive_path : test_output/${{ matrix.name }}.xcresult
168
+ - uses : actions/upload-artifact@v4
169
+ with :
170
+ name : ${{ matrix.name }}
171
+ path : test_output
172
+
173
+ spm :
174
+ name : ${{ matrix.name }}
175
+ runs-on : ${{ matrix.runsOn }}
176
+ env :
177
+ DEVELOPER_DIR : " /Applications/${{ matrix.xcode }}.app/Contents/Developer"
178
+ timeout-minutes : 20
179
+ strategy :
180
+ fail-fast : false
181
+ matrix :
182
+ include :
183
+ - name : " Xcode 15"
184
+ xcode : " Xcode_15.0"
185
+ runsOn : macos-13
186
+ - name : " Xcode 14"
187
+ xcode : " Xcode_14.3.1"
188
+ runsOn : macos-13
189
+ steps :
190
+ - uses : actions/checkout@v3
191
+ - name : ${{ matrix.name }}
192
+ run : swift build -c release --target Flare
193
+
194
+ merge-test-reports :
195
+ needs : [iOS, macOS, watchOS, tvOS]
196
+ runs-on : macos-13
197
+ steps :
198
+ - name : Download artifacts
199
+ uses : actions/download-artifact@v4
200
+ with :
201
+ path : test_output
202
+ - run : xcrun xcresulttool merge test_output/**/*.xcresult --output-path test_output/final/final.xcresult
203
+ - name : Upload Merged Artifact
204
+ uses : actions/upload-artifact@v4
205
+ with :
206
+ name : MergedResult
207
+ path : test_output/final
208
+
209
+ discover-typos :
210
+ name : Discover Typos
211
+ runs-on : macOS-12
212
+ env :
213
+ DEVELOPER_DIR : /Applications/Xcode_14.1.app/Contents/Developer
214
+ steps :
215
+ - uses : actions/checkout@v2
216
+ - name : Discover typos
217
+ run : |
218
+ export PATH="$PATH:/Library/Frameworks/Python.framework/Versions/3.11/bin"
219
+ python3 -m pip install --upgrade pip
220
+ python3 -m pip install codespell
221
+ codespell --ignore-words-list="hart,inout,msdos,sur" --skip="./.build/*,./.git/*"
222
+
223
+ # Beta:
224
+ # name: ${{ matrix.name }}
225
+ # runs-on: firebreak
226
+ # env:
227
+ # DEVELOPER_DIR: "/Applications/Xcode_15.0.app/Contents/Developer"
228
+ # timeout-minutes: 10
229
+ # strategy:
230
+ # fail-fast: false
231
+ # matrix:
232
+ # include:
233
+ # - destination: "OS=1.0,name=Apple Vision Pro"
234
+ # name: "visionOS 1.0"
235
+ # scheme: "Flare"
236
+ # steps:
237
+ # - uses: actions/checkout@v3
238
+ # - name: ${{ matrix.name }}
239
+ # run: xcodebuild test -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" clean || exit 1
0 commit comments