.github: git shallow clone instead of full clone for kernel

To reduce running time of git clone, we should avoid a full git clone
of the linux kernel repo. Instead, we shallow clone the repo, and
parse tags list by running `git ls-remote`.
This commit is contained in:
Dongsu Park 2020-03-12 17:41:41 +01:00 committed by Kai Lüke
parent f0db41dbb5
commit 2b9e74e80c
2 changed files with 4 additions and 4 deletions

View File

@ -15,8 +15,8 @@ jobs:
env:
KV_ALPHA: 4.19
run: |
git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux
versionAlpha=$(git -C linux tag | sed -n "/^v${KV_ALPHA}.[0-9]*$/s/^v//p" | sort -ruV | head -1)
git clone --depth=1 --no-checkout https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux
versionAlpha=$(git -C linux ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v${KV_ALPHA}.[0-9]*$/s/^refs\/tags\/v//p" | sort -ruV | head -1)
rm -rf linux
echo ::set-output name=VERSION_ALPHA::$(echo ${versionAlpha})
echo ::set-output name=BASE_BRANCH_ALPHA::flatcar-master-alpha

View File

@ -15,8 +15,8 @@ jobs:
env:
KV_EDGE: 5.5
run: |
git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux
versionEdge=$(git -C linux tag | sed -n "/^v${KV_EDGE}.[0-9]*$/s/^v//p" | sort -ruV | head -1)
git clone --depth=1 --no-checkout https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux
versionEdge=$(git -C linux ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v${KV_EDGE}.[0-9]*$/s/^refs\/tags\/v//p" | sort -ruV | head -1)
rm -rf linux
echo ::set-output name=VERSION_EDGE::$(echo ${versionEdge})
echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge