@@ -68,55 +68,24 @@ jobs:
6868 newArch : [true, false]
6969 runs-on : ubuntu-latest
7070 env :
71- TURBO_CACHE_DIR : .turbo/android
7271 ORG_GRADLE_PROJECT_newArchEnabled : ${{ matrix.newArch }}
73- turbo_cache_hit : 0
7472 steps :
7573 - name : Checkout
7674 uses : actions/checkout@v4
7775
7876 - name : Setup
7977 uses : ./.github/actions/setup
8078
81- - name : Cache turborepo for Android
82- uses : actions/cache@v3
83- with :
84- path : ${{ env.TURBO_CACHE_DIR }}
85- key : ${{ runner.os }}-turborepo-android-detox-${{ matrix.newArch }}-${{ hashFiles('**/yarn.lock') }}
86- restore-keys : |
87- ${{ runner.os }}-turborepo-android-detox-${{ matrix.newArch }}-
88-
89- - name : Check turborepo cache for Android
90- run : |
91- TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run detox:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'detox:android').cache.status")
92-
93- if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
94- echo "turbo_cache_hit=1" >> $GITHUB_ENV
95- fi
96-
9779 - name : Install JDK
98- if : env.turbo_cache_hit != 1
9980 uses : actions/setup-java@v3
10081 with :
10182 distribution : ' zulu'
10283 java-version : ' 17'
10384
10485 - name : Finalize Android SDK
105- if : env.turbo_cache_hit != 1
10686 run : |
10787 /bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
10888
109- - name : Cache Gradle
110- if : env.turbo_cache_hit != 1
111- uses : actions/cache@v3
112- with :
113- path : |
114- ~/.gradle/wrapper
115- ~/.gradle/caches
116- key : ${{ runner.os }}-gradle-${{ matrix.newArch }}-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
117- restore-keys : |
118- ${{ runner.os }}-gradle-${{ matrix.newArch }}-
119-
12089 - name : Install Detox dependencies
12190 shell : bash
12291 run : |
@@ -126,23 +95,33 @@ jobs:
12695 run : |
12796 sed "s/localAppId = '\(.*\)'/localAppId = '${{ secrets.APP_ID }}'/g" agora.config.ts > tmp
12897 mv tmp agora.config.ts
129- working-directory : example /src/config
98+ working-directory : examples/expo /src/config
13099
131100 - name : Build example for Android
132101 run : |
133- yarn turbo run detox:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
102+ yarn example detox:android
134103
135104 - name : Clean Useless cache
136105 run : |
137- rm -rf "${{ env.TURBO_CACHE_DIR }}" || true
138106 rm -rf ~/.gradle/caches || true
139107 rm -rf ~/.gradle/wrapper || true
140108 sudo apt-get clean
141109 npm cache clean --force
142- rm -rf example /ios
110+ rm -rf examples/** /ios
143111 yarn cache clean
144112 df -h
145113
114+ - name : Free Disk Space
115+ uses : jlumbroso/free-disk-space@main
116+ with :
117+ tool-cache : false
118+ android : false
119+ dotnet : true
120+ haskell : true
121+ large-packages : true
122+ docker-images : true
123+ swap-storage : true
124+
146125 - name : Enable KVM group perms
147126 run : |
148127 echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
@@ -157,16 +136,15 @@ jobs:
157136 api-level : 31
158137 arch : x86_64
159138 avd-name : emulator
160- working-directory : example
139+ working-directory : examples/expo
161140 script : detox test -c android.emu.release
162141
163142 test-ios :
164143 strategy :
165144 matrix :
166145 newArch : [1, 0]
167- runs-on : macos-latest
146+ runs-on : macos-15
168147 env :
169- TURBO_CACHE_DIR : .turbo/ios
170148 RCT_NEW_ARCH_ENABLED : ${{ matrix.newArch }}
171149 steps :
172150 - name : Checkout
@@ -177,7 +155,12 @@ jobs:
177155
178156 - name : Install cocoapods
179157 run : |
180- yarn pod-install example/ios
158+ yarn pod-install examples/expo/ios
159+
160+ - name : Switch Xcode
161+ run : |
162+ #https://github.com/actions/runner-images/issues/12758
163+ sudo xcode-select --switch /Applications/Xcode_16.4.app
181164
182165 - name : Install Detox dependencies
183166 shell : bash
@@ -190,20 +173,20 @@ jobs:
190173 run : |
191174 sed "s/localAppId = '\(.*\)'/localAppId = '${{ secrets.APP_ID }}'/g" agora.config.ts > tmp
192175 mv tmp agora.config.ts
193- working-directory : example /src/config
176+ working-directory : examples/expo /src/config
194177
195178 - name : Build example for iOS
196179 run : |
197- yarn turbo run detox:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"
180+ yarn example detox:ios
198181
199182 - uses : futureware-tech/simulator-action@v4
200183 with :
201- model : ' iPhone 15 '
184+ model : ' iPhone 16 '
202185
203186 - name : Run e2e tests
204187 # https://github.com/wix/Detox/issues/3720#issuecomment-1347855162
205188 if : ${{ matrix.newArch == 0 }}
206- working-directory : example
189+ working-directory : examples/expo
207190 run : |
208191 detox clean-framework-cache
209192 detox build-framework-cache
0 commit comments