@@ -78,22 +78,41 @@ jobs:
7878 uses : gradle/actions/setup-gradle@v3
7979
8080 - name : Install example dependencies
81- run : yarn workspace react-native-legal-bare-example install --frozen-lockfile -- immutable
81+ run : yarn workspace react-native-legal-bare-example install --immutable
8282
8383 - name : Bundle app
8484 run : yarn workspace react-native-legal-bare-example build:android
8585
86- - name : Create AVD and generate snapshot for caching
86+ - name : Enable KVM group perms
87+ run : |
88+ echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
89+ sudo udevadm control --reload-rules
90+ sudo udevadm trigger --name-match=kvm
91+
92+ - name : AVD cache
93+ uses : actions/cache@v4
94+ id : avd-cache
95+ with :
96+ path : |
97+ ~/.android/avd/*
98+ ~/.android/adb*
99+ key : avd-${{ matrix.api-level }}
100+
101+ - name : create AVD, generate snapshot for caching, build app and run tests
87102 uses : reactivecircus/android-emulator-runner@v2
88103 with :
89104 api-level : ${{ matrix.api-level }}
90105 arch : ' x86_64'
91106 target : ' google_apis'
92- force-avd-creation : true
93- emulator-options : -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
107+ force-avd-creation : ${{ steps.avd-cache.outputs.cache-hit != 'true' }}
108+ cores : 4
109+ emulator-options : -verbose -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-front none -camera-back none
94110 disable-animations : false
95- ram-size : ' 4096M'
96- script : ./scripts/e2e_android_emulator_build_and_test.sh
111+ ram-size : ' 6144M'
112+ script : |
113+ echo "Generated AVD snapshot for caching."
114+ yarn workspace react-native-legal-bare-example android:release
115+ yarn workspace react-native-legal-bare-example e2e:android
97116
98117 - name : Upload report
99118 if : always()
0 commit comments