Skip to content

Commit 099e27a

Browse files
authored
Fix LLVM space issues (#1035)
Clearing space by mounting host to container volume and clearing unused files
1 parent b4065be commit 099e27a

File tree

1 file changed

+43
-4
lines changed

1 file changed

+43
-4
lines changed

.github/workflows/vcpkg_ci_amd64.yml

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,22 @@ jobs:
4848

4949
container:
5050
image: docker.pkg.github.com/lifting-bits/cxx-common/vcpkg-builder-${{ matrix.image.name }}:${{ matrix.image.tag }}
51+
volumes:
52+
- /:/gha-runner
5153
credentials:
5254
username: ${{ github.actor }}
5355
password: ${{ secrets.GITHUB_TOKEN }}
5456

5557
name: ${{matrix.image.os}}-${{matrix.image.tag}} ${{matrix.llvm}} ${{matrix.target_arch}}
5658
runs-on: ubuntu-latest # run the job on the newly created runner
5759
steps:
60+
- name: Free Disk Space
61+
run: |
62+
df -h
63+
rm -rf /gha-runner/usr/local/lib/android
64+
rm -rf /gha-runner/usr/local/share/boost
65+
df -h
66+
5867
- name: Set Artifact Name
5968
run: |
6069
# Need to fix because paths with brackets cause issues
@@ -117,16 +126,33 @@ jobs:
117126
-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \
118127
"${{ secrets.GITHUB_TOKEN }}"
119128
129+
./build_dependencies.sh --release --target-arch ${{ matrix.target_arch }} --export-dir ./${{ env.ARTIFACT_NAME }} --clean-after-build --debug
130+
131+
rm -rf vcpkg/downloads
132+
rm -rf ~/.nuget/packages
133+
echo "Check space..."
134+
df -h
135+
echo "DONE."
136+
120137
./build_dependencies.sh --release --target-arch ${{ matrix.target_arch }} --export-dir ./${{ env.ARTIFACT_NAME }} ${{ matrix.llvm }} --clean-after-build --debug
121138
122139
echo "VCPKG_ROOT=$(pwd)/${{ env.ARTIFACT_NAME }}" >> $GITHUB_ENV
123140
echo "TARGET_TRIPLET=${{ matrix.target_arch }}-linux-rel" >> $GITHUB_ENV
124141
125-
- name: Cleanup NuGet
126-
shell: 'bash'
142+
- name: Check space
143+
if: failure()
127144
run: |
128-
du -sh ~/.nuget || true
129-
rm -rf ~/.nuget || true
145+
echo "## Space left"
146+
df -h
147+
echo ""
148+
echo "## Storage in working directory"
149+
du -hs *
150+
echo ""
151+
echo "## Storage in vcpkg"
152+
du -hs vcpkg/*
153+
echo ""
154+
echo "## Storage in nuget"
155+
du -hs ~/.nuget/*
130156
131157
- name: Upload CMake logs on error
132158
if: failure()
@@ -135,6 +161,19 @@ jobs:
135161
name: ${{ env.ARTIFACT_NAME }}_logs
136162
path: ${{ github.workspace }}/vcpkg/buildtrees/**/*.log
137163

164+
- name: Cleanup
165+
shell: 'bash'
166+
run: |
167+
echo "Space left"
168+
df -h
169+
170+
echo "Cleaning up..."
171+
rm -rf vcpkg || true
172+
rm -rf ~/.nuget || true
173+
174+
echo "Space left"
175+
df -h
176+
138177
- name: 'Export Packages'
139178
if: contains(env.COMMIT_MESSAGE, 'debug artifacts') || github.event.release
140179
shell: 'bash'

0 commit comments

Comments
 (0)