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 <root@stephanos.io>
This commit is contained in:
Stephanos Ioannidis 2022-11-09 05:35:57 +09:00
parent 9a491a1b5b
commit 3d8e651992
3 changed files with 4 additions and 4 deletions

View file

@ -38,7 +38,7 @@ jobs:
- name: Clone cached Zephyr repository
continue-on-error: true
run: |
git clone /github/cache/zephyrproject/zephyr .
git clone --shared /github/cache/zephyrproject/zephyr .
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
- name: Checkout

View file

@ -39,7 +39,7 @@ jobs:
- name: Clone cached Zephyr repository
continue-on-error: true
run: |
git clone /github/cache/zephyrproject/zephyr .
git clone --shared /github/cache/zephyrproject/zephyr .
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
- name: checkout

View file

@ -51,7 +51,7 @@ jobs:
if: github.event_name == 'pull_request_target'
continue-on-error: true
run: |
git clone /github/cache/zephyrproject/zephyr .
git clone --shared /github/cache/zephyrproject/zephyr .
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
- name: Checkout
@ -146,7 +146,7 @@ jobs:
- name: Clone cached Zephyr repository
continue-on-error: true
run: |
git clone /github/cache/zephyrproject/zephyr .
git clone --shared /github/cache/zephyrproject/zephyr .
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
- name: Checkout