Skip to content

Commit af027d2

Browse files
authored
ci: pre-fetch KAS_REPO_REF_DIR with just git (#819)
We initially used KAS_REPO_REF_DIR to keep a local copy of the repos mirrors, to avoid fetching projects from scratch in CI. However, it is implemented such that the mirrors, once created by kas the first time, are never updated by kas, they are 'read only'. Sometimes the fetch from upstream fails and the KAS ended up falling back to the old content of the mirrors, silently. To fix this we will pre-fetch all ref front the origin the repos in KAS_REPO_REF_DIR. We will for each repo retry 3 times sleeping 10 seconds between attempts. Fixes #712
2 parents da66ef2 + 7ddbe2d commit af027d2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/build-yocto.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,19 @@ env:
1313
BASE_ARTIFACT_URL: "https://quic-yocto-fileserver-1029608027416.us-central1.run.app/${{ github.run_id }}"
1414

1515
jobs:
16+
kas-mirror:
17+
if: github.repository == 'qualcomm-linux/meta-qcom'
18+
runs-on: [self-hosted, x86]
19+
steps:
20+
- name: Update kas mirrors
21+
run: |
22+
for r in $(find ${KAS_REPO_REF_DIR}/* -maxdepth 0 -type d); do
23+
echo "pre-fetch: $r"
24+
git -C $r fetch --prune origin '+refs/*:refs/*'
25+
done
26+
1627
kas-lock:
28+
needs: kas-mirror
1729
if: github.repository == 'qualcomm-linux/meta-qcom'
1830
runs-on: [self-hosted, x86]
1931
steps:

0 commit comments

Comments
 (0)