From 454f1c8d5d9feea3c45269f72236dbdc04da9fd2 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Wed, 4 Sep 2024 12:19:21 +0200 Subject: [PATCH] build: free up macos disk space as soon as possible (#43537) * chore: free up macos disk space as soon as possible Co-authored-by: John Kleinschmidt * build: free up disk space on gn check too Co-authored-by: John Kleinschmidt --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt --- .../pipeline-segment-electron-build.yml | 6 ++++++ .../pipeline-segment-electron-gn-check.yml | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/.github/workflows/pipeline-segment-electron-build.yml b/.github/workflows/pipeline-segment-electron-build.yml index bd1ce1868987..53b6580f0c2a 100644 --- a/.github/workflows/pipeline-segment-electron-build.yml +++ b/.github/workflows/pipeline-segment-electron-build.yml @@ -82,6 +82,12 @@ jobs: with: path: src/electron fetch-depth: 0 + - name: Free up space (macOS) + if: ${{ inputs.target-platform == 'macos' }} + uses: ./src/electron/.github/actions/free-space-macos + - name: Check disk space after freeing up space + if: ${{ inputs.target-platform == 'macos' }} + run: df -h - name: Setup Node.js/npm if: ${{ inputs.target-platform == 'macos' }} uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 diff --git a/.github/workflows/pipeline-segment-electron-gn-check.yml b/.github/workflows/pipeline-segment-electron-gn-check.yml index 1ef8ba6ee666..418006856353 100644 --- a/.github/workflows/pipeline-segment-electron-gn-check.yml +++ b/.github/workflows/pipeline-segment-electron-gn-check.yml @@ -54,6 +54,23 @@ jobs: with: path: src/electron fetch-depth: 0 + - name: Cleanup disk space on macOS + if: ${{ inputs.target-platform == 'macos' }} + shell: bash + run: | + sudo mkdir -p $TMPDIR/del-target + + tmpify() { + if [ -d "$1" ]; then + sudo mv "$1" $TMPDIR/del-target/$(echo $1|shasum -a 256|head -n1|cut -d " " -f1) + fi + } + tmpify /Library/Developer/CoreSimulator + tmpify ~/Library/Developer/CoreSimulator + sudo rm -rf $TMPDIR/del-target + - name: Check disk space after freeing up space + if: ${{ inputs.target-platform == 'macos' }} + run: df -h - name: Install Build Tools uses: ./src/electron/.github/actions/install-build-tools - name: Init Build Tools