]> granicus.if.org Git - libevent/commitdiff
travis-ci: enable multi-os mode (osx, linux)
authorAzat Khuzhin <a3at.mail@gmail.com>
Mon, 9 May 2016 15:14:31 +0000 (18:14 +0300)
committerAzat Khuzhin <a3at.mail@gmail.com>
Tue, 10 May 2016 05:29:56 +0000 (08:29 +0300)
- use addons.apt.packages instead of `apt-get install`
- add `brew update`/`brew install ...`

Link: https://docs.travis-ci.com/user/installing-dependencies/
Link: https://docs.travis-ci.com/user/multi-os/
.travis.yml

index ba951a16c38e7c4e3db3f2e7ed954f50f3f9382b..e1e72a0df489f6a8a4aa3f73a2a139d3cbdf69db 100644 (file)
@@ -1,3 +1,6 @@
+os:
+  - linux
+  - osx
 env:
   matrix:
     - EVENT_BUILD_METHOD=cmake EVENT_CMAKE_OPTIONS=""
@@ -15,12 +18,21 @@ language: c
 compiler:
   - gcc
   - clang
-install:
-  - sudo apt-get update -qq
-  - sudo apt-get install -y -qq zlib1g-dev libssl-dev build-essential automake autoconf cmake
+before_install:
+  - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update -qq; fi
+  - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi
+  - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install openssl; fi
+addons:
+  apt:
+    packages:
+      - zlib1g-dev
+      - libssl-dev
+      - build-essential
+      - automake
+      - autoconf
+      - cmake
 script:
   - if [ "$EVENT_BUILD_METHOD" = "autotools" ]; then ./autogen.sh && ./configure $EVENT_CONFIGURE_OPTIONS && make && make verify; fi
   - if [ "$EVENT_BUILD_METHOD" = "cmake" ]; then mkdir build && cd build && cmake .. $EVENT_CMAKE_OPTIONS && cmake --build . && CTEST_OUTPUT_ON_FAILURE=1 cmake --build . --target verify; fi
-
 notifications:
   irc: "irc.oftc.net#libevent"