Skip to content

Commit

Permalink
Delete Xcode and iOS simulators from Mac runners to reduce out of dis…
Browse files Browse the repository at this point in the history
…k space errors
  • Loading branch information
bclark8923 committed Sep 6, 2024
1 parent 140b7cb commit 49b0ce7
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/nix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,22 @@ jobs:
remove_haskell: true
remove_tool_cache: false

- name: Delete all Xcode installations to free up disk space
if: contains(matrix.os, 'macos')
run: |
echo "Available Xcode installations:"
xcodes installed
selected_path="$(xcode-select -p)"; selected_path="${selected_path%/Contents/Developer}"
find /Applications \
-depth 1 \
-name "Xcode*.app" \
-not -path "${selected_path}" \
-exec rm -rf {} +
echo "Deleting all iOS simulators"
xcrun simctl delete all
echo "Deleting iOS Simulator caches"
sudo rm -rf ~/Library/Developer/CoreSimulator/Caches/*
- name: Cache Nix derivations
uses: >- # v4
DeterminateSystems/magic-nix-cache-action@fc6aaceb40b9845a02b91e059ec147e78d1b4e41
Expand Down Expand Up @@ -95,6 +111,22 @@ jobs:
remove_haskell: true
remove_tool_cache: false

- name: Delete all Xcode installations to free up disk space
if: contains(matrix.os, 'macos')
run: |
echo "Available Xcode installations:"
xcodes installed
selected_path="$(xcode-select -p)"; selected_path="${selected_path%/Contents/Developer}"
find /Applications \
-depth 1 \
-name "Xcode*.app" \
-not -path "${selected_path}" \
-exec rm -rf {} +
echo "Deleting all iOS simulators"
xcrun simctl delete all
echo "Deleting iOS Simulator caches"
sudo rm -rf ~/Library/Developer/CoreSimulator/Caches/*
- name: Cache Nix derivations
uses: >- # v4
DeterminateSystems/magic-nix-cache-action@fc6aaceb40b9845a02b91e059ec147e78d1b4e41
Expand Down Expand Up @@ -130,6 +162,22 @@ jobs:
remove_haskell: true
remove_tool_cache: false

- name: Delete all Xcode installations to free up disk space
if: contains(matrix.os, 'macos')
run: |
echo "Available Xcode installations:"
xcodes installed
selected_path="$(xcode-select -p)"; selected_path="${selected_path%/Contents/Developer}"
find /Applications \
-depth 1 \
-name "Xcode*.app" \
-not -path "${selected_path}" \
-exec rm -rf {} +
echo "Deleting all iOS simulators"
xcrun simctl delete all
echo "Deleting iOS Simulator caches"
sudo rm -rf ~/Library/Developer/CoreSimulator/Caches/*
- name: Cache Nix derivations
uses: >- # v4
DeterminateSystems/magic-nix-cache-action@fc6aaceb40b9845a02b91e059ec147e78d1b4e41
Expand Down

0 comments on commit 49b0ce7

Please sign in to comment.