before_script.sh 987 B

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