build: free up space on macOS VM in background (#24607)

This commit is contained in:
Samuel Attard 2020-07-16 14:20:42 -07:00 committed by GitHub
parent 3806f4cb64
commit 14bbc07f1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -312,17 +312,23 @@ step-get-more-space-on-mac: &step-get-more-space-on-mac
name: Free up space on MacOS name: Free up space on MacOS
command: | command: |
if [ "`uname`" == "Darwin" ]; then if [ "`uname`" == "Darwin" ]; then
sudo rm -rf /Library/Developer/CoreSimulator sudo mkdir -p $TMPDIR/del-target
sudo rm -rf $(xcode-select -p)/Platforms/AppleTVOS.platform tmpify() {
sudo rm -rf $(xcode-select -p)/Platforms/iPhoneOS.platform sudo mv $1 $TMPDIR/del-target/$(echo $1|shasum -a 256|head -n1|cut -d " " -f1)
sudo rm -rf $(xcode-select -p)/Platforms/WatchOS.platform }
sudo rm -rf $(xcode-select -p)/Platforms/WatchSimulator.platform tmpify /Library/Developer/CoreSimulator
sudo rm -rf $(xcode-select -p)/Platforms/AppleTVSimulator.platform tmpify $(xcode-select -p)/Platforms/AppleTVOS.platform
sudo rm -rf $(xcode-select -p)/Platforms/iPhoneSimulator.platform tmpify $(xcode-select -p)/Platforms/iPhoneOS.platform
sudo rm -rf ~/.rubies tmpify $(xcode-select -p)/Platforms/WatchOS.platform
sudo rm -rf ~/Library/Caches/Homebrew tmpify $(xcode-select -p)/Platforms/WatchSimulator.platform
sudo rm -rf /usr/local/Homebrew tmpify $(xcode-select -p)/Platforms/AppleTVSimulator.platform
tmpify $(xcode-select -p)/Platforms/iPhoneSimulator.platform
tmpify ~/.rubies
tmpify ~/Library/Caches/Homebrew
tmpify /usr/local/Homebrew
sudo rm -rf $TMPDIR/del-target
fi fi
background: true
# On macOS delete all .git directories under src/ expect for # On macOS delete all .git directories under src/ expect for
# third_party/angle/ because of build time generation of file # third_party/angle/ because of build time generation of file