forked from JetBrains/compose-multiplatform-core
-
Notifications
You must be signed in to change notification settings - Fork 0
282 lines (236 loc) · 8.76 KB
/
compose-tests.yml
File metadata and controls
282 lines (236 loc) · 8.76 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
name: Compose Tests
on:
workflow_dispatch:
pull_request:
push:
branches:
- jb-main
jobs:
compose-desktop-tests:
runs-on: ubuntu-24.04
name: Compose Desktop Tests
steps:
- name: Checkout Repository
uses: actions/checkout@v5
- name: Setup Prerequisites
uses: ./.github/actions/setup-prerequisites
- name: Start X Server
run: |
sudo Xvfb :1 -screen 0 1920x1080x24 -extension RANDR +extension GLX &
echo "DISPLAY=:1.0" >> $GITHUB_ENV
- name: Run Desktop Tests
run: |
./gradlew testDesktop \
--no-daemon --stacktrace
- name: Upload Screenshots
uses: actions/upload-artifact@v4
if: failure()
with:
name: screenshot-tests
path: |
golden/**/*_actual.png
golden/**/*_diff.png
- name: Test Summary
uses: test-summary/action@v2
with:
paths: "out/**/build/test-results/**/TEST-*.xml"
if: always()
compose-ios-tests:
runs-on: macos-15-xlarge
name: Compose iOS Tests
env:
GRADLE_OPTS: -Xmx12g -Dorg.gradle.daemon=false
steps:
- name: Checkout Repository
uses: actions/checkout@v5
- name: Setup Prerequisites
uses: ./.github/actions/setup-prerequisites
- name: Setup Xcode
uses: ./.github/actions/setup-xcode
- name: Run iOS Tests
timeout-minutes: 15
run: |
./gradlew testUIKit \
--no-daemon --stacktrace
- name: Test Summary
uses: test-summary/action@v2
with:
paths: "out/**/build/test-results/**/TEST-*.xml"
if: always()
compose-ios-utils-tests:
runs-on: macos-15-xlarge
name: Compose iOS Utils Tests
env:
GRADLE_OPTS: -Xmx12g -Dorg.gradle.daemon=false
steps:
- name: Checkout Repository
uses: actions/checkout@v5
- name: Setup Prerequisites
uses: ./.github/actions/setup-prerequisites
- name: Setup Xcode
uses: ./.github/actions/setup-xcode
- name: Run iOS Utils Tests
timeout-minutes: 15
shell: bash
working-directory: compose/ui/ui-uikit/src/uikitMain/objc/CMPUIKitUtils
run: |
xcodebuild test \
-resultBundlePath TestResults.xcresult \
-scheme CMPUIKitUtilsTests \
-project CMPUIKitUtils.xcodeproj \
-destination 'platform=iOS Simulator,name=iPhone 16'
- name: Upload Test Results
uses: actions/upload-artifact@v4
if: failure()
with:
name: TestResults-${{ github.run_number }}.xcresult
path: compose/ui/ui-uikit/src/uikitMain/objc/CMPUIKitUtils/TestResults.xcresult
compose-ios-instrumented-tests:
runs-on: macos-15-xlarge
strategy:
fail-fast: false
matrix:
device: [ 'iPhone 16', 'iPad Pro 11-inch (M4)' ]
name: Compose iOS Instrumented Tests ${{ matrix.device }}
env:
GRADLE_OPTS: -Xmx12g -Dorg.gradle.daemon=false
steps:
- name: Checkout Repository
uses: actions/checkout@v5
- name: Setup Prerequisites
uses: ./.github/actions/setup-prerequisites
- name: Setup Xcode
uses: ./.github/actions/setup-xcode
- name: Get iOS Simulator UDID
id: get-simulator-udid
shell: bash
run: |
DEVICE_NAME="${{ matrix.device }}"
DEVICE_VERSION="18.6"
DEVICE_DASH="${DEVICE_VERSION//./-}" # 16.0 -> 16-0
echo "Looking for device: '$DEVICE_NAME' ($DEVICE_VERSION)"
SIMULATOR_ID=$(xcrun simctl list devices available -j \
| jq -r --arg device "$DEVICE_NAME" --arg vdot "$DEVICE_VERSION" --arg vdash "$DEVICE_DASH" '
.devices
| to_entries[]
| select(.key | (contains($vdot) or contains($vdash)))
| .value[]
| select(.name == $device)
| .udid
' | head -n 1)
if [ -z "$SIMULATOR_ID" ]; then
echo "Simulator not found for $DEVICE_NAME ($DEVICE_VERSION)"
echo "Available runtimes and matching devices:"
xcrun simctl list devices available -j | jq -r '
.devices | to_entries[] | "\(.key):\n " + ( [.value[] | "\(.name) \(.udid) \(.state)"] | join("\n ") )
'
exit 1
fi
echo "Found simulator ID: $SIMULATOR_ID"
# make available to later steps
echo "simulator-id=$SIMULATOR_ID" >> "$GITHUB_OUTPUT"
- name: Configure Simulator
run: |
xcrun simctl boot "${{ steps.get-simulator-udid.outputs.simulator-id }}"
# Write the accessibility flags inside the Simulator:
xcrun simctl spawn booted defaults write com.apple.Accessibility AccessibilityEnabled -bool true
xcrun simctl spawn booted defaults write com.apple.Accessibility ApplicationAccessibilityEnabled -bool true
xcrun simctl spawn booted defaults write com.apple.Accessibility AutomationEnabled -bool true
# Restart SpringBoard (so system services pick up the change)
xcrun simctl spawn booted launchctl stop com.apple.SpringBoard
xcrun simctl shutdown all
- name: Run iOS Instrumented Tests
timeout-minutes: 30
shell: bash
working-directory: compose/ui/ui/src/uikitInstrumentedTest/launcher
run: |
xcodebuild test \
-scheme Launcher \
-project Launcher.xcodeproj \
-destination 'platform=iOS Simulator,id=${{ steps.get-simulator-udid.outputs.simulator-id }}'
- name: Test Summary
uses: test-summary/action@v2
with:
paths: "**/reports/junit.xml"
if: always()
compose-web-chrome-tests:
runs-on: ubuntu-24.04
name: Compose Web Chrome Tests
strategy:
fail-fast: false
matrix:
chrome: [ '118', 'stable' ]
task: [ 'Js', 'Wasm' ]
steps:
- name: Checkout Repository
uses: actions/checkout@v5
- name: Setup Prerequisites
uses: ./.github/actions/setup-prerequisites
# Compile tests as a separate step to reduce memory usage and potential OOM during running tests.
- name: Compile ${{ matrix.task }} Tests
run: |
./gradlew compileTestKotlin${{ matrix.task }} \
--no-daemon --stacktrace
- name: Setup Google Chrome
uses: browser-actions/setup-chrome@v2
with:
chrome-version: ${{ matrix.chrome }}
install-chromedriver: true
install-dependencies: true
- name: Start X Server
run: |
sudo Xvfb :1 -screen 0 1920x1080x24 -extension RANDR +extension GLX &
echo "DISPLAY=:1.0" >> $GITHUB_ENV
- name: Run Web Chrome Tests
run: |
./gradlew :mpp:testWeb${{ matrix.task }} \
--no-daemon --stacktrace --no-parallel \
-Pjetbrains.androidx.web.tests.enableFirefox=false \
-Pjetbrains.androidx.web.tests.enableChrome=true
- name: Test Summary
uses: test-summary/action@v2
with:
paths: "out/**/build/test-results/**/TEST-*.xml"
if: always()
compose-web-firefox-tests:
runs-on: ubuntu-24.04
name: Compose Web Firefox Tests
strategy:
fail-fast: false
matrix:
# FIXME: Even after installation of '119.0', tests still use latest one. Fix and restore.
firefox: [ 'latest' ]
task: [ 'Wasm' ] # excluded Js for Firefox due to high flakiness
steps:
- name: Checkout Repository
uses: actions/checkout@v5
- name: Setup Prerequisites
uses: ./.github/actions/setup-prerequisites
# Compile tests as a separate step to reduce memory usage and potential OOM during running tests.
- name: Compile ${{ matrix.task }} Tests
run: |
./gradlew compileTestKotlin${{ matrix.task }} \
--no-daemon --stacktrace
- name: Setup Missing Packages
run: |
sudo apt-get update -y
sudo apt-get install libdbus-glib-1-2 -y
- name: Setup Firefox
uses: browser-actions/setup-firefox@v1
with:
firefox-version: ${{ matrix.firefox }}
- name: Start X Server
run: |
sudo Xvfb :1 -screen 0 1920x1080x24 -extension RANDR +extension GLX &
echo "DISPLAY=:1.0" >> $GITHUB_ENV
- name: Run Web Firefox Tests
run: |
./gradlew :mpp:testWeb${{ matrix.task }} \
--no-daemon --stacktrace --no-parallel \
-Pjetbrains.androidx.web.tests.enableFirefox=true \
-Pjetbrains.androidx.web.tests.enableChrome=false
- name: Test Summary
uses: test-summary/action@v2
with:
paths: "out/**/build/test-results/**/TEST-*.xml"
if: always()