Skip to content

:integration:tests

:integration:tests #15

name: e2e:tests
run-name: :integration:tests
on:
push:
branches: [master]
pull_request:
branches: ['**']
env:
GITHUB_PACKAGES_USER: ${{ github.actor }}
GITHUB_PACKAGES_TOKEN: ${{ secrets.PACKAGE_READ_PAT }}
jobs:
android-e2e:
runs-on: ubuntu-latest
strategy:
matrix:
api-level: [33]
steps:
- name: Setup Node.js env
uses: actions/[email protected]
with:
node-version: 18.0.0
- name: Checkout code
uses: actions/checkout@v3
- name: Install React Native CLI
run: npm install react-native-cli
- name: Setup Java env
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '11'
- name: Install Maestro CLI
run: curl -Ls "https://get.maestro.mobile.dev" | bash
- name: Add Maestro to path
run: echo "${HOME}/.maestro/bin" >> $GITHUB_PATH
- name: Install Dependencies and build android
run: |
npm run install:no-pods
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}
- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
target: google_apis
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Run Android Emulator and app
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
target: google_apis
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: |
npm run android:release
npm run test:e2e:android
env:
MAESTRO_DRIVER_STARTUP_TIMEOUT: 30000
ios-e2e:
runs-on: macos-14
steps:
- name: Setup Node.js env
uses: actions/[email protected]
with:
node-version: 18.0.0
- name: Checkout code
uses: actions/checkout@v3
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v3
id: npm-cache
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- uses: actions/cache@v2
with:
path: ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Install React Native CLI
run: npm install react-native-cli
- name: Install Maestro CLI
run: |
curl -Ls "https://get.maestro.mobile.dev" | bash
brew tap facebook/fb
brew install facebook/fb/idb-companion
- name: Add Maestro to path
run: echo "${HOME}/.maestro/bin" >> $GITHUB_PATH
- name: Install Dependencies
run: npm run install:all
- name: Run iOS Emulator and app
run: |
npm run ios:release
npm run test:e2e:ios
env:
MAESTRO_DRIVER_STARTUP_TIMEOUT: 600000
- name: Stop Emulator
run: killall "Simulator"