Merge pull request #2377 from libgit2/cmn/dual-os travis: build on osx too
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
diff --git a/.travis.yml b/.travis.yml
index fcae726..bab02bb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,6 +3,10 @@
language: c
+os:
+ - linux
+ - osx
+
compiler:
- gcc
- clang
@@ -17,17 +21,21 @@ env:
matrix:
fast_finish: true
+ exclude:
+ - os: osx
+ compiler: gcc
include:
- compiler: i586-mingw32msvc-gcc
env: OPTIONS="-DBUILD_CLAR=OFF -DWIN32=ON -DMINGW=ON -DUSE_SSH=OFF"
+ os: linux
- compiler: gcc
env: COVERITY=1
+ os: linux
allow_failures:
- env: COVERITY=1
install:
- - sudo apt-get -qq update
- - sudo apt-get -qq install cmake libssh2-1-dev openssh-client openssh-server
+ - ./script/install-deps-${TRAVIS_OS_NAME}.sh
# Run the Build script and tests
script:
@@ -35,8 +43,8 @@ script:
# Run Tests
after_success:
- - sudo apt-get -qq install valgrind
- - valgrind --leak-check=full --show-reachable=yes --suppressions=./libgit2_clar.supp _build/libgit2_clar -ionline
+ - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get -qq install valgrind; fi
+ - if [ "$TRAVIS_OS_NAME" = "linux" ]; then valgrind --leak-check=full --show-reachable=yes --suppressions=./libgit2_clar.supp _build/libgit2_clar -ionline; fi
# Only watch the development branch
branches:
diff --git a/script/install-deps-linux.sh b/script/install-deps-linux.sh
new file mode 100755
index 0000000..347922b
--- /dev/null
+++ b/script/install-deps-linux.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+set -x
+
+sudo apt-get -qq update &&
+sudo apt-get -qq install cmake libssh2-1-dev openssh-client openssh-server
diff --git a/script/install-deps-osx.sh b/script/install-deps-osx.sh
new file mode 100755
index 0000000..c2e0162
--- /dev/null
+++ b/script/install-deps-osx.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+set -x
+
+brew install libssh2 cmake