Skip to content

Commit 07abf89

Browse files
committed
Merge branch 'main' of github.com:getsentry/sentry-cocoa into itay/cocoa-533-convert-sentryreachability-to-swift
2 parents c535c23 + 705b962 commit 07abf89

File tree

401 files changed

+7079
-67780
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

401 files changed

+7079
-67780
lines changed

.github/actions/prepare-package.swift/action.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,19 @@ inputs:
55
description: "Whether the build is a PR"
66
required: true
77
default: "false"
8+
remove-duplicate:
9+
description: "Whether to remove targets that produce duplicate files. These targets cause SPM validation errors."
10+
default: "false"
11+
change-path:
12+
description: "Whether to change the path of the framework"
13+
default: "true"
814
package-file:
915
description: "The package file to prepare"
1016
required: true
1117
default: "Package.swift"
1218
runs:
1319
using: "composite"
1420
steps:
15-
- name: Remove newer package files
16-
# Remove newer package files when processing Package.swift to prevent interference
17-
if: ${{ inputs.package-file == 'Package.swift' }}
18-
shell: bash
19-
run: rm -rf Package@swift*
2021
- name: Remove Sentry-Dynamic-WithARM64e target
2122
# We don't build it on PRs, so we need to remove it from the package.swift file.
2223
if: ${{ inputs.is-pr == 'true' }}
@@ -25,8 +26,19 @@ runs:
2526
PACKAGE_FILE: ${{ inputs.package-file }}
2627
run: |
2728
sed -i '' '/Sentry-Dynamic-WithARM64e/d' $PACKAGE_FILE
28-
sed -i '' '/^[[:space:]]*\.binaryTarget($/{N;/\n[[:space:]]*),$/d;}' $PACKAGE_FILE
29+
sed -i '' '/Sentry-WithoutUIKitOrAppKit-WithARM64e/d' $PACKAGE_FILE
30+
sed -i '' '/^[[:space:]]*\.binaryTarget($/{N;/\n[[:space:]]*),\{0,1\}$/d;}' $PACKAGE_FILE
31+
- name: Remove duplicate target
32+
if: ${{ inputs.remove-duplicate == 'true' }}
33+
shell: bash
34+
env:
35+
PACKAGE_FILE: ${{ inputs.package-file }}
36+
run: |
37+
sed -i '' '/Sentry-Dynamic/d' $PACKAGE_FILE
38+
sed -i '' '/Sentry-WithoutUIKitOrAppKit/d' $PACKAGE_FILE
39+
sed -i '' '/^[[:space:]]*\.binaryTarget($/{N;/\n[[:space:]]*),\{0,1\}$/d;}' $PACKAGE_FILE
2940
- name: Change path of the framework
41+
if: ${{ inputs.change-path == 'true' }}
3042
shell: bash
3143
env:
3244
PACKAGE_FILE: ${{ inputs.package-file }}
@@ -35,3 +47,5 @@ runs:
3547
sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' $PACKAGE_FILE
3648
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic-WithARM64e/path: "Sentry-Dynamic-WithARM64e.xcframework.zip"/g' $PACKAGE_FILE
3749
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' $PACKAGE_FILE
50+
sed -i '' 's/checksum: ".*" \/\/Sentry-WithoutUIKitOrAppKit-WithARM64e/path: "Sentry-WithoutUIKitOrAppKit-WithARM64e.xcframework.zip"/g' $PACKAGE_FILE
51+
sed -i '' 's/checksum: ".*" \/\/Sentry-WithoutUIKitOrAppKit/path: "Sentry-WithoutUIKitOrAppKit.xcframework.zip"/g' $PACKAGE_FILE

.github/last-release-runid

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
17594240990
1+
18033198122

.github/workflows/api-stability.yml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,33 +38,24 @@ jobs:
3838
if: needs.files-changed.outputs.run_api_stability_for_prs == 'true'
3939
needs: files-changed
4040
runs-on: macos-15
41-
strategy:
42-
matrix:
43-
version: [default, v9]
4441
steps:
4542
- name: Checkout code
4643
uses: actions/checkout@v5
4744
with:
4845
fetch-depth: 0
49-
- run: ./scripts/ci-select-xcode.sh 16.4
5046

