44 pull_request :
55 types : [opened, reopened, synchronize]
66
7+ # Cancel in-progress runs on the same PR to avoid wasting runner minutes.
8+ concurrency :
9+ group : ${{ github.workflow }}-${{ github.ref }}
10+ cancel-in-progress : true
11+
12+ env :
13+ NDK_VERSION : 29.0.14033849
14+
715jobs :
816 build :
917 runs-on : ubuntu-latest
1018 strategy :
19+ fail-fast : false
1120 matrix :
1221 api-level : [ 34 ]
1322 newArchEnabled : [ true ]
14- name : Build for API Level ${{ matrix.api-level }} using ${{matrix.newArchEnabled == true && 'New' || 'Old' }} Architecture
23+ name : Build for API Level ${{ matrix.api-level }} using ${{matrix.newArchEnabled == true && 'New' || 'Old' }} Architecture
1524 steps :
1625 - name : Checkout repository
1726 uses : actions/checkout@v4
2130 with :
2231 java-version : 17
2332 distribution : adopt
24- cache : gradle
33+
34+ - name : Setup Gradle
35+ uses : gradle/actions/setup-gradle@v4
2536
2637 - name : Validate Gradle wrapper
2738 uses : gradle/actions/wrapper-validation@v4
3344 cache : ' npm'
3445
3546 - name : Run npm install
36- run : |
37- npm i -g corepack
38- npm ci --workspaces --include-workspace-root
47+ run : npm ci --workspaces --include-workspace-root
3948
4049 - name : Build workspaces
4150 run : npm run build
@@ -44,20 +53,15 @@ jobs:
4453 run : npm test
4554
4655 - name : Install & update e2e app with latest react-native-theoplayer
47- run : |
48- cd apps/e2e
49- npm update react-native-theoplayer
50- npm ci
56+ working-directory : apps/e2e
57+ run : npm install react-native-theoplayer@latest
5158
5259 - name : Enable KVM
5360 run : |
5461 echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
5562 sudo udevadm control --reload-rules
5663 sudo udevadm trigger --name-match=kvm
5764
58- - name : Gradle cache
59- uses : gradle/actions/setup-gradle@v3
60-
6165 - name : AVD cache
6266 uses : actions/cache@v4
6367 id : avd-cache
6872 key : avd-${{ matrix.api-level }}
6973
7074 - name : Create AVD and generate snapshot for caching
71- if : steps.avd-cache.outputs.cache-hit != 'true' # check previous step output
75+ if : steps.avd-cache.outputs.cache-hit != 'true'
7276 uses : reactivecircus/android-emulator-runner@v2
7377 with :
7478 api-level : ${{ matrix.api-level }}
@@ -81,18 +85,25 @@ jobs:
8185 disable-animations : true
8286 script : echo "Generated AVD snapshot for caching."
8387
84- - name : Modify gradle.properties with repository secrets
88+ - name : Cache NDK
89+ uses : actions/cache@v4
90+ id : ndk-cache
91+ with :
92+ path : /usr/local/lib/android/sdk/ndk/${{ env.NDK_VERSION }}
93+ key : ndk-${{ env.NDK_VERSION }}
94+
95+ - name : Install NDK
96+ if : steps.ndk-cache.outputs.cache-hit != 'true'
97+ run : echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "ndk;${{ env.NDK_VERSION }}"
98+
99+ - name : Configure gradle.properties
85100 working-directory : apps/e2e/android
86101 run : |
87102 echo "YOSPACE_USERNAME=${{ secrets.YOSPACE_USERNAME }}" >> ./gradle.properties
88103 echo "YOSPACE_PASSWORD=${{ secrets.YOSPACE_PASSWORD }}" >> ./gradle.properties
89-
90- - name : Modify gradle.properties for newArchEnabled
91- working-directory : apps/e2e/android
92- run : |
93- # Modify or add the newArchEnabled property in gradle.properties
94- echo "newArchEnabled=${{ matrix.newArchEnabled }}" >> ./gradle.properties
95- cat ./gradle.properties
104+ echo "newArchEnabled=${{ matrix.newArchEnabled }}" >> ./gradle.properties
105+ # Only build the x86_64 ABI needed by the CI emulator.
106+ echo "reactNativeArchitectures=x86_64" >> ./gradle.properties
96107
97108 - name : Run e2e tests
98109 uses : reactivecircus/android-emulator-runner@v2
@@ -102,10 +113,17 @@ jobs:
102113 arch : x86_64
103114 cores : 2
104115 ram-size : 3072M
105- force-avd-creation : true
116+ force-avd-creation : false
106117 emulator-options : -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
107118 disable-animations : true
108- script : |
109- npm run test:e2e:android
110- cat cavy_results.md >> $GITHUB_STEP_SUMMARY
119+ script : npm run test:e2e:android
111120 working-directory : apps/e2e
121+
122+ - name : Summarize results
123+ working-directory : apps/e2e
124+ if : always()
125+ run : |
126+ if [ -f cavy_results.md ]; then
127+ cat cavy_results.md >> $GITHUB_STEP_SUMMARY
128+ fi
129+
0 commit comments