Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unused xcode versions #84

Open
Aaron-Ritter opened this issue Sep 7, 2024 · 3 comments
Open

remove unused xcode versions #84

Aaron-Ritter opened this issue Sep 7, 2024 · 3 comments

Comments

@Aaron-Ritter
Copy link

Aaron-Ritter commented Sep 7, 2024

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/setup-xcode@v1.6.0
        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 actions/runner-images#2840

@BrentMifsud
Copy link

+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.

@Aaron-Ritter
Copy link
Author

Aaron-Ritter commented Sep 7, 2024

@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/init@v3.26.5 uses 3G
swift-actions/setup-swift@v2.1.0 uses 10G

Which is almost all of the 14G free macos-latest runner space.

@Aaron-Ritter
Copy link
Author

for reference swift-actions/setup-swift#682

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants