|
| 1 | +name: Test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [master] |
| 6 | + pull_request: |
| 7 | + |
| 8 | +concurrency: |
| 9 | + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
| 12 | +jobs: |
| 13 | + analyse_js: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v6 |
| 17 | + - run: corepack enable |
| 18 | + - uses: actions/setup-node@v6 |
| 19 | + with: |
| 20 | + node-version: lts/* |
| 21 | + cache: yarn |
| 22 | + - run: yarn install --immutable |
| 23 | + - name: Run ESLint |
| 24 | + run: yarn lint |
| 25 | + - name: Jest |
| 26 | + run: yarn test |
| 27 | + |
| 28 | + e2e_ios: |
| 29 | + runs-on: macos-26 |
| 30 | + strategy: |
| 31 | + fail-fast: false |
| 32 | + matrix: |
| 33 | + include: |
| 34 | + - arch: old |
| 35 | + pod-env: 'RCT_NEW_ARCH_ENABLED=0' |
| 36 | + - arch: new |
| 37 | + pod-env: 'RCT_NEW_ARCH_ENABLED=1' |
| 38 | + name: e2e_ios (${{ matrix.arch }} arch) |
| 39 | + env: |
| 40 | + DEVELOPER_DIR: /Applications/Xcode_26.3.app/Contents/Developer |
| 41 | + steps: |
| 42 | + - uses: actions/checkout@v6 |
| 43 | + - name: Boot iPhone 17 Pro Max simulator |
| 44 | + run: | |
| 45 | + DEVICE_ID=$(xcrun simctl list devices available -j | jq -r '.devices | to_entries[] | .value[] | select(.name == "iPhone 17 Pro Max") | .udid' | head -1) |
| 46 | + xcrun simctl boot "$DEVICE_ID" |
| 47 | + - name: Install applesimutils |
| 48 | + run: | |
| 49 | + HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null |
| 50 | + HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null |
| 51 | + - run: corepack enable |
| 52 | + - uses: actions/setup-node@v6 |
| 53 | + with: |
| 54 | + node-version: lts/* |
| 55 | + cache: yarn |
| 56 | + - run: yarn install --immutable |
| 57 | + - name: Bundle JS |
| 58 | + run: yarn bundle:ios |
| 59 | + - uses: actions/cache@v5 |
| 60 | + with: |
| 61 | + path: example/ios/Pods |
| 62 | + key: pods-${{ matrix.arch }}-${{ runner.os }}-${{ hashFiles('example/ios/Podfile.lock') }} |
| 63 | + - name: Pod install |
| 64 | + run: cd example && ${{ matrix.pod-env }} RCT_USE_RN_DEP=1 RCT_USE_PREBUILT_RNCORE=1 npx pod-install |
| 65 | + - name: Build app for e2e tests |
| 66 | + run: yarn detox:ios:build:release |
| 67 | + - name: Run e2e tests |
| 68 | + run: yarn detox:ios:test:release |
| 69 | + - uses: actions/upload-artifact@v7 |
| 70 | + if: failure() |
| 71 | + with: |
| 72 | + name: ios-e2e-${{ matrix.arch }}-artifacts |
| 73 | + path: artifacts |
| 74 | + retention-days: 14 |
| 75 | + |
| 76 | + e2e_android: |
| 77 | + runs-on: ubuntu-latest |
| 78 | + strategy: |
| 79 | + fail-fast: false |
| 80 | + matrix: |
| 81 | + include: |
| 82 | + - arch: old |
| 83 | + new-arch-enabled: false |
| 84 | + - arch: new |
| 85 | + new-arch-enabled: true |
| 86 | + name: e2e_android (${{ matrix.arch }} arch) |
| 87 | + env: |
| 88 | + GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx4g -XX:+HeapDumpOnOutOfMemoryError" -Dorg.gradle.daemon=false' |
| 89 | + steps: |
| 90 | + - uses: actions/checkout@v6 |
| 91 | + - run: corepack enable |
| 92 | + - uses: actions/setup-node@v6 |
| 93 | + with: |
| 94 | + node-version: lts/* |
| 95 | + cache: yarn |
| 96 | + - uses: actions/setup-java@v5 |
| 97 | + with: |
| 98 | + distribution: zulu |
| 99 | + java-version: 17 |
| 100 | + - uses: actions/cache@v5 |
| 101 | + with: |
| 102 | + path: | |
| 103 | + ~/.gradle/caches |
| 104 | + ~/.gradle/wrapper |
| 105 | + key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} |
| 106 | + - run: yarn install --immutable |
| 107 | + - name: Bundle JS |
| 108 | + run: yarn bundle:android |
| 109 | + - run: yarn generateManifest |
| 110 | + - name: Build app for e2e tests |
| 111 | + run: ORG_GRADLE_PROJECT_newArchEnabled=${{ matrix.new-arch-enabled }} yarn detox:android:build:release |
| 112 | + - name: Enable KVM |
| 113 | + run: | |
| 114 | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules |
| 115 | + sudo udevadm control --reload-rules |
| 116 | + sudo udevadm trigger --name-match=kvm |
| 117 | + - name: Run e2e tests |
| 118 | + uses: reactivecircus/android-emulator-runner@v2 |
| 119 | + with: |
| 120 | + api-level: 29 |
| 121 | + avd-name: TestingAVD |
| 122 | + profile: pixel_6_pro |
| 123 | + disable-animations: true |
| 124 | + script: | |
| 125 | + adb root |
| 126 | + adb wait-for-device |
| 127 | + adb shell setprop persist.sys.timezone "Europe/Prague" |
| 128 | + adb shell settings put global auto_time_zone 0 |
| 129 | + adb shell am broadcast -a android.intent.action.TIMEZONE_CHANGED |
| 130 | + adb shell getprop persist.sys.timezone |
| 131 | + yarn detox:android:test:release |
| 132 | + - uses: actions/upload-artifact@v7 |
| 133 | + if: failure() |
| 134 | + with: |
| 135 | + name: android-e2e-${{ matrix.arch }}-artifacts |
| 136 | + path: artifacts |
| 137 | + retention-days: 14 |
0 commit comments