diff --git a/.github/actions/free-disk-space/action.yml b/.github/actions/free-disk-space/action.yml new file mode 100644 index 0000000000..1eb453fa6e --- /dev/null +++ b/.github/actions/free-disk-space/action.yml @@ -0,0 +1,17 @@ +name: 'Free Space' +description: 'Free up disk space by removing files and directories that are not needed for tests.' +runs: + using: 'composite' + steps: + - name: Free space + shell: bash + run: | + echo "Disk space before cleanup:" + df -h + sudo rm -rf /usr/share/dotnet + sudo rm -rf /usr/local/lib/android + sudo rm -rf /usr/share/az_* + sudo rm -rf /opt/az + sudo rm -rf /usr/lib/google-cloud-sdk + echo "Disk space after cleanup:" + df -h diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bd6150a0d0..260c59e71b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -240,7 +240,8 @@ jobs: with: username: hardcoreeng password: ${{ secrets.DOCKER_ACCESS_TOKEN }} - + - name: Free space + uses: ./.github/actions/free-disk-space - name: Docker Build run: node common/scripts/install-run-rush.js docker env: @@ -371,7 +372,8 @@ jobs: with: username: hardcoreeng password: ${{ secrets.DOCKER_ACCESS_TOKEN }} - + - name: Free space + uses: ./.github/actions/free-disk-space - name: Docker Build run: node common/scripts/install-run-rush.js docker env: @@ -467,6 +469,8 @@ jobs: with: username: hardcoreeng password: ${{ secrets.DOCKER_ACCESS_TOKEN }} + - name: Free space + uses: ./.github/actions/free-disk-space - name: Docker Build run: node common/scripts/install-run-rush.js docker env: @@ -549,6 +553,8 @@ jobs: with: username: hardcoreeng password: ${{ secrets.DOCKER_ACCESS_TOKEN }} + - name: Free space + uses: ./.github/actions/free-disk-space - name: Docker Build run: node common/scripts/install-run-rush.js docker env: