@@ -92,11 +92,140 @@ jobs:
9292 if : failure()
9393 run : ./scripts/ci-diagnostics.sh
9494
95+ distribution-tests :
96+ name : Distribution Tests
97+ runs-on : macos-15
98+ needs : files-changed
99+ steps :
100+ - uses : actions/checkout@v5
101+ - name : Prepare Package.swift
102+ uses : ./.github/actions/prepare-package.swift
103+ with :
104+ is-pr : ${{ github.event_name == 'pull_request' }}
105+ change-path : false
106+ remove-duplicate : true
107+ - run : rm -r Sentry.xcodeproj && rm -r Sentry.xcworkspace
108+ - run : set -o pipefail && NSUnbufferedIO=YES SKIP_BINARIES=1 xcodebuild test -scheme Sentry-Package -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=18.4,name=iPhone 16 Pro' | tee raw-test-output-distribution.log | xcbeautify --preserve-unbeautified
109+ shell : sh
110+ - name : Upload Distribution Test Logs
111+ uses : actions/upload-artifact@v4
112+ if : ${{ failure() || cancelled() }}
113+ with :
114+ name : raw-test-output-distribution
115+ path : |
116+ raw-test-output-distribution.log
117+
118+ # This matrix runs only the unit tests requiring the test server.
119+ # We do this to speed up the other unit test jobs and to avoid running the
120+ # test server with potential side effects in GH actions for all unit tests.
121+ # We don't run this matrix for all different OS versions, because the chances
122+ # of a bug solely on a specific OS version is minimal.
123+ unit-tests-with-test-server :
124+ name : Unit with Test Server ${{matrix.name}}
125+ runs-on : ${{matrix.runs-on}}
126+ timeout-minutes : 20
127+ needs : build-test-server
128+
129+ strategy :
130+ fail-fast : false
131+ matrix :
132+ include :
133+ - name : iOS 18
134+ runs-on : macos-15
135+ platform : " iOS"
136+ xcode : " 16.4"
137+ device : " iPhone 16 Pro"
138+ test-destination-os : " 18.5"
139+
140+ - name : macOS 15
141+ runs-on : macos-15
142+ platform : " macOS"
143+ xcode : " 16.4"
144+ test-destination-os : " 15.0"
145+
146+ steps :
147+ - uses : actions/checkout@v5
148+ - uses : actions/download-artifact@v5
149+ with :
150+ name : test-server
151+
152+ - name : Start Test Server
153+ run : ./scripts/start-test-server.sh
154+ - run : ./scripts/ci-select-xcode.sh ${{matrix.xcode}}
155+
156+ # Note: We don't install Slather or gather code coverage for this job because it only runs
157+ # the SentryTestServerTests target, which contains minimal tests that don't significantly
158+ # contribute to overall code coverage metrics. The main unit-tests job handles comprehensive
159+ # code coverage reporting.
160+
161+ # We split building and running tests in two steps so we know how long running the tests takes.
162+ - name : Build tests
163+ id : build_tests
164+ run : |
165+ ./scripts/sentry-xcodebuild.sh \
166+ --platform ${{matrix.platform}} \
167+ --os ${{matrix.test-destination-os}} \
168+ --ref ${{ github.ref_name }} \
169+ --command build-for-testing \
170+ --device "${{matrix.device}}" \
171+ --configuration TestCI \
172+ --scheme Sentry \
173+ --test-plan Sentry_TestServer
174+
175+ - name : Run tests
176+ run : |
177+ ./scripts/sentry-xcodebuild.sh \
178+ --platform ${{matrix.platform}} \
179+ --os ${{matrix.test-destination-os}} \
180+ --ref ${{ github.ref_name }} \
181+ --command test-without-building \
182+ --device "${{matrix.device}}" \
183+ --configuration TestCI \
184+ --scheme Sentry \
185+ --test-plan Sentry_TestServer
186+
187+ - name : Archiving DerivedData Logs
188+ uses : actions/upload-artifact@v4
189+ if : steps.build_tests.outcome == 'failure'
190+ with :
191+ name : derived-data-test-server-${{matrix.platform}}-xcode-${{matrix.xcode}}
192+ path : |
193+ /Users/runner/Library/Developer/Xcode/DerivedData/**/Logs/**
194+
195+ - name : Archiving Raw Logs
196+ uses : actions/upload-artifact@v4
197+ if : ${{ failure() || cancelled() }}
198+ with :
199+ name : raw-output-test-server-${{matrix.platform}}-xcode-${{matrix.xcode}}
200+ path : |
201+ raw-build-output.log
202+ raw-build-for-testing-output.log
203+ raw-test-output.log
204+
205+ - name : Archiving Crash Logs
206+ uses : actions/upload-artifact@v4
207+ if : ${{ failure() || cancelled() }}
208+ with :
209+ name : crash-logs-test-server-${{matrix.platform}}-xcode-${{matrix.xcode}}
210+ path : |
211+ ~/Library/Logs/DiagnosticReports/**
212+
213+ - name : Run CI Diagnostics
214+ if : ${{ failure() || cancelled() }}
215+ run : ./scripts/ci-diagnostics.sh
216+
217+ - name : Store screenshot
218+ uses : ./.github/actions/capture-screenshot
219+ if : ${{ failure() || cancelled() }}
220+ with :
221+ suffix : ${{ matrix.platform }}-xcode-${{ matrix.xcode }}
222+
95223 unit-tests :
96224 name : Unit ${{matrix.name}}
97225 runs-on : ${{matrix.runs-on}}
98226 timeout-minutes : 20
99- needs : build-test-server
227+ needs : files-changed
228+ if : needs.files-changed.outputs.run_unit_tests_for_prs == 'true'
100229
101230 strategy :
102231 fail-fast : false
@@ -132,6 +261,15 @@ jobs:
132261 device : " iPhone 16 Pro"
133262 scheme : " Sentry"
134263
264+ # iOS 26 with Xcode 26
265+ - name : iOS 26 Sentry
266+ runs-on : macos-26
267+ platform : " iOS"
268+ xcode : " 26.0"
269+ test-destination-os : " 26.0"
270+ device : " iPhone 17 Pro"
271+ scheme : " Sentry"
272+
135273 # We don't run the unit tests on macOS 13 cause we run them on all on GH actions available iOS versions.
136274 # The chance of missing a bug solely on tvOS 16 that doesn't occur on iOS, macOS 12 or macOS 14 is minimal.
137275 # We are running tests on macOS 14 and later, as there were OS-internal changes introduced in succeeding versions.
@@ -152,6 +290,14 @@ jobs:
152290 test-destination-os : " latest"
153291 scheme : " Sentry"
154292
293+ # macOS 26
294+ - name : macOS 26 Sentry
295+ runs-on : macos-26
296+ platform : " macOS"
297+ xcode : " 26.0"
298+ test-destination-os : " 26.0"
299+ scheme : " Sentry"
300+
155301 # Catalyst. We test the latest version, as the risk something breaking on Catalyst and not
156302 # on an older iOS or macOS version is low.
157303 # In addition we are running tests on macOS 14, as there were OS-internal changes introduced in succeeding versions.
@@ -169,6 +315,8 @@ jobs:
169315 test-destination-os : " latest"
170316 scheme : " Sentry"
171317
318+ # # We don't run unit tests on macCatalyst 26 yet because of https://github.com/getsentry/sentry-cocoa/issues/6165.
319+
172320 # We don't run the unit tests on tvOS 16 cause we run them on all on GH actions available iOS versions.
173321 # The chance of missing a bug solely on tvOS 16 that doesn't occur on iOS, tvOS 15 or tvOS 16 is minimal.
174322 # We are running tests on tvOS 17 and latest, as there were OS-internal changes introduced in succeeding versions.
@@ -198,15 +346,17 @@ jobs:
198346 test-destination-os : " 18.4"
199347 scheme : " Sentry"
200348
349+ # tvOS 26
350+ - name : tvOS 26 Sentry
351+ runs-on : macos-26
352+ platform : " tvOS"
353+ xcode : " 26.0"
354+ test-destination-os : " 26.0"
355+ device : " Apple TV"
356+ scheme : " Sentry"
357+
201358 steps :
202359 - uses : actions/checkout@v5
203- - uses : actions/download-artifact@v5
204- with :
205- name : test-server
206-
207- - name : Start Test Server
208- run : ./scripts/start-test-server.sh
209-
210360 - run : ./scripts/ci-select-xcode.sh ${{matrix.xcode}}
211361
212362 - name : Install Slather
@@ -326,7 +476,9 @@ jobs:
326476 [
327477 files-changed,
328478 build-test-server,
479+ distribution-tests,
329480 unit-tests,
481+ unit-tests-with-test-server,
330482 ]
331483 name : Unit Tests
332484 # This is necessary since a failed/skipped dependent job would cause this job to be skipped
0 commit comments