Update Travis CI configuration.
authorLei Zhang <antiagainst@google.com>
Thu, 12 Jan 2017 19:15:36 +0000 (14:15 -0500)
committerLei Zhang <antiagainst@google.com>
Fri, 13 Jan 2017 14:53:16 +0000 (09:53 -0500)
* Stop updating brew.
* Shadow clone of dependencies.
* Fix `nproc` on macOS.

.travis.yml

index 67091ac..9a14b87 100644 (file)
@@ -7,8 +7,8 @@ os:
   - osx
 
 # Use Ubuntu 14.04 LTS (Trusty) as the Linux testing environment.
-sudo: required
 dist: trusty
+sudo: required
 
 # Use the default Xcode environment for Xcode.
 
@@ -28,7 +28,7 @@ matrix:
     # Additional build using Android NDK
     - env: BUILD_NDK=ON
   exclude:
-    # Skip GCC builds on Mac OS X.
+    # Skip GCC builds on macOS.
     - os: osx
       compiler: gcc
 
@@ -45,8 +45,8 @@ addons:
       - ninja-build
 
 before_install:
-  # Install cmake & ninja on Mac OS X.
-  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew install ninja; fi
+  # Install cmake & ninja on macOS.
+  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ninja; fi
   - if [[ "$BUILD_NDK" == "ON" ]]; then
       git clone --depth=1 https://github.com/urho3d/android-ndk.git $HOME/android-ndk;
       export ANDROID_NDK=$HOME/android-ndk;
@@ -55,8 +55,8 @@ before_install:
     fi
 
 before_script:
-  - git clone https://github.com/KhronosGroup/SPIRV-Headers.git external/spirv-headers
-  - git clone https://github.com/google/googletest.git external/googletest
+  - git clone --depth=1 https://github.com/KhronosGroup/SPIRV-Headers external/spirv-headers
+  - git clone --depth=1 https://github.com/google/googletest          external/googletest
 
 script:
   - mkdir build && cd build
@@ -71,7 +71,12 @@ script:
       cmake -GNinja -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ..;
     fi
   - ninja
-  - if [[ "$BUILD_NDK" != "ON" ]]; then ctest -j`nproc` --output_on_failure; fi
+  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
+      export NPROC=`nproc`;
+    else
+      export NPROC=`sysctl -n hw.ncpu`;
+    fi
+  - if [[ "$BUILD_NDK" != "ON" ]]; then ctest -j${NPROC} --output_on_failure; fi
 
 
 notifications: