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.
This commit is contained in:
weishu
2023-08-09 13:32:48 +08:00
committed by GitHub
parent beaa048be3
commit e8a90aadb2

View File

@@ -86,17 +86,26 @@ jobs:
- name: Setup kernel source - name: Setup kernel source
run: | run: |
echo "Free space:"
df -h
cd $GITHUB_WORKSPACE cd $GITHUB_WORKSPACE
git clone https://gerrit.googlesource.com/git-repo sudo apt-get install repo -y
mkdir android-kernel && cd android-kernel 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 }}) 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 if grep -q deprecated <<< $REMOTE_BRANCH; then
echo "Found deprecated branch: ${{ inputs.tag }}" echo "Found deprecated branch: ${{ inputs.tag }}"
sed -i 's/"${{ inputs.tag }}"/"deprecated\/${{ inputs.tag }}"/g' .repo/manifests/default.xml sed -i 's/"${{ inputs.tag }}"/"deprecated\/${{ inputs.tag }}"/g' $DEFAULT_MANIFEST_PATH
cat .repo/manifests/default.xml cat $DEFAULT_MANIFEST_PATH
fi 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 - name: Setup KernelSU
env: env: