From 099e27a9dd4afcbddba88aadd3d39c5fb3de419c Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Thu, 12 Oct 2023 15:21:13 -0400 Subject: [PATCH] Fix LLVM space issues (#1035) Clearing space by mounting host to container volume and clearing unused files --- .github/workflows/vcpkg_ci_amd64.yml | 47 +++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vcpkg_ci_amd64.yml b/.github/workflows/vcpkg_ci_amd64.yml index dadb5f9e..dd681580 100644 --- a/.github/workflows/vcpkg_ci_amd64.yml +++ b/.github/workflows/vcpkg_ci_amd64.yml @@ -48,6 +48,8 @@ jobs: container: image: docker.pkg.github.com/lifting-bits/cxx-common/vcpkg-builder-${{ matrix.image.name }}:${{ matrix.image.tag }} + volumes: + - /:/gha-runner credentials: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} @@ -55,6 +57,13 @@ jobs: name: ${{matrix.image.os}}-${{matrix.image.tag}} ${{matrix.llvm}} ${{matrix.target_arch}} runs-on: ubuntu-latest # run the job on the newly created runner steps: + - name: Free Disk Space + run: | + df -h + rm -rf /gha-runner/usr/local/lib/android + rm -rf /gha-runner/usr/local/share/boost + df -h + - name: Set Artifact Name run: | # Need to fix because paths with brackets cause issues @@ -117,16 +126,33 @@ jobs: -source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \ "${{ secrets.GITHUB_TOKEN }}" + ./build_dependencies.sh --release --target-arch ${{ matrix.target_arch }} --export-dir ./${{ env.ARTIFACT_NAME }} --clean-after-build --debug + + rm -rf vcpkg/downloads + rm -rf ~/.nuget/packages + echo "Check space..." + df -h + echo "DONE." + ./build_dependencies.sh --release --target-arch ${{ matrix.target_arch }} --export-dir ./${{ env.ARTIFACT_NAME }} ${{ matrix.llvm }} --clean-after-build --debug echo "VCPKG_ROOT=$(pwd)/${{ env.ARTIFACT_NAME }}" >> $GITHUB_ENV echo "TARGET_TRIPLET=${{ matrix.target_arch }}-linux-rel" >> $GITHUB_ENV - - name: Cleanup NuGet - shell: 'bash' + - name: Check space + if: failure() run: | - du -sh ~/.nuget || true - rm -rf ~/.nuget || true + echo "## Space left" + df -h + echo "" + echo "## Storage in working directory" + du -hs * + echo "" + echo "## Storage in vcpkg" + du -hs vcpkg/* + echo "" + echo "## Storage in nuget" + du -hs ~/.nuget/* - name: Upload CMake logs on error if: failure() @@ -135,6 +161,19 @@ jobs: name: ${{ env.ARTIFACT_NAME }}_logs path: ${{ github.workspace }}/vcpkg/buildtrees/**/*.log + - name: Cleanup + shell: 'bash' + run: | + echo "Space left" + df -h + + echo "Cleaning up..." + rm -rf vcpkg || true + rm -rf ~/.nuget || true + + echo "Space left" + df -h + - name: 'Export Packages' if: contains(env.COMMIT_MESSAGE, 'debug artifacts') || github.event.release shell: 'bash'