Skip to content

Commit 7d405a4

Browse files
committed
ci: Clone cached Zephyr repository with shared objects
In the new ephemeral Zephyr runners, the cached repository files are located in a foreign file system and Git clone operation cannot create hard-links to the cached repository objects, which forces the Git clone operation to copy the objects from the cache file system to the runner container file system. This commit updates the CI workflows to instead perform a "shared clone" of the cached repository, which allows the cloned repository to utilise the object database of the cached repository. While "shared clone" can be often dangerous because the source repository objects can be deleted, in this case, the source repository (i.e. cached repository) is mounted as read-only and immutable. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent 2dbe845 commit 7d405a4

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

.github/workflows/clang.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Clone cached Zephyr repository
3030
continue-on-error: true
3131
run: |
32-
git clone /github/cache/zephyrproject/zephyr .
32+
git clone --shared /github/cache/zephyrproject/zephyr .
3333
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
3434
3535
- name: Checkout

.github/workflows/codecov.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Clone cached Zephyr repository
3232
continue-on-error: true
3333
run: |
34-
git clone /github/cache/zephyrproject/zephyr .
34+
git clone --shared /github/cache/zephyrproject/zephyr .
3535
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
3636
3737
- name: checkout

.github/workflows/twister.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
if: github.event_name == 'pull_request_target'
4141
continue-on-error: true
4242
run: |
43-
git clone /github/cache/zephyrproject/zephyr .
43+
git clone --shared /github/cache/zephyrproject/zephyr .
4444
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
4545
4646
- name: Checkout
@@ -131,7 +131,7 @@ jobs:
131131
- name: Clone cached Zephyr repository
132132
continue-on-error: true
133133
run: |
134-
git clone /github/cache/zephyrproject/zephyr .
134+
git clone --shared /github/cache/zephyrproject/zephyr .
135135
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
136136
137137
- name: Checkout

0 commit comments

Comments
 (0)