setup_check.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  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 https://raw.githubusercontent.com/Homebrew/homebrew-core/e3496d9/Formula/clang-format.rb
  20. brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/7963c3d/Formula/swiftformat.rb
  21. pip install flake8
  22. # Using actions/checkout@v2 creates a shallow clone that's missing the master
  23. # branch. If it's not present, add it.
  24. if ! git rev-parse origin/master >& /dev/null; then
  25. git remote set-branches --add origin master
  26. git fetch origin
  27. fi