5147
- name: Generate HEAD SDK
5248
run: |
53-
if [ "${{ matrix.version }}" = "v9" ]; then
54-
mv sdk_api_v9.json sdk_api_base.json
55-
make generate-public-api CONFIG=V9
56-
mv sdk_api_v9.json sdk_api.json
57-
else
58-
mv sdk_api.json sdk_api_base.json
59-
make generate-public-api
60-
fi
49+
mv sdk_api_V9.json sdk_api_base.json
50+
./scripts/update-api.sh V9
51+
mv sdk_api_V9.json sdk_api.json
6152
6253
- name: Diagnose breaking changes
6354
run: |
6455
if diff -q "sdk_api_base.json" "sdk_api.json" > /dev/null; then
65-
echo "No API changes detected for ${{ matrix.version }} version."
56+
echo "No API changes detected."
6657
else
67-
echo "❌ Public API changes are detected for ${{ matrix.version }} version. If they're intended run "make generate-public-api" and commit the changes."
58+
echo "❌ Public API changes are detected. If they're intended run "make generate-public-api" and commit the changes."
6859
diff "sdk_api_base.json" "sdk_api.json" || true
6960
xcrun --sdk iphoneos swift-api-digester \
7061
-diagnose-sdk \

.github/workflows/build.yml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ jobs:
9898
config: DebugV9
9999
- scheme: iOS-ObjectiveC
100100
config: DebugV9
101+
- scheme: DistributionSample
102+
config: Debug
101103

102104
steps:
103105
- uses: actions/checkout@v5
@@ -108,13 +110,14 @@ jobs:
108110
# Note: Due to complexity in implementing the CODE_SIGNING_ALLOWED flag in the sentry-xcodebuild.sh script,
109111
# we did not yet migrate this step to use the script yet.
110112
- run: >-
111-
env NSUnbufferedIO=YES
112-
xcodebuild
113+
set -o pipefail && NSUnbufferedIO=YES xcodebuild
113114
-workspace Sentry.xcworkspace
114115
-scheme '${{matrix.scheme}}'
115-
-configuration ${{matrix.config}}
116+
-configuration '${{matrix.config}}'
116117
CODE_SIGNING_ALLOWED="NO"
117-
build
118+
build 2>&1
119+
| tee raw-build-output.log
120+
| xcbeautify --preserve-unbeautified
118121
119122
- name: Archiving Raw Build Logs
120123
uses: actions/upload-artifact@v4
@@ -128,6 +131,26 @@ jobs:
128131
if: ${{ failure() || cancelled() }}
129132
run: ./scripts/ci-diagnostics.sh
130133

134+
build-distribution:
135+
name: Build the distribution framework
136+
runs-on: macos-15
137+
needs: files-changed
138+
steps:
139+
- uses: actions/checkout@v5
140+
141+
- run: ./scripts/ci-select-xcode.sh 16.4
142+
shell: sh
143+
- run: rm -r Sentry.xcodeproj && rm -r Sentry.xcworkspace
144+
- run: set -o pipefail && NSUnbufferedIO=YES xcodebuild build -scheme SentryDistribution -sdk iphoneos -destination 'generic/platform=iphoneos' | tee raw-build-output-spm.log | xcbeautify
145+
shell: sh
146+
- name: Upload SPM Build Logs
147+
uses: actions/upload-artifact@v4
148+
if: ${{ failure() || cancelled() }}
149+
with:
150+
name: raw-build-output-spm
151+
path: |
152+
raw-build-output-spm.log
153+
131154
build-spm:
132155
name: Build with SPM
133156
runs-on: macos-15
@@ -339,6 +362,7 @@ jobs:
339362
files-changed,
340363
ios-swift-release,
341364
build-sample,
365+
build-distribution,
342366
build-spm,
343367
build-v9,
344368
check-debug-without-UIKit,

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_release_for_prs == 'true'
5252
needs: files-changed
5353
steps:
54-
- uses: actions/checkout@v4
54+
- uses: actions/checkout@v5
5555
- name: Setup matrix combinations
5656
id: setup-matrix-combinations
5757
run: |
@@ -300,7 +300,7 @@ jobs:
300300
steps:
301301
- name: Get auth token
302302
id: token
303-
uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1
303+
uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
304304
with:
305305
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
306306
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}

.github/workflows/test.yml

Lines changed: 160 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)