.travis.yml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 uninstall python mercurial; fi
  37. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install python@2 python@3 mercurial qt pkg-config; fi
  38. # Use a Ninja with QuLogic's patch: https://github.com/ninja-build/ninja/issues/1219
  39. - 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
  40. - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker pull jpakkane/mesonci:bionic; fi
  41. # We need to copy the current checkout inside the Docker container,
  42. # because it has the MR id to be tested checked out.
  43. script:
  44. - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo FROM jpakkane/mesonci:bionic > Dockerfile; fi
  45. - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo ADD . /root >> Dockerfile; fi
  46. - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker build -t withgit .; fi
  47. - |
  48. if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
  49. ci_env=`bash <(curl -s https://codecov.io/env)`
  50. docker run $ci_env -v ${PWD}/.coverage:/root/.coverage \
  51. withgit \
  52. /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"
  53. fi
  54. - 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 MESON_FIXED_NINJA=1 ./run_tests.py --backend=ninja -- $MESON_ARGS ; fi