.travis.yml 2.6 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. - RUN_TESTS_ARGS="--no-unittests" 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 ubuntu-armhf.txt --cross linux-mingw-w64-64bit.txt"
  30. - os: linux
  31. compiler: gcc
  32. env: RUN_TESTS_ARGS="--cross ubuntu-armhf.txt --cross linux-mingw-w64-64bit.txt" 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 ldc llvm ninja; 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. - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker pull jpakkane/mesonci:eoan; fi
  40. # We need to copy the current checkout inside the Docker container,
  41. # because it has the MR id to be tested checked out.
  42. script:
  43. - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo FROM jpakkane/mesonci:eoan > Dockerfile; fi
  44. - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo ADD . /root >> Dockerfile; fi
  45. - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker build -t withgit .; fi
  46. - |
  47. if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
  48. ci_env=`bash <(curl -s https://codecov.io/env)`
  49. docker run --security-opt seccomp:unconfined $ci_env -v ${PWD}/.coverage:/root/.coverage \
  50. withgit \
  51. /bin/sh -c "cd /root && mkdir -p tools; wget -c https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-linux.zip -O /root/tools/ninja.zip; unzip -d /root/tools /root/tools/ninja.zip; chmod +x /root/tools/ninja; CC=$CC CXX=$CXX OBJC=$CC OBJCXX=$CXX PATH=/root/tools:$PATH ./run_tests.py $RUN_TESTS_ARGS -- $MESON_ARGS && chmod -R a+rwX .coverage"
  52. fi
  53. # Ensure that llvm is added after $PATH, otherwise the clang from that llvm install will be used instead of the native apple clang.
  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:$(brew --prefix llvm)/bin ./run_tests.py $RUN_TESTS_ARGS --backend=ninja -- $MESON_ARGS ; fi