From 6a90cedbbacbfc549949a4aa4d25d1ed82ec0f3e Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Fri, 6 Oct 2023 13:09:13 -0400 Subject: [PATCH 1/4] use hosted runners for nightly actions --- .github/workflows/release-nightly.yml | 87 ++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml index ef3db2db73e03..80ae931b9b540 100644 --- a/.github/workflows/release-nightly.yml +++ b/.github/workflows/release-nightly.yml @@ -10,12 +10,39 @@ concurrency: jobs: nightly-binary: - runs-on: actuated-4cpu-16gb + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 # fetch all commits instead of only the last as some branches are long lived and could have many between versions # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 - run: git fetch --unshallow --quiet --tags --force + # FIXME: https://github.com/jlumbroso/free-disk-space/issues/17 + - name: same as 'large-packages' but without 'google-cloud-sdk' + shell: bash + run: | + sudo apt-get remove -y '^dotnet-.*' + sudo apt-get remove -y '^llvm-.*' + sudo apt-get remove -y 'php.*' + sudo apt-get remove -y '^mongodb-.*' + sudo apt-get remove -y '^mysql-.*' + sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri + sudo apt-get autoremove -y + sudo apt-get clean + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # this might remove tools that are actually needed, + # if set to "true" but frees about 6 GB + tool-cache: false + + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: false + docker-images: false + swap-storage: true - uses: actions/setup-go@v4 with: go-version: "~1.21" @@ -56,12 +83,39 @@ jobs: SOURCE_DIR: dist/release DEST_DIR: gitea/${{ steps.clean_name.outputs.branch }} nightly-docker-rootful: - runs-on: actuated-4cpu-16gb + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 # fetch all commits instead of only the last as some branches are long lived and could have many between versions # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 - run: git fetch --unshallow --quiet --tags --force + # FIXME: https://github.com/jlumbroso/free-disk-space/issues/17 + - name: same as 'large-packages' but without 'google-cloud-sdk' + shell: bash + run: | + sudo apt-get remove -y '^dotnet-.*' + sudo apt-get remove -y '^llvm-.*' + sudo apt-get remove -y 'php.*' + sudo apt-get remove -y '^mongodb-.*' + sudo apt-get remove -y '^mysql-.*' + sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri + sudo apt-get autoremove -y + sudo apt-get clean + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # this might remove tools that are actually needed, + # if set to "true" but frees about 6 GB + tool-cache: false + + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: false + docker-images: false + swap-storage: true - uses: actions/setup-go@v4 with: go-version: "~1.21" @@ -93,12 +147,39 @@ jobs: push: true tags: gitea/gitea:${{ steps.clean_name.outputs.branch }} nightly-docker-rootless: - runs-on: actuated-4cpu-16gb + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 # fetch all commits instead of only the last as some branches are long lived and could have many between versions # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 - run: git fetch --unshallow --quiet --tags --force + # FIXME: https://github.com/jlumbroso/free-disk-space/issues/17 + - name: same as 'large-packages' but without 'google-cloud-sdk' + shell: bash + run: | + sudo apt-get remove -y '^dotnet-.*' + sudo apt-get remove -y '^llvm-.*' + sudo apt-get remove -y 'php.*' + sudo apt-get remove -y '^mongodb-.*' + sudo apt-get remove -y '^mysql-.*' + sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri + sudo apt-get autoremove -y + sudo apt-get clean + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # this might remove tools that are actually needed, + # if set to "true" but frees about 6 GB + tool-cache: false + + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: false + docker-images: false + swap-storage: true - uses: actions/setup-go@v4 with: go-version: "~1.21" From 75405cb35fbc6c61566c553407d4a4bc40b9638e Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Fri, 6 Oct 2023 13:53:24 -0400 Subject: [PATCH 2/4] switch to re-usable workflow --- .github/workflows/disk-clean.yml | 36 ++++++++++++ .github/workflows/release-nightly.yml | 84 +-------------------------- 2 files changed, 39 insertions(+), 81 deletions(-) create mode 100644 .github/workflows/disk-clean.yml diff --git a/.github/workflows/disk-clean.yml b/.github/workflows/disk-clean.yml new file mode 100644 index 0000000000000..698e99ba6895c --- /dev/null +++ b/.github/workflows/disk-clean.yml @@ -0,0 +1,36 @@ +name: Clean up disk space + +on: + workflow_call: + +jobs: + triage: + runs-on: ubuntu-latest + steps: + # FIXME: https://github.com/jlumbroso/free-disk-space/issues/17 + - name: same as 'large-packages' but without 'google-cloud-sdk' + shell: bash + run: | + sudo apt-get remove -y '^dotnet-.*' + sudo apt-get remove -y '^llvm-.*' + sudo apt-get remove -y 'php.*' + sudo apt-get remove -y '^mongodb-.*' + sudo apt-get remove -y '^mysql-.*' + sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri + sudo apt-get autoremove -y + sudo apt-get clean + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # this might remove tools that are actually needed, + # if set to "true" but frees about 6 GB + tool-cache: false + + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: false + docker-images: false + swap-storage: true diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml index 80ae931b9b540..321b9626cef97 100644 --- a/.github/workflows/release-nightly.yml +++ b/.github/workflows/release-nightly.yml @@ -16,33 +16,7 @@ jobs: # fetch all commits instead of only the last as some branches are long lived and could have many between versions # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 - run: git fetch --unshallow --quiet --tags --force - # FIXME: https://github.com/jlumbroso/free-disk-space/issues/17 - - name: same as 'large-packages' but without 'google-cloud-sdk' - shell: bash - run: | - sudo apt-get remove -y '^dotnet-.*' - sudo apt-get remove -y '^llvm-.*' - sudo apt-get remove -y 'php.*' - sudo apt-get remove -y '^mongodb-.*' - sudo apt-get remove -y '^mysql-.*' - sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri - sudo apt-get autoremove -y - sudo apt-get clean - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - # this might remove tools that are actually needed, - # if set to "true" but frees about 6 GB - tool-cache: false - - # all of these default to true, but feel free to set to - # "false" if necessary for your workflow - android: true - dotnet: true - haskell: true - large-packages: false - docker-images: false - swap-storage: true + - uses: ./.github/workflows/disk-clean.yml - uses: actions/setup-go@v4 with: go-version: "~1.21" @@ -89,33 +63,7 @@ jobs: # fetch all commits instead of only the last as some branches are long lived and could have many between versions # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 - run: git fetch --unshallow --quiet --tags --force - # FIXME: https://github.com/jlumbroso/free-disk-space/issues/17 - - name: same as 'large-packages' but without 'google-cloud-sdk' - shell: bash - run: | - sudo apt-get remove -y '^dotnet-.*' - sudo apt-get remove -y '^llvm-.*' - sudo apt-get remove -y 'php.*' - sudo apt-get remove -y '^mongodb-.*' - sudo apt-get remove -y '^mysql-.*' - sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri - sudo apt-get autoremove -y - sudo apt-get clean - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - # this might remove tools that are actually needed, - # if set to "true" but frees about 6 GB - tool-cache: false - - # all of these default to true, but feel free to set to - # "false" if necessary for your workflow - android: true - dotnet: true - haskell: true - large-packages: false - docker-images: false - swap-storage: true + - uses: ./.github/workflows/disk-clean.yml - uses: actions/setup-go@v4 with: go-version: "~1.21" @@ -153,33 +101,7 @@ jobs: # fetch all commits instead of only the last as some branches are long lived and could have many between versions # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 - run: git fetch --unshallow --quiet --tags --force - # FIXME: https://github.com/jlumbroso/free-disk-space/issues/17 - - name: same as 'large-packages' but without 'google-cloud-sdk' - shell: bash - run: | - sudo apt-get remove -y '^dotnet-.*' - sudo apt-get remove -y '^llvm-.*' - sudo apt-get remove -y 'php.*' - sudo apt-get remove -y '^mongodb-.*' - sudo apt-get remove -y '^mysql-.*' - sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri - sudo apt-get autoremove -y - sudo apt-get clean - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - # this might remove tools that are actually needed, - # if set to "true" but frees about 6 GB - tool-cache: false - - # all of these default to true, but feel free to set to - # "false" if necessary for your workflow - android: true - dotnet: true - haskell: true - large-packages: false - docker-images: false - swap-storage: true + - uses: ./.github/workflows/disk-clean.yml - uses: actions/setup-go@v4 with: go-version: "~1.21" From 35fe7b1b7c1e65867622338392dff53f15c85224 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Fri, 6 Oct 2023 13:59:00 -0400 Subject: [PATCH 3/4] fix indentation --- .github/workflows/disk-clean.yml | 52 ++++++++++++++++---------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/workflows/disk-clean.yml b/.github/workflows/disk-clean.yml index 698e99ba6895c..3ae64b169a48e 100644 --- a/.github/workflows/disk-clean.yml +++ b/.github/workflows/disk-clean.yml @@ -7,30 +7,30 @@ jobs: triage: runs-on: ubuntu-latest steps: - # FIXME: https://github.com/jlumbroso/free-disk-space/issues/17 - - name: same as 'large-packages' but without 'google-cloud-sdk' - shell: bash - run: | - sudo apt-get remove -y '^dotnet-.*' - sudo apt-get remove -y '^llvm-.*' - sudo apt-get remove -y 'php.*' - sudo apt-get remove -y '^mongodb-.*' - sudo apt-get remove -y '^mysql-.*' - sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri - sudo apt-get autoremove -y - sudo apt-get clean - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - # this might remove tools that are actually needed, - # if set to "true" but frees about 6 GB - tool-cache: false + # FIXME: https://github.com/jlumbroso/free-disk-space/issues/17 + - name: same as 'large-packages' but without 'google-cloud-sdk' + shell: bash + run: | + sudo apt-get remove -y '^dotnet-.*' + sudo apt-get remove -y '^llvm-.*' + sudo apt-get remove -y 'php.*' + sudo apt-get remove -y '^mongodb-.*' + sudo apt-get remove -y '^mysql-.*' + sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri + sudo apt-get autoremove -y + sudo apt-get clean + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # this might remove tools that are actually needed, + # if set to "true" but frees about 6 GB + tool-cache: false - # all of these default to true, but feel free to set to - # "false" if necessary for your workflow - android: true - dotnet: true - haskell: true - large-packages: false - docker-images: false - swap-storage: true + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: false + docker-images: false + swap-storage: true From 8575b6d658148ada09f86ac00bcdf40ed8b2c248 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Fri, 6 Oct 2023 14:39:23 -0400 Subject: [PATCH 4/4] Update disk-clean.yml Co-authored-by: silverwind --- .github/workflows/disk-clean.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/disk-clean.yml b/.github/workflows/disk-clean.yml index 3ae64b169a48e..24a9d9216fb60 100644 --- a/.github/workflows/disk-clean.yml +++ b/.github/workflows/disk-clean.yml @@ -1,4 +1,4 @@ -name: Clean up disk space +name: disk-clean on: workflow_call: