1name: Android Instrumentation Tests 2 3on: 4 workflow_dispatch: {} 5 push: 6 branches: [main] 7 paths: 8 - .github/workflows/android-instrumentation-tests.yml 9 - 'fastlane/**' 10 - 'packages/**/android/**' 11 - 'tools/**' 12 - yarn.lock 13 pull_request: 14 paths: 15 - .github/workflows/android-instrumentation-tests.yml 16 - 'fastlane/**' 17 - 'packages/**/android/**' 18 - 'tools/**' 19 - yarn.lock 20 21concurrency: 22 group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} 23 cancel-in-progress: true 24 25jobs: 26 test: 27 runs-on: macos-11 28 timeout-minutes: 60 29 env: 30 ORG_GRADLE_PROJECT_reactNativeArchitectures: x86_64 31 steps: 32 - name: ⬢ Setup Node 33 uses: actions/setup-node@v2 34 with: 35 node-version: '14.17' 36 - name: Check out repository 37 uses: actions/checkout@v2 38 with: 39 submodules: true 40 - name: Use JDK 11 41 uses: actions/setup-java@v2 42 with: 43 distribution: 'temurin' 44 java-version: '11' 45 - name: ♻️ Restore workspace node modules 46 uses: actions/cache@v2 47 id: node-modules-cache 48 with: 49 path: | 50 # See "workspaces" → "packages" in the root package.json for the source of truth of 51 # which node_modules are affected by the root yarn.lock 52 node_modules 53 apps/*/node_modules 54 home/node_modules 55 packages/*/node_modules 56 packages/@expo/*/node_modules 57 packages/@unimodules/*/node_modules 58 react-native-lab/react-native/node_modules 59 key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} 60 - name: Install node modules in root dir 61 run: yarn install --frozen-lockfile 62 - name: ♻️ Restore node modules in tools 63 uses: actions/cache@v2 64 with: 65 path: tools/node_modules 66 key: ${{ runner.os }}-tools-modules-${{ hashFiles('tools/yarn.lock') }} 67 - name: ♻️ Restore Gradle caches 68 uses: actions/cache@v2 69 with: 70 path: ~/.gradle/caches 71 key: ${{ runner.os }}-gradle-${{ hashFiles('android/*.gradle*') }} 72 restore-keys: | 73 ${{ runner.os }}-gradle- 74 - name: Run instrumented unit tests 75 timeout-minutes: 40 76 uses: reactivecircus/android-emulator-runner@v2 77 with: 78 api-level: 29 79 arch: x86_64 80 script: bin/expotools android-native-unit-tests --type instrumented 81