Explorar el Código

Merge pull request #178 from MrMage/run-travis-on-macos

Add support for running CI on macOS as well
Tim Burks hace 7 años
padre
commit
a964f79f0c
Se han modificado 2 ficheros con 17 adiciones y 7 borrados
  1. 11 7
      .travis-install.sh
  2. 6 0
      .travis.yml

+ 11 - 7
.travis-install.sh

@@ -16,7 +16,7 @@
 #
 
 #
-# Install dependencies that aren't available as Ubuntu packages.
+# Install dependencies that aren't available as Ubuntu packages (or already present on macOS).
 #
 # Everything goes into $HOME/local. 
 #
@@ -28,15 +28,19 @@
 cd
 mkdir -p local
 
+if [ $TRAVIS_OS_NAME == "osx" ]; then
+  PROTOC_URL=https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-osx-x86_64.zip
+else
+  # Install swift
+  SWIFT_URL=https://swift.org/builds/swift-4.0.3-release/ubuntu1404/swift-4.0.3-RELEASE/swift-4.0.3-RELEASE-ubuntu14.04.tar.gz
+  echo $SWIFT_URL
+  curl -fSsL $SWIFT_URL -o swift.tar.gz 
+  tar -xzf swift.tar.gz --strip-components=2 --directory=local
 
-# Install swift
-SWIFT_URL=https://swift.org/builds/swift-4.0.3-release/ubuntu1404/swift-4.0.3-RELEASE/swift-4.0.3-RELEASE-ubuntu14.04.tar.gz
-echo $SWIFT_URL
-curl -fSsL $SWIFT_URL -o swift.tar.gz 
-tar -xzf swift.tar.gz --strip-components=2 --directory=local
+  PROTOC_URL=https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip
+fi
 
 # Install protoc
-PROTOC_URL=https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip
 echo $PROTOC_URL
 curl -fSsL $PROTOC_URL -o protoc.zip
 unzip protoc.zip -d local

+ 6 - 0
.travis.yml

@@ -15,9 +15,15 @@
 #
 # Travis CI build file for Swift gRPC.
 
+os:
+  - linux
+  - osx
+
 # Use Ubuntu 14.04
 dist: trusty
 
+osx_image: xcode9
+
 sudo: false
 
 addons: