From 538d4e1317370d3466ce545d76ae51d60ebb7dfc Mon Sep 17 00:00:00 2001 From: Sandipan Dey Date: Sat, 30 Dec 2023 10:19:42 +0530 Subject: [PATCH] ci: e2e --- .github/workflows/e2e.yml | 38 ++++++++++++++++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/e2e.yml diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 0000000000..52ceab7424 --- /dev/null +++ b/.github/workflows/e2e.yml @@ -0,0 +1,38 @@ +name: E2E Tests + +on: + pull_request: + branches: [ main ] + +jobs: + e2e-android: + name: Run Detox Tests on Android + runs-on: macos-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: 20 + + - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + + - name: Install Dependencies + run: yarn install + + - name: Start Android Emulator + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: 34 + script: yarn detox:build diff --git a/package.json b/package.json index c57f18c3ca..371a94d5c5 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,8 @@ "android:buildDebug": "yarn android:prepareAssets && ./android/gradlew -b ./android/build.gradle assembleDebug -Dorg.gradle.jvmargs='-Xmx4g -XX:MaxPermSize=512m'", "ios:prepareAssets": "react-native bundle --entry-file index.js --bundle-output ./ios/main.jsbundle --assets-dest ./ios/ --platform ios --dev false", "bundle-visualizer": "yarn run react-native-bundle-visualizer", - "splash": "yarn react-native generate-bootsplash --background-color \"#000\" --logo-width 300 app/assets/logo/app-logo-dark.svg" + "splash": "yarn react-native generate-bootsplash --background-color \"#000\" --logo-width 300 app/assets/logo/app-logo-dark.svg", + "detox:android": "detox build --configuration android.emu.debug && detox test --configuration android.emu.debug" }, "dependencies": { "@apollo/client": "3.9.0-alpha.5",