Skip to content

Commit 4feac59

Browse files
committed
ci: free up disk space on macOS runners by deleting unused Xcode versions
1 parent 8e5c0a2 commit 4feac59

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/integration_tests.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,12 @@ jobs:
313313
sudo xcode-select -s /Applications/Xcode_${{ env.xcodeVersion }}.app/Contents/Developer
314314
# Remove default Xcode version to prevent the wrong SDK from being used.
315315
rm -rf /Applications/Xcode.app
316+
# Free up disk space by removing unused Xcode versions
317+
for app in /Applications/Xcode_*.app; do
318+
if [ "$app" != "/Applications/Xcode_${{ env.xcodeVersion }}.app" ]; then
319+
sudo rm -rf "$app" || true
320+
fi
321+
done
316322
- name: Install Desktop SDK & integration tests prerequisites
317323
uses: nick-invision/retry@v2
318324
with:
@@ -624,6 +630,12 @@ jobs:
624630
sudo xcode-select -s /Applications/Xcode_${{ env.xcodeVersion }}.app/Contents/Developer
625631
# Remove default Xcode version to prevent the wrong SDK from being used.
626632
rm -rf /Applications/Xcode.app
633+
# Free up disk space by removing unused Xcode versions
634+
for app in /Applications/Xcode_*.app; do
635+
if [ "$app" != "/Applications/Xcode_${{ env.xcodeVersion }}.app" ]; then
636+
sudo rm -rf "$app" || true
637+
fi
638+
done
627639
- name: Install iOS SDK & integration tests prerequisites
628640
uses: nick-invision/retry@v2
629641
with:
@@ -743,6 +755,12 @@ jobs:
743755
sudo xcode-select -s /Applications/Xcode_${{ env.xcodeVersion }}.app/Contents/Developer
744756
# Remove default Xcode version to prevent the wrong SDK from being used.
745757
rm -rf /Applications/Xcode.app
758+
# Free up disk space by removing unused Xcode versions
759+
for app in /Applications/Xcode_*.app; do
760+
if [ "$app" != "/Applications/Xcode_${{ env.xcodeVersion }}.app" ]; then
761+
sudo rm -rf "$app" || true
762+
fi
763+
done
746764
- name: Install tvOS SDK & integration tests prerequisites
747765
uses: nick-invision/retry@v2
748766
with:
@@ -884,6 +902,12 @@ jobs:
884902
sudo xcode-select -s /Applications/Xcode_${{ env.xcodeVersion }}.app/Contents/Developer
885903
# Remove default Xcode version to prevent the wrong SDK from being used.
886904
rm -rf /Applications/Xcode.app
905+
# Free up disk space by removing unused Xcode versions
906+
for app in /Applications/Xcode_*.app; do
907+
if [ "$app" != "/Applications/Xcode_${{ env.xcodeVersion }}.app" ]; then
908+
sudo rm -rf "$app" || true
909+
fi
910+
done
887911
- name: Install prerequisites for testing
888912
uses: nick-invision/retry@v2
889913
with:
@@ -1157,6 +1181,12 @@ jobs:
11571181
sudo xcode-select -s /Applications/Xcode_${{ env.xcodeVersion }}.app/Contents/Developer
11581182
# Remove default Xcode version to prevent the wrong SDK from being used.
11591183
rm -rf /Applications/Xcode.app
1184+
# Free up disk space by removing unused Xcode versions
1185+
for app in /Applications/Xcode_*.app; do
1186+
if [ "$app" != "/Applications/Xcode_${{ env.xcodeVersion }}.app" ]; then
1187+
sudo rm -rf "$app" || true
1188+
fi
1189+
done
11601190
- name: Install prerequisites for testing
11611191
uses: nick-invision/retry@v2
11621192
with:
@@ -1343,6 +1373,12 @@ jobs:
13431373
sudo xcode-select -s /Applications/Xcode_${{ env.xcodeVersion }}.app/Contents/Developer
13441374
# Remove default Xcode version to prevent the wrong SDK from being used.
13451375
rm -rf /Applications/Xcode.app
1376+
# Free up disk space by removing unused Xcode versions
1377+
for app in /Applications/Xcode_*.app; do
1378+
if [ "$app" != "/Applications/Xcode_${{ env.xcodeVersion }}.app" ]; then
1379+
sudo rm -rf "$app" || true
1380+
fi
1381+
done
13461382
- name: Install prerequisites for testing
13471383
uses: nick-invision/retry@v2
13481384
with:

0 commit comments

Comments
 (0)