Skip to content

Commit 7c9968a

Browse files
committed
fix(#50): cache avd and add enable kvm group params in e2e android workflow
1 parent 3f42703 commit 7c9968a

File tree

6 files changed

+29
-19
lines changed

6 files changed

+29
-19
lines changed

.github/actions/installMaestro/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ runs:
1212
- name: Install Maestro CLI
1313
shell: bash
1414
run: |
15-
export MAESTRO_VERSION=1.40.3
15+
export MAESTRO_VERSION=1.41.0
1616
curl -Ls "https://get.maestro.mobile.dev" | bash
1717
1818
- name: Conditionally install brew packages for iOS

.github/actions/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ runs:
1111
node-version: 20
1212

1313
- name: Install dependencies
14-
run: yarn install --frozen-lockfile --immutable
14+
run: yarn install --immutable
1515
shell: bash

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
cache: yarn
2525

2626
- name: Install Dependencies
27-
run: yarn install --frozen-lockfile
27+
run: yarn install --immutable
2828

2929
- name: Create Release Pull Request or Publish to npm
3030
id: changesets

.github/workflows/test-e2e-android.yaml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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()

.github/workflows/test-e2e-ios.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
target-platform: ios
5252

5353
- name: Install example dependencies
54-
run: yarn workspace react-native-legal-bare-example install --frozen-lockfile --immutable
54+
run: yarn workspace react-native-legal-bare-example install --immutable
5555

5656
- name: Cache Pods
5757
id: cache-pods

scripts/e2e_android_emulator_build_and_test.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)