diff --git a/.github/workflows/android-e2e-test.yml b/.github/workflows/android-e2e-test.yml new file mode 100644 index 0000000000..4e1ac4914a --- /dev/null +++ b/.github/workflows/android-e2e-test.yml @@ -0,0 +1,46 @@ +name: Test Android e2e +on: + pull_request: + paths: + - 'Example/**' + push: + branches: + - master + workflow_dispatch: +jobs: + test: + runs-on: macos-latest + timeout-minutes: 40 + env: + WORKING_DIRECTORY: Example + concurrency: + group: android-e2e-${{ github.ref }} + cancel-in-progress: true + steps: + - name: checkout + uses: actions/checkout@v2 + - name: Use Node.js 14 + uses: actions/setup-node@v2 + with: + node-version: 14 + cache: 'yarn' + - name: Install root node dependencies + run: yarn + - name: Install node dependencies + working-directory: ${{ env.WORKING_DIRECTORY }} + run: yarn + - name: Build app + working-directory: ${{ env.WORKING_DIRECTORY }} + run: yarn build-e2e-android + - name: Run emulator and tests + uses: reactivecircus/android-emulator-runner@v2 + with: + working-directory: ${{ env.WORKING_DIRECTORY }} + api-level: 29 + avd-name: e2e_emulator + script: yarn test-e2e-android + - uses: actions/upload-artifact@v2 + if: ${{ failure() }} + with: + name: android-fail-screen-shoots + path: ${{ env.WORKING_DIRECTORY }}/artifacts diff --git a/Example/.detoxrc.json b/Example/.detoxrc.json index 3dff53c417..7dfdc9228a 100644 --- a/Example/.detoxrc.json +++ b/Example/.detoxrc.json @@ -34,7 +34,7 @@ "emulator": { "type": "android.emulator", "device": { - "avdName": "Pixel_3a_API_30_x86" + "avdName": "e2e_emulator" } } }, diff --git a/Example/package.json b/Example/package.json index 57fc5f13c8..bc6a2ceb45 100644 --- a/Example/package.json +++ b/Example/package.json @@ -12,7 +12,7 @@ "build-e2e-ios": "detox build --configuration ios.release", "build-e2e-android": "detox build --configuration android.release", "test-e2e-ios": "detox test --configuration ios.release", - "test-e2e-android": "detox test --configuration android.release" + "test-e2e-android": "detox test --configuration android.release --take-screenshots failing" }, "dependencies": { "@react-native-community/masked-view": "^0.1.10",