Ver código fonte

travis tests and checking java version

Daniel Zlotin 7 anos atrás
pai
commit
e8dfd89255
5 arquivos alterados com 30 adições e 18 exclusões
  1. 10
    15
      .travis.yml
  2. 2
    2
      package.json
  3. 0
    1
      scripts/ci.js
  4. 10
    0
      scripts/test.android.js
  5. 8
    0
      scripts/test.ios.js

+ 10
- 15
.travis.yml Ver arquivo

@@ -1,4 +1,3 @@
1
-language: objective-c
2 1
 os: osx
3 2
 osx_image: xcode8.1
4 3
 
@@ -8,9 +7,7 @@ env:
8 7
     - PATH=$PATH:$HOME/.yarn/bin
9 8
     - ANDROID_HOME=$HOME/android-sdk-macosx
10 9
     - PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
11
-
12
-git:
13
-  depth: 10
10
+    - YARN_CACHE=$HOME/.yarn-cache
14 11
 
15 12
 branches:
16 13
   only:
@@ -19,37 +16,35 @@ branches:
19 16
 
20 17
 cache:
21 18
   directories:
22
-    - $HOME/.yarn-cache
19
+    - $YARN_CACHE
23 20
     - $HOME/.gradle/
24 21
     - $HOME/.m2
25 22
     - $ANDROID_HOME/licenses/
26
-
27 23
 before_cache:
28 24
   - rm -rf $HOME/.gradle/caches/modules-2/modules-2.lock
29 25
   - rm -rf $HOME/.gradle/caches/*/plugin-resolution/
30 26
 
31
-before_install:
32
-  - brew update
33
-  - brew cask install java
27
+install:
28
+  - java -version
34 29
   - nvm install $NODE_VERSION
35 30
   - curl -o- -L https://yarnpkg.com/install.sh | bash
36
-  - yarn config set cache-folder $HOME/.yarn-cache
31
+  - yarn config set cache-folder $YARN_CACHE
37 32
 
38
-install:
39
-  - set -e
40
-  - yarn install
41 33
 
42 34
 script:
35
+  - set -e
36
+  - yarn install
43 37
   - yarn run lint
44 38
   - yarn run test-js
45
-  - ./scripts/installAndroidSDK.sh
46 39
   - yarn run test-android
40
+  #- yarn run test-ios
47 41
   - yarn run release
42
+  - set +e
48 43
 
49 44
 after_script:
50
-  - set +e
51 45
   - echo "BUILD FINISHED"
52 46
 
53 47
 notifications:
48
+  email: false
54 49
   slack:
55 50
     secure: SjvEQzfbIer3I88UARe7vlARAFkbCRuosrf2EhsUih17SKtpFuFj8BB+0U89xSxt8QmS4KiuIhj67TOGWnM7GDhy0S0rZCxgYD3VU2zm7cTobWueFvZ0zLFkTqa/8xi9+sZ5Xd1OU4aHGgpfONe34O9qbRP61YR5haJYYFWqVUQb0j6Z60MnvSm2kJJkjPx8iuOTiKoEgfZV3qVziKAN9oKVZsSUpp72cYQJeieKEdSwIBYTFt/G4RuxPxQ5uvGih3qTZBls66P3rydSHR73VbkXSi7edDhPYAhPEKMPidC/nN4UqHJNaGB9ua65LHlOXX7/K/frC/D5//WNnVLOuXHL7AXPZRKQsHwTdA2vjDT2NKvQfPBRVp47tEpQdTa7BHcLjhhJgpPoOVWumjoiD98JToI8Hd23V9OCAFYEkVe14Sr7HFWIm49PoxP6w89aGuYVLY39OJ9SmUbktOY1RYeXrp8sUa/wAxoH1u+W344zVrvAuknd0nx33iycwkKSnPDMGUOviN21XbYqQTLn5ob9rxsNBr/tAkXo9HTcZYqAJZZXX9lIUjEvZ1CU+xv1fxH4zfDWct/U5V6kKsv8pYpLqdZMaR/az02hfxD+tbQaoh1dl9KY5z8PYTMZW9SLqEpcSBevKo+JRyKpMok8Pld8RvtCUarfcHduSmzBAJE=

+ 2
- 2
package.json Ver arquivo

@@ -28,8 +28,8 @@
28 28
     "build": ":",
29 29
     "lint": "eslint src",
30 30
     "test-js": "BABEL_ENV=test jest --coverage",
31
-    "test-android": "cd android && ./gradlew clean testDebugUnitTest",
32
-    "test-ios": ":",
31
+    "test-android": "node ./scripts/test.android.js",
32
+    "test-ios": "node ./scripts/test.ios.js",
33 33
     "test": "npm run lint && npm run test-js && npm run test-android && npm run test-ios",
34 34
     "test-watch": "BABEL_ENV=test jest --coverage --watch",
35 35
     "release": "node ./scripts/release.js"

+ 0
- 1
scripts/ci.js Ver arquivo

@@ -1 +0,0 @@
1
-

+ 10
- 0
scripts/test.android.js Ver arquivo

@@ -0,0 +1,10 @@
1
+const exec = require('shell-utils').exec;
2
+
3
+function run() {
4
+  if (process.env.TRAVIS) {
5
+    exec.execSync(`./scripts/installAndroidSDK.sh`);
6
+  }
7
+  exec.execSync(`cd android && ./gradlew clean testDebugUnitTest`);
8
+}
9
+
10
+run();

+ 8
- 0
scripts/test.ios.js Ver arquivo

@@ -0,0 +1,8 @@
1
+const exec = require('shell-utils').exec;
2
+
3
+function run() {
4
+  process.chdir('./playground');
5
+  process.chdir('../');
6
+}
7
+
8
+run();