name: Android Instrumentation Tests on: workflow_dispatch: {} push: branches: [master] paths: - .github/workflows/android-instrumentation-tests.yml - 'fastlane/**' - 'packages/**/android/**' - 'tools/**' - yarn.lock pull_request: paths: - .github/workflows/android-instrumentation-tests.yml - 'fastlane/**' - 'packages/**/android/**' - 'tools/**' - yarn.lock concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} cancel-in-progress: true jobs: test: runs-on: macos-11 env: NDK_ABI_FILTERS: x86_64 steps: - name: 👀 Check out repository uses: actions/checkout@v2 with: submodules: true - name: ♻️ Restore workspace node modules uses: actions/cache@v2 id: node-modules-cache with: path: | # See "workspaces" → "packages" in the root package.json for the source of truth of # which node_modules are affected by the root yarn.lock node_modules apps/*/node_modules home/node_modules packages/*/node_modules packages/@unimodules/*/node_modules react-native-lab/react-native/node_modules key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} - name: 🧶 Install node modules in root dir run: yarn install --frozen-lockfile - name: ♻️ Restore node modules in tools uses: actions/cache@v2 with: path: tools/node_modules key: ${{ runner.os }}-tools-modules-${{ hashFiles('tools/yarn.lock') }} - name: ♻️ Restore Gradle caches uses: actions/cache@v2 with: path: ~/.gradle/caches key: ${{ runner.os }}-gradle-${{ hashFiles('android/*.gradle*') }} restore-keys: | ${{ runner.os }}-gradle- - name: 💿 Patch react-native to support single abi run: sed -i '' 's/^APP_ABI := .*$/APP_ABI := $(if $(NDK_ABI_FILTERS),$(NDK_ABI_FILTERS),$(armeabi-v7a x86 arm64-v8a x86_64))/g' ReactAndroid/src/main/jni/Application.mk working-directory: react-native-lab/react-native - name: 🎸 Run instrumented unit tests uses: reactivecircus/android-emulator-runner@v2 with: api-level: 29 arch: x86_64 script: bin/expotools android-native-unit-tests --type instrumented