From e8a90aadb2c215fbde89d54ef4b5749020cc3819 Mon Sep 17 00:00:00 2001 From: weishu Date: Wed, 9 Aug 2023 13:32:48 +0800 Subject: [PATCH] ci: Fix No space left on device (#833) For android13 gki kernels, Google puts lots of unused file to kernel source tree, while the Github Action only has 14G disk size and the ci may fail because of "No space left on device". The `repo` tool will try pull all the refs and tags with depth=INT_MAX if it found the SHA1 hash doesn't exist on remote server even if you force it to fetch with `depth=1` and `--no-tags`. So we use the version `v2.16` which doesn't check it. And also, using a fixed repo version can avoid randomly failure of building. --- .github/workflows/gki-kernel.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/gki-kernel.yml b/.github/workflows/gki-kernel.yml index 1dc52619..b041ef50 100644 --- a/.github/workflows/gki-kernel.yml +++ b/.github/workflows/gki-kernel.yml @@ -86,17 +86,26 @@ jobs: - name: Setup kernel source run: | + echo "Free space:" + df -h cd $GITHUB_WORKSPACE - git clone https://gerrit.googlesource.com/git-repo + sudo apt-get install repo -y mkdir android-kernel && cd android-kernel - ../git-repo/repo init --depth=1 --u https://android.googlesource.com/kernel/manifest -b common-${{ inputs.tag }} + repo init --depth=1 --u https://android.googlesource.com/kernel/manifest -b common-${{ inputs.tag }} --repo-rev=v2.16 REMOTE_BRANCH=$(git ls-remote https://android.googlesource.com/kernel/common ${{ inputs.tag }}) + DEFAULT_MANIFEST_PATH=.repo/manifests/default.xml if grep -q deprecated <<< $REMOTE_BRANCH; then echo "Found deprecated branch: ${{ inputs.tag }}" - sed -i 's/"${{ inputs.tag }}"/"deprecated\/${{ inputs.tag }}"/g' .repo/manifests/default.xml - cat .repo/manifests/default.xml + sed -i 's/"${{ inputs.tag }}"/"deprecated\/${{ inputs.tag }}"/g' $DEFAULT_MANIFEST_PATH + cat $DEFAULT_MANIFEST_PATH fi - ../git-repo/repo sync -j$(nproc --all) + repo --version + repo --trace sync -q -c -j$(nproc --all) --no-tags + if [ -d prebuilts/clang/host/linux-x86 ] && [ -f common/build.config.constants ]; then + ls -d prebuilts/clang/host/linux-x86/clang-r* | grep -v $(sed -n 's/^CLANG_VERSION=//p' common/build.config.constants) + fi + rm -rf .repo + df -h - name: Setup KernelSU env: