You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ma...@apache.org on 2024/02/07 14:16:58 UTC
(flink) 01/02: [FLINK-34360][ci] Adds cleanup to job_init action
This is an automated email from the ASF dual-hosted git repository.
mapohl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit f468b5bddc1b7179862be285eb22b31c48a35ae5
Author: Matthias Pohl <ma...@aiven.io>
AuthorDate: Tue Feb 6 15:46:15 2024 +0100
[FLINK-34360][ci] Adds cleanup to job_init action
---
.github/actions/job_init/action.yml | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/.github/actions/job_init/action.yml b/.github/actions/job_init/action.yml
index 5158d855857..550e7b62fd4 100644
--- a/.github/actions/job_init/action.yml
+++ b/.github/actions/job_init/action.yml
@@ -44,6 +44,31 @@ runs:
echo "GHA_PIPELINE_START_TIME=${job_start_time}" >> "${GITHUB_ENV}"
echo "The job's start time is set to ${job_start_time}."
+ - name: "Pre-cleanup Disk Info"
+ shell: bash
+ run: df -h
+
+ - name: "Delete unused binaries"
+ shell: bash
+ run: |
+ # inspired by https://github.com/easimon/maximize-build-space
+ for label_with_path in \
+ "Android SDK:/usr/local/lib/android" \
+ "CodeQL:/opt/hostedtoolcache/CodeQL" \
+ ".NET:/usr/share/dotnet"; do
+ dependency_name="$(echo "${label_with_path}" | cut -d: -f1)"
+ dependency_path="$(echo "${label_with_path}" | cut -d: -f2)"
+
+ if [ -d "${dependency_path}" ]; then
+ echo "[INFO] Deleting binaries of ${dependency_name} in ${dependency_path}."
+ sudo rm -rf "${dependency_path}"
+ df -h
+ else
+ echo "[INFO] The directory '${dependency_path}' doesn't exist. ${dependency_name} won't be removed."
+ fi
+ done
+ android_sdk_path="/usr/local/lib/android"
+
- name: "Set JDK version to ${{ inputs.jdk_version }}"
shell: bash
run: |