Преглед на файлове

Split to two detox setups

Jamon Holmgren преди 4 години
родител
ревизия
384d3b646d
променени са 4 файла, в които са добавени 41 реда и са изтрити 10 реда
  1. 3
    7
      .github/workflows/detox-android.yml
  2. 32
    0
      .github/workflows/detox-ios.yml
  3. 2
    2
      bin/detox-setup
  4. 4
    1
      package.json

.github/workflows/detox.yml → .github/workflows/detox-android.yml Целия файл

1
-name: 'Detox CI Tests'
1
+name: 'Detox CI Tests - Android'
2
 on: [push]
2
 on: [push]
3
 
3
 
4
 jobs:
4
 jobs:
5
   tests:
5
   tests:
6
-    name: 'Running tests'
6
+    name: 'Running Android detox tests'
7
     runs-on: 'macOS-latest'
7
     runs-on: 'macOS-latest'
8
     steps:
8
     steps:
9
       - name: Setup - Install Android SDK
9
       - name: Setup - Install Android SDK
22
         run: avdmanager create avd -n test -k "system-images;android-28;google_apis;x86"
22
         run: avdmanager create avd -n test -k "system-images;android-28;google_apis;x86"
23
       - name: List Android Emulators
23
       - name: List Android Emulators
24
         run: emulator -list-avds
24
         run: emulator -list-avds
25
-      - name: List iOS Simulators
26
-        run: xcrun simctl list
27
       - uses: actions/checkout@master
25
       - uses: actions/checkout@master
28
       - uses: actions/setup-node@master
26
       - uses: actions/setup-node@master
29
         with:
27
         with:
34
         run: brew install yarn --ignore-dependencies
32
         run: brew install yarn --ignore-dependencies
35
       - name: Setup - Install NPM Dependencies
33
       - name: Setup - Install NPM Dependencies
36
         run: yarn
34
         run: yarn
37
-      - name: Setup - Install CocoaPods CLI
38
-        run: sudo gem install cocoapods
39
       - name: Setup - Install Detox and deps
35
       - name: Setup - Install Detox and deps
40
         run: |
36
         run: |
41
           brew tap wix/brew
37
           brew tap wix/brew
43
           yarn global add react-native-cli
39
           yarn global add react-native-cli
44
           yarn global add detox-cli
40
           yarn global add detox-cli
45
       - name: Run tests
41
       - name: Run tests
46
-        run: yarn ci
42
+        run: yarn ci:android

+ 32
- 0
.github/workflows/detox-ios.yml Целия файл

1
+name: 'Detox CI Tests - iOS'
2
+on: [push]
3
+
4
+jobs:
5
+  tests:
6
+    name: 'Running iOS Detox tests'
7
+    runs-on: 'macOS-latest'
8
+    steps:
9
+      - uses: actions/checkout@master
10
+      - uses: actions/setup-node@master
11
+        with:
12
+          node-version: 12.6
13
+      - name: Setup - Install Homebrew
14
+        run: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
15
+      - name: Setup - Install Yarn
16
+        run: brew install yarn --ignore-dependencies
17
+      - name: Setup - Install NPM Dependencies
18
+        run: yarn
19
+      - name: Setup - Install CocoaPods CLI
20
+        run: sudo gem install cocoapods
21
+      - name: Setup - Install Detox and deps
22
+        run: |
23
+          brew tap wix/brew
24
+          brew install applesimutils
25
+          yarn global add react-native-cli
26
+          yarn global add detox-cli
27
+      - name: List iOS Simulators
28
+        run: xcrun simctl list
29
+      - name: Prepare Example App
30
+        run: yarn ci:setup
31
+      - name: Run tests
32
+        run: yarn ci:ios

bin/detox → bin/detox-setup Целия файл

17
 pod install
17
 pod install
18
 cd ..
18
 cd ..
19
 
19
 
20
-# Run tests
21
-yarn detox
20
+# Return to root
21
+cd ../..

+ 4
- 1
package.json Целия файл

11
   "version": "7.0.3",
11
   "version": "7.0.3",
12
   "homepage": "https://github.com/react-native-community/react-native-webview#readme",
12
   "homepage": "https://github.com/react-native-community/react-native-webview#readme",
13
   "scripts": {
13
   "scripts": {
14
-    "ci": "CI=true && yarn lint && yarn test && ./bin/detox",
14
+    "ci": "CI=true && yarn lint && yarn test",
15
+    "ci:setup": "./bin/detox-setup",
16
+    "ci:ios": "CI=true && cd examples/WebTest && yarn detox-ios && cd -",
17
+    "ci:android": "CI=true && cd examples/WebTest && yarn detox-android && cd -",
15
     "ci:publish": "yarn semantic-release",
18
     "ci:publish": "yarn semantic-release",
16
     "lint": "yarn tsc --noEmit && yarn eslint ./src --ext .ts,.tsx",
19
     "lint": "yarn tsc --noEmit && yarn eslint ./src --ext .ts,.tsx",
17
     "build": "yarn tsc",
20
     "build": "yarn tsc",