Tap e2e test #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test Android e2e | |
| on: | |
| pull_request: | |
| paths: | |
| - .argent/flows/* | |
| - .github/workflows/android-e2e.yml | |
| - packages/react-native-gesture-handler/android/** | |
| - apps/expo-example/android/** | |
| - apps/expo-example/package.json | |
| - rnrepo.config.json | |
| - yarn.lock | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| if: github.repository == 'software-mansion/react-native-gesture-handler' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| concurrency: | |
| group: android-e2e-${{ github.ref }} | |
| cancel-in-progress: true | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v4 | |
| - name: Use Java 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: oracle | |
| java-version: 17 | |
| - name: Use Node.js 24 | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: yarn | |
| - name: Install node dependencies | |
| working-directory: apps/expo-example | |
| run: yarn install --immutable | |
| - name: Build app in Release mode | |
| working-directory: apps/expo-example/android | |
| run: ./gradlew :app:assembleRelease --console=plain -PreactNativeArchitectures=x86_64 | |
| - name: Install Agent | |
| run: npx @swmansion/argent init --yes | |
| - 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: Set up emulator and run tap E2E test | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: 34 | |
| target: google_apis | |
| arch: x86_64 | |
| force-avd-creation: false | |
| emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
| disable-animations: true | |
| script: | | |
| APK=$(find apps/expo-example/android/app/build/outputs/apk/release -name "*.apk" | head -1) | |
| if [ -z "$APK" ]; then | |
| echo "Could not find built .apk" >&2 | |
| exit 1 | |
| fi | |
| echo "Installing $APK" | |
| adb install -r "$APK" | |
| SERIAL=$(adb devices | awk 'NR>1 && $2=="device"{print $1; exit}') | |
| echo "Using emulator $SERIAL" | |
| argent flow run simple-tap-test --device "$SERIAL" |