summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2018-05-29 21:54:25 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2018-05-29 23:09:39 +0100
commit02a5e55f21273c234ae1b1a86af5f144c1083538 (patch)
treeff2a11fbc3029f76a6b91228f867be239461777e
parent8c3d37118752075ea84eb51772093eaad3dd7ba5 (diff)
downloadlibepoxy-02a5e55f21273c234ae1b1a86af5f144c1083538.tar.gz
ci: Enable builds on macOS
Use Travis's macOS builder to check if Epoxy is building on that platform.
-rw-r--r--.travis.yml28
-rwxr-xr-x.travis/epoxy-ci-linux.sh (renamed from .travis/epoxy-run-tests.sh)0
-rwxr-xr-x.travis/epoxy-ci-osx.sh19
3 files changed, 42 insertions, 5 deletions
diff --git a/.travis.yml b/.travis.yml
index d845310..52c043e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,6 +7,7 @@ branches:
os:
- linux
+ - osx
compiler:
- gcc
@@ -18,13 +19,29 @@ language:
services:
- docker
+matrix:
+ exclude:
+ - os: osx
+ compiler: gcc
+
before_install:
- - docker pull ebassi/epoxyci
+ - |
+ if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
+ brew update
+ brew install python@3 meson
+ # Use a Ninja with QuLogic's patch: https://github.com/ninja-build/ninja/issues/1219
+ mkdir -p $HOME/tools; curl -L http://nirbheek.in/files/binaries/ninja/macos/ninja -o $HOME/tools/ninja; chmod +x $HOME/tools/ninja
+ fi
+ - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker pull ebassi/epoxyci ; fi
before_script:
- - echo FROM ebassi/epoxyci > Dockerfile
- - echo ADD . /root >> Dockerfile
- - docker build -t withgit .
+ - |
+ if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
+ echo FROM ebassi/epoxyci > Dockerfile
+ echo ADD . /root >> Dockerfile
+ echo WORKDIR /root >> Dockerfile
+ docker build -t withgit .
+ fi
env:
- BUILD_OPTS=""
@@ -33,4 +50,5 @@ env:
- BUILD_OPTS="-Dx11=false"
script:
- - docker run withgit /bin/sh -c "CC=$CC ./epoxy-run-tests.sh $BUILD_OPTS"
+ - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker run withgit /bin/sh -c "CC=$CC .travis/epoxy-ci-linux.sh $BUILD_OPTS" ; fi
+ - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then /bin/sh -c "CC=$CC .travis/epoxy-ci-osx.sh $BUILD_OPTS" ; fi
diff --git a/.travis/epoxy-run-tests.sh b/.travis/epoxy-ci-linux.sh
index 52f01ea..52f01ea 100755
--- a/.travis/epoxy-run-tests.sh
+++ b/.travis/epoxy-ci-linux.sh
diff --git a/.travis/epoxy-ci-osx.sh b/.travis/epoxy-ci-osx.sh
new file mode 100755
index 0000000..3e4021d
--- /dev/null
+++ b/.travis/epoxy-ci-osx.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+export SDKROOT=$( xcodebuild -version -sdk macosx Path )
+export CPPFLAGS=-I/usr/local/include
+export LDFLAGS=-L/usr/local/lib
+export OBJC=$CC
+export PATH=$HOME/tools:$PATH
+
+srcdir=$( pwd )
+builddir=$( mktemp -d build_XXXXXX )
+
+meson ${BUILDOPTS} $builddir $srcdir || exit $?
+
+cd $builddir
+ninja || exit $?
+meson test || exit $?
+cd ..
+
+rm -rf $builddir