@@ -84,11 +84,49 @@ jobs:
8484 uses : actions/checkout@v4
8585 with :
8686 path : mixxx-vcpkg
87+
88+ # The ephemeral space doesn't seem consistent between runs. Sometimes it is available directly on the root (/), sometime on the mount folder (/mnt)
89+ # If the ephemeral storage is available under a seperate drive, we bind-mount as thee `vcpkg_path`
90+ - name : Move checkout and use the ephemeral storage if available
91+ if : runner.os == 'Linux'
92+ run : |
93+ set -x
94+ if [ -d /mnt ]; then
95+ mntSpace=$(df --output=avail /mnt | tail -n 1)
96+ rootSpace=$(df --output=avail / | tail -n 1)
97+ if [ $mntSpace -gt $rootSpace ]; then
98+ mkdir ${{ matrix.vcpkg_path }}
99+ sudo mount -o bind /mnt ${{ matrix.vcpkg_path }}
100+ id
101+ sudo chown -R 1001:1001 ${{ matrix.vcpkg_path }}
102+ rsync -av ${{ github.workspace }}/mixxx-vcpkg/ ${{ matrix.vcpkg_path }}
103+ exit 0
104+ fi
105+ fi
106+ # In case we cannot use the ephemeral disk space because it either doesn't
107+ # exist or is too small, we free as much as possible on the root.
108+ sudo rm -rf /home/packer # Free up 677M
109+ sudo rm -rf /opt/az # Free up 649M
110+ sudo rm -rf /opt/google # Free up 378M
111+ sudo rm -rf /opt/hostedtoolcache/CodeQL # Free up 1.6G
112+ sudo rm -rf /opt/hostedtoolcache/go # Free up 808M
113+ sudo rm -rf /opt/hostedtoolcache/node # Free up 532M
114+ sudo rm -rf /opt/hostedtoolcache/PyPy # Free up 520M
115+ sudo rm -rf /opt/hostedtoolcache/Python # Free up 1.5G
116+ sudo rm -rf /opt/microsoft # Free up 781M
117+ sudo rm -rf /opt/pipx # Free up 499M
118+ sudo rm -rf /usr/lib/google-cloud-sdk # Free up 957M
119+ sudo rm -rf /usr/local/julia1.11.7 # Free up 996M
120+ sudo rm -rf /usr/local/share/powershell # Free up 1.3G
121+ sudo rm -rf /usr/share/dotnet # Free up 3.4G
122+ sudo rm -rf /usr/share/swift # Free up 3.2G
123+ sudo rm -rf /usr/local/share/vcpkg # Size unknown, but obvious duplicate
87124
88125 # Workaround for issues https://github.com/microsoft/vcpkg/issues/8272
89126 # and https://github.com/actions/checkout/issues/197
90127 # to keep the build path short and work around size limits on the windows runner D: drive
91128 - name : Move checkout
129+ if : runner.os != 'Linux'
92130 run : cmake -E copy_directory ${{ github.workspace }}/mixxx-vcpkg ${{ matrix.vcpkg_path }}
93131
94132 - name : " Work around actions/runner-images#9966"
@@ -123,13 +161,9 @@ jobs:
123161 mono-complete \
124162 libasound2-dev \
125163 libegl1-mesa-dev \
126- libgl1-mesa-dev \
127- libdrm-dev \
128- libgbm-dev \
129164 libghc-resolv-dev \
130165 libglu1-mesa-dev \
131166 libltdl-dev \
132- libsm-dev \
133167 libudev-dev \
134168 libx11-xcb-dev \
135169 libxi-dev \
@@ -185,35 +219,11 @@ jobs:
185219 echo "ANDROID_NDK_HOME=/usr/lib/android-sdk/ndk/${{ matrix.android_ndk }}" >> "${GITHUB_ENV}"
186220 sudo sdkmanager --list_installed
187221
188- - name : Check available disk space
189- run : ${{ matrix.check_disk_space }}
190-
191- # Remove unused pre-installed software as the runner runs out of space otherwise
192- # Currently freeing up about 17.7G, ~20%
193- - name : " [ubuntu/android] Free up disk space"
222+ - name : " [ubuntu/android] Free up APT cachd"
194223 if : runner.os == 'Linux'
195- run : |
196- df -h
197- sudo apt-get autoremove -y && sudo apt-get clean
198- sudo rm -rf /home/packer # Free up 677M
199- sudo rm -rf /opt/az # Free up 649M
200- sudo rm -rf /opt/google # Free up 378M
201- sudo rm -rf /opt/hostedtoolcache/CodeQL # Free up 1.6G
202- sudo rm -rf /opt/hostedtoolcache/go # Free up 808M
203- sudo rm -rf /opt/hostedtoolcache/node # Free up 532M
204- sudo rm -rf /opt/hostedtoolcache/PyPy # Free up 520M
205- sudo rm -rf /opt/hostedtoolcache/Python # Free up 1.5G
206- sudo rm -rf /opt/microsoft # Free up 781M
207- sudo rm -rf /opt/pipx # Free up 499M
208- sudo rm -rf /usr/lib/google-cloud-sdk # Free up 957M
209- sudo rm -rf /usr/local/julia1.11.7 # Free up 996M
210- sudo rm -rf /usr/local/share/powershell # Free up 1.3G
211- sudo rm -rf /usr/share/dotnet # Free up 3.4G
212- sudo rm -rf /usr/share/swift # Free up 3.2G
213- sudo rm -rf /usr/local/share/vcpkg # Size unknown, but obvious duplicate
224+ run : sudo apt-get autoremove -y && sudo apt-get clean
214225
215- - name : Check available disk space after cleanup
216- if : runner.os == 'Linux'
226+ - name : Check available disk space
217227 run : ${{ matrix.check_disk_space }}
218228
219229 - name : Build packages
0 commit comments