Commit 207bd9a5 authored by Stephanos Ioannidis's avatar Stephanos Ioannidis
Browse files

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: default avatarStephanos Ioannidis <root@stephanos.io>
parent 7fdafbef
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,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
+1 −1
Original line number Diff line number Diff line
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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
@@ -147,7 +147,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