before_script.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/usr/bin/env bash
  2. set -e
  3. set -o pipefail
  4. CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  5. source "${CI_DIR}/common/build.sh"
  6. # Enable ipv6 on Travis. ref: a39c8b7ce30d
  7. if test -n "${TRAVIS_OS_NAME}" && ! test "${TRAVIS_OS_NAME}" = osx ; then
  8. echo "before_script.sh: enable ipv6"
  9. sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0
  10. fi
  11. # Test some of the configuration variables.
  12. if [[ -n "${GCOV}" ]] && [[ ! $(type -P "${GCOV}") ]]; then
  13. echo "\$GCOV: '${GCOV}' is not executable."
  14. exit 1
  15. fi
  16. if [[ -n "${LLVM_SYMBOLIZER}" ]] && [[ ! $(type -P "${LLVM_SYMBOLIZER}") ]]; then
  17. echo "\$LLVM_SYMBOLIZER: '${LLVM_SYMBOLIZER}' is not executable."
  18. exit 1
  19. fi
  20. echo "before_script.sh: ccache stats (will be cleared)"
  21. ccache -s
  22. # Reset ccache stats for real results in before_cache.
  23. ccache --zero-stats
  24. if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
  25. # Adds user to a dummy group.
  26. # That allows to test changing the group of the file by `os_fchown`.
  27. sudo dscl . -create /Groups/chown_test
  28. sudo dscl . -append /Groups/chown_test GroupMembership "${USER}"
  29. fi
  30. # Compile dependencies.
  31. build_deps
  32. # Install cluacov for Lua coverage.
  33. if [[ "$USE_LUACOV" == 1 ]]; then
  34. "${DEPS_BUILD_DIR}/usr/bin/luarocks" install cluacov
  35. fi
  36. rm -rf "${LOG_DIR}"
  37. mkdir -p "${LOG_DIR}"