diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8dc26a5b..c328231e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,12 +74,8 @@ jobs: - name: Detox - Build run: RCT_NO_LAUNCH_PACKAGER=1 yarn example build:ios - # Important to do this after build, as a build will kill any running metro server - - name: Run Server (with mocks) - run: yarn example start:e2e & - - name: Detox - Test - run: yarn example test:ios + run: yarn example e2e:ios run-e2e-android: needs: cancel_previous @@ -146,9 +142,6 @@ jobs: - name: Detox - Build run: RCT_NO_LAUNCH_PACKAGER=1 yarn example build:android - - name: Run Server (with mocks) - run: yarn example start:e2e & - - name: Detox - Test uses: reactivecircus/android-emulator-runner@v2 with: @@ -159,4 +152,4 @@ jobs: force-avd-creation: false emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true - script: yarn example test:android + script: yarn example e2e:android diff --git a/examples/AnalyticsReactNativeExample/package.json b/examples/AnalyticsReactNativeExample/package.json index db4ea7f8..5002c719 100644 --- a/examples/AnalyticsReactNativeExample/package.json +++ b/examples/AnalyticsReactNativeExample/package.json @@ -5,7 +5,7 @@ "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", - "pods": "cd ios && pod install --repo-update", + "pods": "pod-install --repo-update", "lint": "eslint .", "start": "react-native start", "build:android": "yarn detox build --configuration android.emu.debug", @@ -17,7 +17,9 @@ "ios:deeplink": "xcrun simctl openurl booted segmentreactnative://hello", "android:emulator": "./android/device_setup.sh", "clean": "yarn clean:ios && rimraf node_modules", - "clean:ios": "rimraf ios/build ios/Pods" + "clean:ios": "rimraf ios/build ios/Pods", + "e2e:ios": "concurrently \"yarn start:e2e\" \"yarn test:ios\"", + "e2e:android": "concurrently \"yarn start:e2e\" \"yarn test:android\"" }, "dependencies": { "@react-native-async-storage/async-storage": "^1.0", @@ -45,12 +47,14 @@ "babel-jest": "^29.2.1", "babel-plugin-module-resolver": "^5.0.0", "body-parser": "^1.20.0", + "concurrently": "^8.2.2", "detox": "^20.13.5", "eslint": "^8.19.0", "express": "^4.17.1", "jest": "^29.7.0", "jest-circus": "^29.3.1", "metro-react-native-babel-preset": "0.76.8", + "pod-install": "^0.1.39", "prettier": "^2.4.1", "react-test-renderer": "18.2.0", "rimraf": "^3.0.2", diff --git a/examples/AnalyticsReactNativeExample/yarn.lock b/examples/AnalyticsReactNativeExample/yarn.lock index 17b814c5..54fb2774 100644 --- a/examples/AnalyticsReactNativeExample/yarn.lock +++ b/examples/AnalyticsReactNativeExample/yarn.lock @@ -1590,6 +1590,15 @@ __metadata: languageName: node linkType: hard +"@babel/runtime@npm:^7.21.0": + version: 7.23.5 + resolution: "@babel/runtime@npm:7.23.5" + dependencies: + regenerator-runtime: "npm:^0.14.0" + checksum: ca679cc91bb7e424bc2db87bb58cc3b06ade916b9adb21fbbdc43e54cdaacb3eea201ceba2a0464b11d2eb65b9fe6a6ffcf4d7521fa52994f19be96f1af14788 + languageName: node + linkType: hard + "@babel/template@npm:^7.0.0, @babel/template@npm:^7.22.15, @babel/template@npm:^7.3.3": version: 7.22.15 resolution: "@babel/template@npm:7.22.15" @@ -2927,12 +2936,14 @@ __metadata: babel-jest: "npm:^29.2.1" babel-plugin-module-resolver: "npm:^5.0.0" body-parser: "npm:^1.20.0" + concurrently: "npm:^8.2.2" detox: "npm:^20.13.5" eslint: "npm:^8.19.0" express: "npm:^4.17.1" jest: "npm:^29.7.0" jest-circus: "npm:^29.3.1" metro-react-native-babel-preset: "npm:0.76.8" + pod-install: "npm:^0.1.39" prettier: "npm:^2.4.1" react: "npm:18.2.0" react-native: "npm:0.72.7" @@ -4040,6 +4051,26 @@ __metadata: languageName: node linkType: hard +"concurrently@npm:^8.2.2": + version: 8.2.2 + resolution: "concurrently@npm:8.2.2" + dependencies: + chalk: "npm:^4.1.2" + date-fns: "npm:^2.30.0" + lodash: "npm:^4.17.21" + rxjs: "npm:^7.8.1" + shell-quote: "npm:^1.8.1" + spawn-command: "npm:0.0.2" + supports-color: "npm:^8.1.1" + tree-kill: "npm:^1.2.2" + yargs: "npm:^17.7.2" + bin: + conc: dist/bin/concurrently.js + concurrently: dist/bin/concurrently.js + checksum: 0e9683196fe9c071d944345d21d8f34aa6c0cc50c0dd897e95619f2f1c9eb4871dca851b2569da17888235b7335b4c821ca19deed35bebcd9a131ee5d247f34c + languageName: node + linkType: hard + "connect@npm:^3.6.5": version: 3.7.0 resolution: "connect@npm:3.7.0" @@ -4162,6 +4193,15 @@ __metadata: languageName: node linkType: hard +"date-fns@npm:^2.30.0": + version: 2.30.0 + resolution: "date-fns@npm:2.30.0" + dependencies: + "@babel/runtime": "npm:^7.21.0" + checksum: e4b521fbf22bc8c3db332bbfb7b094fd3e7627de0259a9d17c7551e2d2702608a7307a449206065916538e384f37b181565447ce2637ae09828427aed9cb5581 + languageName: node + linkType: hard + "dayjs@npm:^1.8.15": version: 1.11.10 resolution: "dayjs@npm:1.11.10" @@ -8406,6 +8446,15 @@ __metadata: languageName: node linkType: hard +"pod-install@npm:^0.1.39": + version: 0.1.39 + resolution: "pod-install@npm:0.1.39" + bin: + pod-install: build/index.js + checksum: fc5d88a13b6bd58cb9c6336ae0d068f5b7c54d8449f649dd080672583caf701f48bce49a878705ef166b879aaa0068f0a1782061f4cb85c67fff7008dd4ae5fd + languageName: node + linkType: hard + "prelude-ls@npm:^1.2.1": version: 1.2.1 resolution: "prelude-ls@npm:1.2.1" @@ -9121,6 +9170,15 @@ __metadata: languageName: node linkType: hard +"rxjs@npm:^7.8.1": + version: 7.8.1 + resolution: "rxjs@npm:7.8.1" + dependencies: + tslib: "npm:^2.1.0" + checksum: 3c49c1ecd66170b175c9cacf5cef67f8914dcbc7cd0162855538d365c83fea631167cacb644b3ce533b2ea0e9a4d0b12175186985f89d75abe73dbd8f7f06f68 + languageName: node + linkType: hard + "safe-array-concat@npm:^1.0.1": version: 1.0.1 resolution: "safe-array-concat@npm:1.0.1" @@ -9339,7 +9397,7 @@ __metadata: languageName: node linkType: hard -"shell-quote@npm:^1.6.1, shell-quote@npm:^1.7.2, shell-quote@npm:^1.7.3": +"shell-quote@npm:^1.6.1, shell-quote@npm:^1.7.2, shell-quote@npm:^1.7.3, shell-quote@npm:^1.8.1": version: 1.8.1 resolution: "shell-quote@npm:1.8.1" checksum: 8cec6fd827bad74d0a49347057d40dfea1e01f12a6123bf82c4649f3ef152fc2bc6d6176e6376bffcd205d9d0ccb4f1f9acae889384d20baff92186f01ea455a @@ -9474,6 +9532,13 @@ __metadata: languageName: node linkType: hard +"spawn-command@npm:0.0.2": + version: 0.0.2 + resolution: "spawn-command@npm:0.0.2" + checksum: b22f2d71239e6e628a400831861ba747750bbb40c0a53323754cf7b84330b73d81e40ff1f9055e6d1971818679510208a9302e13d9ff3b32feb67e74d7a1b3ef + languageName: node + linkType: hard + "split-on-first@npm:^1.0.0": version: 1.1.0 resolution: "split-on-first@npm:1.1.0" @@ -9746,7 +9811,7 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:^8.0.0": +"supports-color@npm:^8.0.0, supports-color@npm:^8.1.1": version: 8.1.1 resolution: "supports-color@npm:8.1.1" dependencies: @@ -9906,6 +9971,15 @@ __metadata: languageName: node linkType: hard +"tree-kill@npm:^1.2.2": + version: 1.2.2 + resolution: "tree-kill@npm:1.2.2" + bin: + tree-kill: cli.js + checksum: 7b1b7c7f17608a8f8d20a162e7957ac1ef6cd1636db1aba92f4e072dc31818c2ff0efac1e3d91064ede67ed5dc57c565420531a8134090a12ac10cf792ab14d2 + languageName: node + linkType: hard + "truncate-utf8-bytes@npm:^1.0.0": version: 1.0.2 resolution: "truncate-utf8-bytes@npm:1.0.2" @@ -9955,7 +10029,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.0.1": +"tslib@npm:^2.0.1, tslib@npm:^2.1.0": version: 2.6.2 resolution: "tslib@npm:2.6.2" checksum: e03a8a4271152c8b26604ed45535954c0a45296e32445b4b87f8a5abdb2421f40b59b4ca437c4346af0f28179780d604094eb64546bee2019d903d01c6c19bdb @@ -10613,7 +10687,7 @@ __metadata: languageName: node linkType: hard -"yargs@npm:^17.0.0, yargs@npm:^17.3.1, yargs@npm:^17.6.2": +"yargs@npm:^17.0.0, yargs@npm:^17.3.1, yargs@npm:^17.6.2, yargs@npm:^17.7.2": version: 17.7.2 resolution: "yargs@npm:17.7.2" dependencies: