.travis.yml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. sudo: false
  2. branches:
  3. only:
  4. - master
  5. # Release branches
  6. - /^[0-9]+\.[0-9]+$/
  7. os:
  8. - linux
  9. - osx
  10. compiler:
  11. - gcc
  12. - clang
  13. env:
  14. - MESON_ARGS=""
  15. - MESON_ARGS="--unity=on"
  16. language:
  17. - cpp
  18. services:
  19. - docker
  20. matrix:
  21. exclude:
  22. # On OS X gcc is just a wrapper around clang, so don't waste time testing that
  23. - os: osx
  24. compiler: gcc
  25. include:
  26. # Test cross builds separately, they do not use the global compiler
  27. - os: linux
  28. compiler: gcc
  29. env: RUN_TESTS_ARGS="--cross"
  30. - os: linux
  31. compiler: gcc
  32. env: RUN_TESTS_ARGS="--cross" MESON_ARGS="--unity=on"
  33. before_install:
  34. - python ./skip_ci.py --base-branch-env=TRAVIS_BRANCH --is-pull-env=TRAVIS_PULL_REQUEST
  35. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
  36. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install qt llvm; fi
  37. # # Run one macOS build without pkg-config available, and the other (unity=on) with pkg-config
  38. - if [[ "$TRAVIS_OS_NAME" == "osx" && "$MESON_ARGS" =~ .*unity=on.* ]]; then brew install pkg-config; fi
  39. # Use a Ninja with QuLogic's patch: https://github.com/ninja-build/ninja/issues/1219
  40. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mkdir -p $HOME/tools; curl -L http://nirbheek.in/files/binaries/ninja/macos/ninja -o $HOME/tools/ninja; chmod +x $HOME/tools/ninja; fi
  41. - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker pull jpakkane/mesonci:cosmic; fi
  42. # We need to copy the current checkout inside the Docker container,
  43. # because it has the MR id to be tested checked out.
  44. script:
  45. - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo FROM jpakkane/mesonci:cosmic > Dockerfile; fi
  46. - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo ADD . /root >> Dockerfile; fi
  47. - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker build -t withgit .; fi
  48. - |
  49. if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
  50. ci_env=`bash <(curl -s https://codecov.io/env)`
  51. docker run $ci_env -v ${PWD}/.coverage:/root/.coverage \
  52. withgit \
  53. /bin/sh -c "cd /root && mkdir -p tools; wget -c http://nirbheek.in/files/binaries/ninja/linux-amd64/ninja -O /root/tools/ninja; chmod +x /root/tools/ninja; CC=$CC CXX=$CXX OBJC=$CC OBJCXX=$CXX PATH=/root/tools:$PATH MESON_FIXED_NINJA=1 ./run_tests.py $RUN_TESTS_ARGS -- $MESON_ARGS && chmod -R a+rwX .coverage"
  54. fi
  55. # Ensure that llvm is added after $PATH, otherwise the clang from that llvm install will be used instead of the native apple clang.
  56. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then SDKROOT=$(xcodebuild -version -sdk macosx Path) CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib OBJC=$CC OBJCXX=$CXX PATH=$HOME/tools:/usr/local/opt/qt/bin:$PATH:$(brew --prefix llvm)/bin MESON_FIXED_NINJA=1 ./run_tests.py --backend=ninja -- $MESON_ARGS ; fi