-
-
Notifications
You must be signed in to change notification settings - Fork 235
146 lines (133 loc) · 5.36 KB
/
device-tests-ios.yml
File metadata and controls
146 lines (133 loc) · 5.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: iOS Device Tests
on:
push:
branches:
- main
- release/*
pull_request:
paths:
# Core SDK (transitive dependency of all mobile packages)
- 'src/Sentry/**'
- 'src/Sentry.Extensions.Logging/**'
- 'src/Sentry.Compiler.Extensions/**'
# Mobile-specific packages
- 'src/Sentry.Maui/**'
- 'src/Sentry.Maui.CommunityToolkit.Mvvm/**'
- 'src/Sentry.Bindings.Android/**'
- 'src/Sentry.Bindings.Cocoa/**'
- 'src/Sentry.Android.AssemblyReader/**'
# Device test app and test projects that run on device
- 'test/Sentry.Maui.Device.TestApp/**'
- 'test/Sentry.Tests/**'
- 'test/Sentry.Extensions.Logging.Tests/**'
- 'test/Sentry.Maui.Tests/**'
- 'test/Sentry.Maui.CommunityToolkit.Mvvm.Tests/**'
- 'test/Sentry.Android.AssemblyReader.Tests/**'
- 'test/Sentry.Testing/**'
- 'test/AndroidTestApp/**'
# Integration tests
- 'integration-test/android.Tests.ps1'
- 'integration-test/ios.Tests.ps1'
- 'integration-test/net9-maui/**'
- 'integration-test/common.ps1'
- 'integration-test/Directory.Build.*'
# Native libraries and modules
- 'lib/sentrysupplemental/**'
- 'lib/sentry-android-supplemental/**'
- 'modules/sentry-native/**'
- 'modules/sentry-cocoa/**'
- 'modules/sentry-cocoa.properties'
# Build configuration (affects all builds)
- 'global.json'
- 'Directory.Build.props'
- 'Directory.Build.targets'
- 'nuget.config'
# Scripts and CI
- 'scripts/device-test.ps1'
- 'scripts/device-test-utils.ps1'
- '.github/workflows/device-tests-ios.yml'
- '.github/actions/**'
workflow_dispatch:
jobs:
ios-tests:
runs-on: macos-15
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
NO_ANDROID: true
NO_MACCATALYST: true
steps:
- name: Cancel Previous Runs
if: github.ref_name != 'main' && !startsWith(github.ref_name, 'release/')
uses: styfle/cancel-workflow-action@d07a454dad7609a92316b57b23c9ccfd4f59af66 # 0.13.1
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
- name: Setup Environment
uses: ./.github/actions/environment
- name: Disable host crash reporter
# Avoids crash dialog popups and ReportCrash CPU overhead during simulator tests
run: |
launchctl unload -w /System/Library/LaunchAgents/com.apple.ReportCrash.plist || true
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.ReportCrash.Root.plist || true
- name: Build iOS Test App
run: pwsh ./scripts/device-test.ps1 ios -Build
- name: Run Tests
id: first-test-run
continue-on-error: true
timeout-minutes: 40
run: pwsh scripts/device-test.ps1 ios -Run -Verbose
- name: Reset Simulator (before test retry)
if: steps.first-test-run.outcome == 'failure'
timeout-minutes: 5
run: |
if ! timeout 30 xcrun simctl list devices >/dev/null 2>&1; then
echo "CoreSimulatorService unresponsive, restarting..."
sudo launchctl kickstart -kp system/com.apple.CoreSimulator.CoreSimulatorService
for i in $(seq 1 30); do
timeout 5 xcrun simctl list devices >/dev/null 2>&1 && break
echo "Waiting for CoreSimulatorService... ($i)"
sleep 1
done
fi
timeout 30 xcrun simctl shutdown all 2>/dev/null || true
- name: Retry Tests (if previous failed to run)
if: steps.first-test-run.outcome == 'failure'
timeout-minutes: 40
run: pwsh scripts/device-test.ps1 ios -Run -Verbose
- name: Run Integration Tests
id: first-integration-test-run
continue-on-error: true
timeout-minutes: 40
uses: getsentry/github-workflows/sentry-cli/integration-test@26f565c05d0dd49f703d238706b775883037d76b # 3.3.0
with:
path: integration-test/ios.Tests.ps1
- name: Reset Simulator (before integration test retry)
if: steps.first-integration-test-run.outcome == 'failure'
timeout-minutes: 5
run: |
if ! timeout 30 xcrun simctl list devices >/dev/null 2>&1; then
echo "CoreSimulatorService unresponsive, restarting..."
sudo launchctl kickstart -kp system/com.apple.CoreSimulator.CoreSimulatorService
for i in $(seq 1 30); do
timeout 5 xcrun simctl list devices >/dev/null 2>&1 && break
echo "Waiting for CoreSimulatorService... ($i)"
sleep 1
done
fi
timeout 30 xcrun simctl shutdown all 2>/dev/null || true
- name: Retry Integration Tests (if previous failed to run)
if: steps.first-integration-test-run.outcome == 'failure'
timeout-minutes: 40
uses: getsentry/github-workflows/sentry-cli/integration-test@26f565c05d0dd49f703d238706b775883037d76b # 3.3.0
with:
path: integration-test/ios.Tests.ps1
- name: Upload results
if: success() || failure()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: device-test-ios-results
path: |
test_output
integration-test/mobile-app/test_output