|
9 | 9 |
|
10 | 10 | jobs: |
11 | 11 | e2e: |
12 | | - runs-on: macos-latest |
| 12 | + runs-on: ubuntu-latest |
13 | 13 | steps: |
14 | 14 | - uses: actions/checkout@v3 |
15 | | - - uses: actions/cache@v3 |
| 15 | + - id: yarn-cache |
| 16 | + uses: actions/cache@v3 |
16 | 17 | with: |
17 | 18 | path: | |
18 | | - ~/.gradle/caches |
19 | | - ~/.gradle/wrapper |
20 | | - key: gradle |
21 | | - - uses: actions/cache@v3 |
22 | | - id: avd-cache |
23 | | - with: |
24 | | - path: | |
25 | | - ~/.android/avd/* |
26 | | - ~/.android/adb* |
27 | | - key: avd |
| 19 | + **/node_modules |
| 20 | + .yarn/install-state.gz |
| 21 | + key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }} |
| 22 | + restore-keys: | |
| 23 | + ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} |
| 24 | + ${{ runner.os }}-yarn- |
28 | 25 | - uses: actions/setup-java@v3 |
29 | 26 | with: |
30 | 27 | distribution: 'temurin' |
31 | | - java-version: '11' |
| 28 | + java-version: '17' |
32 | 29 | - uses: android-actions/setup-android@v2 |
33 | | - - name: Android Deps |
34 | | - run: | |
35 | | - rm -rf ~/Library/Android/sdk/ndk || echo "skipped" |
36 | | - rm -rf ~/Library/Android/sdk/ndk-bundle || echo "skipped" |
37 | 30 | - uses: nttld/setup-ndk@v1 |
38 | 31 | id: setup-ndk |
39 | 32 | with: |
40 | 33 | ndk-version: r21d |
41 | | - - name: Set up Node |
42 | | - run: | |
| 34 | + - uses: actions/setup-node@v4 |
| 35 | + with: |
| 36 | + node-version-file: .nvmrc |
| 37 | + - run: | |
43 | 38 | npm install -g detox-cli |
44 | 39 | npm install -g yarn |
45 | | - - run: yarn |
| 40 | + npm install -g node-gyp |
| 41 | + - if: steps.yarn-cache.outputs.cache-hit != 'true' |
| 42 | + run: yarn install --immutable |
| 43 | + shell: bash |
46 | 44 | - run: yarn example build:android |
47 | 45 | env: |
48 | 46 | ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} |
| 47 | + - run: | |
| 48 | + rm -rf ~/.gradle |
| 49 | + rm -rf /usr/local/lib/android/sdk/ndk/ |
49 | 50 | - run: yarn example start & |
50 | 51 | timeout-minutes: 10 |
51 | | - - if: steps.avd-cache.outputs.cache-hit != 'true' |
52 | | - uses: reactivecircus/android-emulator-runner@v2 |
53 | | - with: |
54 | | - api-level: 29 |
55 | | - avd-name: PhoneAPI30 |
56 | | - arch: x86_64 |
57 | | - force-avd-creation: false |
58 | | - emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none |
59 | | - disable-animations: false |
60 | | - script: echo "Generated AVD snapshot for caching." |
| 52 | + - name: Enable KVM |
| 53 | + run: | |
| 54 | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules |
| 55 | + sudo udevadm control --reload-rules |
| 56 | + sudo udevadm trigger --name-match=kvm |
61 | 57 | - uses: reactivecircus/android-emulator-runner@v2 |
62 | 58 | with: |
63 | 59 | api-level: 29 |
64 | 60 | avd-name: PhoneAPI30 |
65 | | - arch: x86_64 |
66 | | - force-avd-creation: false |
67 | | - emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none |
68 | 61 | disable-animations: true |
69 | 62 | script: yarn example test:android |
0 commit comments