From 2b9e74e80cf9e1a54be71a8004b9f5531ccdf0b5 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Thu, 12 Mar 2020 17:41:41 +0100 Subject: [PATCH] .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`. --- .../.github/workflows/kernel-releases-alpha.yml | 4 ++-- .../coreos-overlay/.github/workflows/kernel-releases-edge.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml index b1d5a962fa..0d56f5dcb2 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml @@ -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 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml index 1335c32f69..819c6aaa21 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml @@ -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