Skip to content

Commit f5bdea0

Browse files
authored
feat: expo example (#886)
1 parent aaf49c3 commit f5bdea0

356 files changed

Lines changed: 28183 additions & 5455 deletions

File tree

Some content is hidden

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

.github/actions/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ runs:
2424
if: ${{ runner.os == 'macOS' }}
2525
uses: maxim-lobanov/setup-cocoapods@v1
2626
with:
27-
version: 1.13.0
27+
version: 1.16.2
2828

2929
- name: Cache dependencies
3030
id: yarn-cache

.github/workflows/build.yml

Lines changed: 16 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ jobs:
1414
matrix:
1515
newArch: [false, true]
1616
env:
17-
TURBO_CACHE_DIR: .turbo/android
18-
turbo_cache_hit: 0
1917
ORG_GRADLE_PROJECT_newArchEnabled: ${{ matrix.newArch }}
2018
steps:
2119
- name: Checkout
@@ -24,71 +22,40 @@ jobs:
2422
- name: Setup
2523
uses: ./.github/actions/setup
2624

27-
- name: Cache turborepo for Android
28-
uses: actions/cache@v3
29-
with:
30-
path: ${{ env.TURBO_CACHE_DIR }}
31-
key: ${{ runner.os }}-turborepo-android-${{ matrix.newArch }}-${{ hashFiles('**/yarn.lock') }}
32-
restore-keys: |
33-
${{ runner.os }}-turborepo-android-${{ matrix.newArch }}-
34-
35-
- name: Check turborepo cache for Android
36-
run: |
37-
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android').cache.status")
38-
39-
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
40-
echo "turbo_cache_hit=1" >> $GITHUB_ENV
41-
fi
42-
4325
- name: Install JDK
44-
if: env.turbo_cache_hit != 1
4526
uses: actions/setup-java@v3
4627
with:
4728
distribution: 'zulu'
4829
java-version: '17'
4930

5031
- name: Finalize Android SDK
51-
if: env.turbo_cache_hit != 1
5232
run: |
5333
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
5434
55-
- name: Cache Gradle
56-
if: env.turbo_cache_hit != 1
57-
uses: actions/cache@v3
58-
with:
59-
path: |
60-
~/.gradle/wrapper
61-
~/.gradle/caches
62-
key: ${{ runner.os }}-gradle-${{ matrix.newArch }}-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
63-
restore-keys: |
64-
${{ runner.os }}-gradle-${{ matrix.newArch }}-
65-
6635
- name: Modify APP ID
6736
run: |
6837
sed "s/localAppId = '\(.*\)'/localAppId = '${{ secrets.APP_ID }}'/g" agora.config.ts > tmp
6938
mv tmp agora.config.ts
70-
working-directory: example/src/config
39+
working-directory: examples/expo/src/config
7140

7241
- name: Build example for Android
7342
run: |
74-
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --force=true
43+
yarn example build:android
7544
7645
- name: Upload APK
7746
uses: actions/upload-artifact@v4
7847
with:
79-
name: AgoraRtcNgExample-Android-${{ matrix.newArch && 'NewArch' || 'OldArch' }}-${{ github.run_id }}
48+
name: AgoraRtcNgExampleExpo-Android-${{ matrix.newArch && 'NewArch' || 'OldArch' }}-${{ github.run_id }}
8049
path: |
81-
example/android/app/build/outputs/apk/release/*.apk
50+
examples/expo/android/app/build/outputs/apk/release/*.apk
8251
if-no-files-found: error
8352

8453
build-ios:
85-
runs-on: macos-latest
54+
runs-on: macos-15
8655
strategy:
8756
matrix:
8857
newArch: [false, true]
8958
env:
90-
TURBO_CACHE_DIR: .turbo/ios
91-
turbo_cache_hit: 0
9259
RCT_NEW_ARCH_ENABLED: ${{ matrix.newArch }}
9360
steps:
9461
- name: Checkout
@@ -101,34 +68,20 @@ jobs:
10168
run: |
10269
brew install fastlane
10370
104-
- name: Cache turborepo for iOS
105-
uses: actions/cache@v3
106-
with:
107-
path: ${{ env.TURBO_CACHE_DIR }}
108-
key: ${{ runner.os }}-turborepo-ios-${{ matrix.newArch }}-${{ hashFiles('**/yarn.lock') }}
109-
restore-keys: |
110-
${{ runner.os }}-turborepo-ios-${{ matrix.newArch }}-
111-
112-
- name: Cache cocoapods
113-
if: env.turbo_cache_hit != 1
114-
id: cocoapods-cache
115-
uses: actions/cache@v3
116-
with:
117-
path: |
118-
**/ios/Pods
119-
key: ${{ runner.os }}-cocoapods-${{ matrix.newArch }}-${{ hashFiles('example/ios/Podfile.lock') }}
120-
restore-keys: |
121-
${{ runner.os }}-cocoapods-${{ matrix.newArch }}-
71+
- name: Switch Xcode
72+
run: |
73+
#https://github.com/actions/runner-images/issues/12758
74+
sudo xcode-select --switch /Applications/Xcode_16.4.app
12275
12376
- name: Install cocoapods
12477
run: |
125-
yarn pod-install example/ios
78+
yarn pod-install examples/expo/ios
12679
12780
- name: Modify APP ID
12881
run: |
12982
sed "s/localAppId = '\(.*\)'/localAppId = '${{ secrets.APP_ID }}'/g" agora.config.ts > tmp
13083
mv tmp agora.config.ts
131-
working-directory: example/src/config
84+
working-directory: examples/expo/src/config
13285

13386
- name: Install the Apple certificate and provisioning profile
13487
env:
@@ -161,22 +114,22 @@ jobs:
161114
162115
- name: Build example for iOS
163116
run: |
164-
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --force=true
117+
yarn example build:ios
165118
166119
- name: Upload IPA
167120
uses: actions/upload-artifact@v4
168121
with:
169-
name: AgoraRtcNgExample-iOS-${{ matrix.newArch && 'NewArch' || 'OldArch' }}-${{ github.run_id }}
122+
name: AgoraRtcNgExampleExpo-iOS-${{ matrix.newArch && 'NewArch' || 'OldArch' }}-${{ github.run_id }}
170123
path: |
171-
example/ios/*.ipa
124+
examples/expo/ios/*.ipa
172125
if-no-files-found: error
173126

174127
- name: Upload dSYM
175128
uses: actions/upload-artifact@v4
176129
with:
177-
name: AgoraRtcNgExampleSymbol-${{ matrix.newArch && 'NewArch' || 'OldArch' }}-${{ github.run_id }}
130+
name: AgoraRtcNgExampleExpoSymbol-${{ matrix.newArch && 'NewArch' || 'OldArch' }}-${{ github.run_id }}
178131
path: |
179-
example/ios/*.dSYM.zip
132+
examples/expo/ios/*.dSYM.zip
180133
if-no-files-found: error
181134

182135
notification:

.github/workflows/ci.yml

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

.github/workflows/dep.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ jobs:
4242
4343
- name: Update example
4444
run: |
45-
rm -rf example/ios/Podfile.lock
46-
yarn pod-install example/ios
45+
rm -rf examples/expo/ios/Podfile.lock
46+
yarn pod-install examples/expo/ios
4747
4848
- name: Create pull request
4949
uses: AgoraIO-Extensions/actions/.github/actions/pr@main

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ android.iml
4444

4545
# Cocoapods
4646
#
47-
example/ios/Pods
47+
examples/**/ios/Pods
4848
**/Pods/
4949

5050
# Ruby
51-
example/vendor/
51+
examples/**/vendor/
5252

5353
# node.js
5454
#

.yarnrc.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ nmHoistingLimits: workspaces
44

55
plugins:
66
- path: scripts/bootstrap.cjs
7-
- path: scripts/pod-install.cjs
87
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
98
spec: "@yarnpkg/plugin-interactive-tools"
109
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

0 commit comments

Comments
 (0)