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 similarity index 100% rename from .travis/epoxy-run-tests.sh rename to .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