.travis.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. sudo: false
  2. branches:
  3. only:
  4. - master
  5. os:
  6. - linux
  7. - osx
  8. compiler:
  9. - gcc
  10. - clang
  11. env:
  12. - MESON_ARGS=""
  13. - MESON_ARGS="--unity=on"
  14. language:
  15. - cpp
  16. services:
  17. - docker
  18. matrix:
  19. exclude:
  20. # On OS X gcc is just a wrapper around clang, so don't waste time testing that
  21. - os: osx
  22. compiler: gcc
  23. before_install:
  24. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
  25. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ninja python3; fi
  26. - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker pull jpakkane/mesonci:zesty; fi
  27. - pip3 install codecov
  28. - mkdir .coverage
  29. # We need to copy the current checkout inside the Docker container,
  30. # because it has the MR id to be tested checked out.
  31. script:
  32. - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo FROM jpakkane/mesonci:zesty > Dockerfile; fi
  33. - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo ADD . /root >> Dockerfile; fi
  34. - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker build -t withgit .; fi
  35. - |
  36. if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
  37. ci_env=`bash <(curl -s https://codecov.io/env)`
  38. docker run $ci_env -v ${PWD}/.coverage:/root/.coverage \
  39. withgit \
  40. /bin/sh -c "cd /root && CC=$CC CXX=$CXX OBJC=$CC OBJCXX=$CXX ./run_tests.py --cov -- $MESON_ARGS && chmod -R a+rwX .coverage"
  41. fi
  42. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then SDKROOT=$(xcodebuild -version -sdk macosx Path) OBJC=$CC OBJCXX=$CXX ./run_tests.py --cov --backend=ninja -- $MESON_ARGS ; fi
  43. after_success:
  44. - coverage3 combine
  45. - codecov -n "${TRAVIS_OS_NAME}-${CC}-{$(echo ${MESON_ARGS} | sed -e 's/^--//g' -e 's/ --/,/g')}"