diff --git a/.github/actions/free-disk-space/action.yml b/.github/actions/free-disk-space/action.yml new file mode 100644 index 00000000..4bf38fe7 --- /dev/null +++ b/.github/actions/free-disk-space/action.yml @@ -0,0 +1,19 @@ +name: "Free Disk Space (Ubuntu)" +description: "A GitHub Action to free up disk space on an Ubuntu GitHub Actions runner." + +runs: + using: "composite" + steps: + - name: Installing rmz + shell: bash + run: | + curl -fsSL --tlsv1.2 --proto '=https' https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash > /dev/null 2>&1 + cargo binstall -qy rmz + ln -s ~/.cargo/bin/rmz /usr/local/bin/rmz + + - name: Freeing up disk space + shell: bash + run: | + sudo rmz -f /usr/local/lib/android || true + sudo rmz -f /usr/share/dotnet || true + sudo rmz -f /opt/ghc /usr/local/.ghcup || true diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6839dbd6..ebae2459 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -17,6 +17,10 @@ updates: directory: .github/actions/create-dev-env/ schedule: interval: weekly + - package-ecosystem: github-actions + directory: .github/actions/free-disk-space/ + schedule: + interval: weekly - package-ecosystem: github-actions directory: .github/actions/load-image/ schedule: diff --git a/.github/workflows/docker-build-test-upload.yml b/.github/workflows/docker-build-test-upload.yml index 26890a44..2401533c 100644 --- a/.github/workflows/docker-build-test-upload.yml +++ b/.github/workflows/docker-build-test-upload.yml @@ -47,21 +47,10 @@ jobs: timeout-minutes: ${{ inputs.timeout-minutes }} steps: - # Image with CUDA needs extra disk space - - name: Free disk space 🧹 - if: contains(inputs.variant, 'cuda') - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 - with: - tool-cache: false - android: true - dotnet: true - haskell: true - large-packages: false - docker-images: false - swap-storage: false - - name: Checkout Repo ⚡️ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - name: Free disk space 🧹 + uses: ./.github/actions/free-disk-space - name: Create dev environment 📦 uses: ./.github/actions/create-dev-env diff --git a/.github/workflows/docker-tag-push.yml b/.github/workflows/docker-tag-push.yml index c8ec7ec7..ed99545d 100644 --- a/.github/workflows/docker-tag-push.yml +++ b/.github/workflows/docker-tag-push.yml @@ -35,21 +35,10 @@ jobs: timeout-minutes: ${{ inputs.timeout-minutes }} steps: - # Image with CUDA needs extra disk space - - name: Free disk space 🧹 - if: contains(inputs.variant, 'cuda') - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 - with: - tool-cache: false - android: true - dotnet: true - haskell: true - large-packages: false - docker-images: false - swap-storage: false - - name: Checkout Repo ⚡️ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - name: Free disk space 🧹 + uses: ./.github/actions/free-disk-space - name: Create dev environment 📦 uses: ./.github/actions/create-dev-env