-
Notifications
You must be signed in to change notification settings - Fork 33
257 lines (214 loc) · 7.25 KB
/
corrected-e2d.yml
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
# name: E2E Tests
# on: [pull_request]
# jobs:
# find-test-files:
# name: Find Detox test files
# runs-on: macos-latest
# outputs:
# test-files: ${{ steps.set-test-files.outputs.test-files }}
# steps:
# - name: Checkout Code
# uses: actions/checkout@v4
# - name: Find test files
# id: set-test-files
# run: |
# TEST_FILES=$(find example/e2e -name '*.test.js' | sed 's|example/e2e/||g' | jq -R -s -c 'split("\n")[:-1]')
# echo "test-files=$TEST_FILES" >> $GITHUB_OUTPUT
# build-ios:
# name: iOS - Build app for Detox tests
# runs-on: macos-latest
# steps:
# - name: Checkout Code
# uses: actions/checkout@v4
# with:
# fetch-depth: 1
# - name: Setup
# uses: ./.github/actions/setup
# with:
# setup-config: ios
# - name: Setup Ruby (bundle)
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: 2.6.10
# bundler-cache: true
# - name: Install ios-deploy, detox, react-native-cli
# run: npm install -g ios-deploy detox-cli react-native-cli
# - name: Install Applesimutils
# run: |
# brew tap wix/brew
# brew install applesimutils
# - name: Example App Yarn install
# run: |
# cd example
# yarn install --frozen-lockfile
# cd ..
# - uses: actions/cache@v4
# id: cache
# with:
# path: |
# example/ios/Pods
# ~/Library/Caches/CocoaPods
# ~/.cocoapods
# key: ${{ runner.os }}-pods-${{ hashFiles('example/ios/Podfile.lock') }}
# restore-keys: |
# ${{ runner.os }}-pods-
# - name: Pod install
# run: |
# cd example/ios
# pod install
# cd ../..
# - name: Build Detox
# run: yarn example detox:ios:build
# - name: Upload iOS app
# uses: actions/upload-artifact@v4
# with:
# name: ios-app-artifact
# path: example/ios/build/Build/Products/Debug-iphonesimulator/ReactNativeSdkExample.app
# retention-days: 1
# build-android:
# name: Android - Build app for Detox tests
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Code
# uses: actions/checkout@v4
# with:
# fetch-depth: 1
# - name: Free Disk Space (Ubuntu)
# uses: jlumbroso/free-disk-space@main
# with:
# tool-cache: true
# android: false
# - name: Setup
# uses: ./.github/actions/setup
# with:
# setup-config: android
# - name: Setup Java
# uses: actions/setup-java@v4
# with:
# distribution: zulu
# java-version: 17
# - name: Setup Gradle
# uses: gradle/actions/setup-gradle@v3
# with:
# gradle-version: wrapper
# cache-read-only: false
# - name: Example App Yarn install
# run: |
# cd example
# yarn install
# cd ..
# - name: Build Detox
# run: yarn example detox:android:build
# - name: Upload Android app
# uses: actions/upload-artifact@v4
# with:
# name: android-app-artifact
# path: example/android/app/build/outputs/apk
# retention-days: 1
# run-ios-detox-tests:
# needs: [build-ios, find-test-files]
# name: iOS - Run Detox tests
# runs-on: macos-latest
# strategy:
# fail-fast: false
# matrix:
# test-file: ${{ fromJson(needs.find-test-files.outputs.test-files) }}
# steps:
# - name: Checkout Code
# uses: actions/checkout@v4
# with:
# fetch-depth: 1
# - name: Download iOS app
# uses: actions/download-artifact@v4
# with:
# name: ios-app-artifact
# path: example/ios/build/Build/Products/Debug-iphonesimulator/ReactNativeSdkExample.app
# - name: Setup
# uses: ./.github/actions/setup
# with:
# setup-config: ios
# - name: Install ios-deploy, detox, react-native-cli
# run: npm install -g ios-deploy detox-cli react-native-cli
# - name: Install Applesimutils
# run: |
# brew tap wix/brew
# brew install applesimutils
# - name: Rebuild Detox
# run: |
# cd example
# yarn detox rebuild-framework-cache
# cd ..
# - name: Start Metro Server
# env:
# ITBL_API_KEY: ${{secrets.ITERABLE_API_KEY}}
# ITBL_ID: ${{secrets.ITBL_ID}}
# run: cd example && yarn detox:start &
# - name: Run Detox tests
# env:
# ITBL_API_KEY: ${{secrets.ITERABLE_API_KEY}}
# ITBL_ID: ${{secrets.ITBL_ID}}
# run: yarn detox:ios:test:ci -- ${{ matrix.test-file }}
# - name: Upload Test Artifact - GitHub Action
# if: failure()
# uses: actions/upload-artifact@v4
# with:
# name: detox-ios-artifacts-${{ matrix.test-file }}
# path: example/artifacts
# retention-days: 1
# run-android-detox-tests:
# needs: [build-android, find-test-files]
# name: Android - Run Detox tests
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# test-file: ${{ fromJson(needs.find-test-files.outputs.test-files) }}
# steps:
# - name: Free Disk Space (Ubuntu)
# uses: jlumbroso/free-disk-space@main
# with:
# tool-cache: true
# android: false
# - name: Checkout Code
# uses: actions/checkout@v4
# with:
# fetch-depth: 1
# - name: Download Android app
# uses: actions/download-artifact@v4
# with:
# name: android-app-artifact
# path: example/android/app/build/outputs/apk
# - name: Setup
# uses: ./.github/actions/setup
# with:
# setup-config: android
# - name: Start Metro Server
# env:
# ITBL_API_KEY: ${{secrets.ITERABLE_API_KEY}}
# ITBL_ID: ${{secrets.ITBL_ID}}
# run: yarn detox:start &
# - name: Enable KVM
# run: |
# echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
# sudo udevadm control --reload-rules
# sudo udevadm trigger --name-match=kvm
# - name: Run Detox tests
# uses: reactivecircus/android-emulator-runner@v2
# env:
# ITBL_API_KEY: ${{secrets.ITERABLE_API_KEY}}
# ITBL_ID: ${{secrets.ITBL_ID}}
# with:
# api-level: 31
# arch: x86_64
# avd-name: Pixel_3a_API_34
# force-avd-creation: false
# emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-metrics
# disable-animations: false
# script: yarn detox:android:test:ci -- ${{ matrix.test-file }}
# - name: Upload Test Artifact - GitHub Action
# if: failure()
# uses: actions/upload-artifact@v4
# with:
# name: detox-android-artifacts-${{ matrix.test-file }}
# path: example/artifacts
# retention-days: 1