configure_ci_environment.sh 869 B

123456789101112131415161718192021
  1. # This file is sourced in to the CI environment
  2. # in .gitlab-ci.yml
  3. #
  4. # Sets the error behaviour options for shell throughout the CI environment
  5. #
  6. set -o errexit # Exit if command failed.
  7. set -o pipefail # Exit if pipe failed.
  8. # We can use the appropriate CI variable for debugging
  9. DEBUG_SHELL=${DEBUG_SHELL:-"0"}
  10. [ "${DEBUG_SHELL}" = "1" ] && set -x
  11. [ -z $CI_COMMIT_REF_NAME ] && echo "This internal script should only be run by a Gitlab CI runner." && exit 1
  12. # Compiler flags to thoroughly check the IDF code in some CI jobs
  13. # (Depends on default options '-Wno-error=XXX' used in the IDF build system)
  14. PEDANTIC_FLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function"
  15. export PEDANTIC_CFLAGS="${PEDANTIC_FLAGS} -Wstrict-prototypes"
  16. export PEDANTIC_CXXFLAGS="${PEDANTIC_FLAGS}"