Browse Source

travis tests and checking java version

Daniel Zlotin 7 years ago
parent
commit
e8dfd89255
5 changed files with 30 additions and 18 deletions
  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 View File

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

+ 2
- 2
package.json View File

28
     "build": ":",
28
     "build": ":",
29
     "lint": "eslint src",
29
     "lint": "eslint src",
30
     "test-js": "BABEL_ENV=test jest --coverage",
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
     "test": "npm run lint && npm run test-js && npm run test-android && npm run test-ios",
33
     "test": "npm run lint && npm run test-js && npm run test-android && npm run test-ios",
34
     "test-watch": "BABEL_ENV=test jest --coverage --watch",
34
     "test-watch": "BABEL_ENV=test jest --coverage --watch",
35
     "release": "node ./scripts/release.js"
35
     "release": "node ./scripts/release.js"

+ 0
- 1
scripts/ci.js View File

1
-

+ 10
- 0
scripts/test.android.js View File

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 View File

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