setup_check.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. # Copyright 2020 Google LLC
  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. # Prepares a host for running check.sh
  16. set -euo pipefail
  17. export HOMEBREW_NO_ANALYTICS=1
  18. export HOMEBREW_NO_AUTO_UPDATE=1
  19. brew install clang-format
  20. brew install swiftformat
  21. clang-format -version
  22. swiftformat -version
  23. echo "python --version: $(python --version)"
  24. pip install --upgrade pip
  25. pip install flake8
  26. pip install six
  27. # Using actions/checkout@v2 creates a shallow clone that's missing the master
  28. # branch. If it's not present, add it.
  29. if ! git rev-parse origin/master >& /dev/null; then
  30. git remote set-branches --add origin master
  31. git fetch origin
  32. fi