diff options
Diffstat (limited to 'src/ci/scripts')
| -rwxr-xr-x | src/ci/scripts/free-disk-space-linux.sh | 9 | ||||
| -rw-r--r-- | src/ci/scripts/free-disk-space-windows.ps1 | 35 | ||||
| -rwxr-xr-x | src/ci/scripts/free-disk-space.sh | 10 |
3 files changed, 6 insertions, 48 deletions
diff --git a/src/ci/scripts/free-disk-space-linux.sh b/src/ci/scripts/free-disk-space-linux.sh index 32649fe0d9b..ac3c9cfb28b 100755 --- a/src/ci/scripts/free-disk-space-linux.sh +++ b/src/ci/scripts/free-disk-space-linux.sh @@ -221,10 +221,13 @@ cleanPackages() { ) fi - sudo apt-get -qq remove -y --fix-missing "${packages[@]}" + WAIT_DPKG_LOCK="-o DPkg::Lock::Timeout=60" + sudo apt-get ${WAIT_DPKG_LOCK} -qq remove -y --fix-missing "${packages[@]}" - sudo apt-get autoremove -y || echo "::warning::The command [sudo apt-get autoremove -y] failed" - sudo apt-get clean || echo "::warning::The command [sudo apt-get clean] failed failed" + sudo apt-get ${WAIT_DPKG_LOCK} autoremove -y \ + || echo "::warning::The command [sudo apt-get autoremove -y] failed" + sudo apt-get ${WAIT_DPKG_LOCK} clean \ + || echo "::warning::The command [sudo apt-get clean] failed" } # Remove Docker images. diff --git a/src/ci/scripts/free-disk-space-windows.ps1 b/src/ci/scripts/free-disk-space-windows.ps1 deleted file mode 100644 index 8a4677bd2ab..00000000000 --- a/src/ci/scripts/free-disk-space-windows.ps1 +++ /dev/null @@ -1,35 +0,0 @@ -# Free disk space on Windows GitHub action runners. - -$ErrorActionPreference = 'Stop' - -Get-Volume | Out-String | Write-Output - -$available = $(Get-Volume C).SizeRemaining - -$dirs = 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\Llvm', -'C:\rtools45', 'C:\ghcup', 'C:\Program Files (x86)\Android', -'C:\Program Files\Google\Chrome', 'C:\Program Files (x86)\Microsoft\Edge', -'C:\Program Files\Mozilla Firefox', 'C:\Program Files\MySQL', 'C:\Julia', -'C:\Program Files\MongoDB', 'C:\Program Files\Azure Cosmos DB Emulator', -'C:\Program Files\PostgreSQL', 'C:\Program Files\Unity Hub', -'C:\Strawberry', 'C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk' - -foreach ($dir in $dirs) { - Start-ThreadJob -InputObject $dir { - Remove-Item -Recurse -Force -LiteralPath $input - } | Out-Null -} - -foreach ($job in Get-Job) { - Wait-Job $job | Out-Null - if ($job.Error) { - Write-Output "::warning file=$PSCommandPath::$($job.Error)" - } - Remove-Job $job -} - -Get-Volume | Out-String | Write-Output - -$saved = ($(Get-Volume C).SizeRemaining - $available) / 1gb -$savedRounded = [math]::Round($saved, 3) -Write-Output "total space saved: $savedRounded GB" diff --git a/src/ci/scripts/free-disk-space.sh b/src/ci/scripts/free-disk-space.sh deleted file mode 100755 index 062ad801cd8..00000000000 --- a/src/ci/scripts/free-disk-space.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -set -euo pipefail - -script_dir=$(dirname "$0") - -if [[ "${RUNNER_OS:-}" == "Windows" ]]; then - pwsh $script_dir/free-disk-space-windows.ps1 -else - $script_dir/free-disk-space-linux.sh -fi |
