grpc_build_submodule_at_head.sh 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/bash
  2. # Copyright 2017 gRPC authors.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. # Build portability tests with an updated submodule
  16. set -ex
  17. # change to grpc repo root
  18. cd $(dirname $0)/../../..
  19. source tools/internal_ci/helper_scripts/prepare_build_linux_rc
  20. # Submodule name is passed as the RUN_TESTS_FLAGS variable
  21. SUBMODULE_NAME="${RUN_TESTS_FLAGS}"
  22. # Name of branch to checkout is passed as BAZEL_FLAGS variable
  23. # If unset, "master" is used by default.
  24. SUBMODULE_BRANCH_NAME="${BAZEL_FLAGS:-master}"
  25. # Update submodule to be tested at HEAD
  26. (cd "third_party/${SUBMODULE_NAME}" && git fetch origin && git checkout "origin/${SUBMODULE_BRANCH_NAME}")
  27. echo "This suite tests whether gRPC HEAD builds with HEAD of submodule '${SUBMODULE_NAME}'"
  28. echo "If a test breaks, either"
  29. echo "1) some change in the grpc repository has caused the failure"
  30. echo "2) some change that was just merged in the submodule head has caused the failure."
  31. echo ""
  32. echo "submodule '${SUBMODULE_NAME}' is at commit: $(cd third_party/${SUBMODULE_NAME}; git rev-parse --verify HEAD)"
  33. if [ "${SUBMODULE_NAME}" == "abseil-cpp" ]
  34. then
  35. src/abseil-cpp/preprocessed_builds.yaml.gen.py
  36. fi
  37. tools/buildgen/generate_projects.sh
  38. if [ "${SUBMODULE_NAME}" == "protobuf" ]
  39. then
  40. tools/distrib/python/make_grpcio_tools.py
  41. fi
  42. # commit so that changes are passed to Docker
  43. git -c user.name='foo' -c user.email='foo@google.com' commit -a -m 'Update submodule' --allow-empty
  44. tools/run_tests/run_tests_matrix.py -f linux --inner_jobs 8 -j 4 --internal_ci --build_only