Skip to content

Commit 633dd42

Browse files
committed
ci: twister: Clone cached Zephyr repository
This commit updates the twister workflow to pre-clone the Zephyr repository from the runner repository cache. Note that the `origin` remote URL is reconfigured to that of the GitHub Zephyr repository because the checkout action attempts to delete everything and re-clone otherwise. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent 780b4e0 commit 633dd42

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/twister.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ jobs:
4141
# hotfix, until we have a better way to deal with existing data
4242
rm -rf zephyr zephyr-testing
4343
44+
- name: Clone cached Zephyr repository
45+
if: github.event_name == 'pull_request_target'
46+
continue-on-error: true
47+
run: |
48+
git clone /github/cache/zephyrproject/zephyr .
49+
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
50+
4451
- name: Checkout
4552
if: github.event_name == 'pull_request_target'
4653
uses: actions/checkout@v3
@@ -131,6 +138,12 @@ jobs:
131138
# hotfix, until we have a better way to deal with existing data
132139
rm -rf zephyr zephyr-testing
133140
141+
- name: Clone cached Zephyr repository
142+
continue-on-error: true
143+
run: |
144+
git clone /github/cache/zephyrproject/zephyr .
145+
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
146+
134147
- name: Checkout
135148
uses: actions/checkout@v3
136149
with:

0 commit comments

Comments
 (0)