remove unused xcode versions
Would it be possible to implement something which removes anything except the version i wanted to initialize. I created this workaround for now:
- name: Initialize latest xcode
uses: maxim-lobanov/[email protected]
with:
xcode-version: ${{ matrix.xcode }}
- name: Remove old xcode versions
run: |
echo "Searching for Xcode versions:"
find /Applications -name "Xcode_*" -maxdepth 1 -mindepth 1
echo "Removing old Xcode versions..."
find /Applications -name "Xcode_*" -maxdepth 1 -mindepth 1 | grep -v ${{ matrix.xcode }} | xargs rm -rf
echo "Available Xcode versions after removal:"
find /Applications -name "Xcode_*" -maxdepth 1 -mindepth 1
For reference https://github.com/actions/runner-images/issues/2840
+1 for this.
Lately GitHub runners have been failing due to space constraints (with no change on our part). And it seems GitHub's solution is to just delete stuff on the runner that we don't need.
Since each Mac runner has a bunch of versions of Xcode installed this would be nice.
@BrentMifsud i agree that space constraints are a issue, and this helps definitely to free up space in fact much more space than the initial 14G free space available in the runner, but i think some of the real underlying reasons are in my case for example:
github/codeql-action/[email protected] uses 3G swift-actions/[email protected] uses 10G
Which is almost all of the 14G free macos-latest runner space.
for reference https://github.com/swift-actions/setup-swift/issues/682