@@ -114,20 +114,36 @@ jobs:
114114 zephyr-workspace/tools
115115 key : west-workspace-${{ steps.generate-vars.outputs.sdk-hash }}
116116
117- - name : 📦 Cache Python venv
118- id : cache-venv
117+ - name : 📦 Cache PIP Requirements
118+ id : cache-pip
119119 uses : actions/cache@v5
120+ with :
121+ path : ~/.venv
122+ key : venv-pip-${{ env.ZEPHYR_SDK_VERSION }}
123+
124+ - name : 📦 Restore Python venv
125+ if : steps.cache-pip.outputs.cache-hit != 'true'
126+ id : restore-venv
127+ uses : actions/cache/restore@v5
120128 with :
121129 path : ~/.venv
122130 key : venv-${{ env.ZEPHYR_SDK_VERSION }}
123131
124132 - name : 🐍 Setup Python venv + West
125133 id : setup-venv
126- if : steps.cache-venv.outputs.cache-hit != 'true'
134+ if : ${{ steps.cache-pip.outputs.cache-hit != 'true' && steps.restore- venv.outputs.cache-hit != 'true' }}
127135 run : |
128136 python3 -m venv ~/.venv
129137 ~/.venv/bin/pip install west ninja
130138
139+ - name : 📦 Cache Python venv
140+ if : steps.restore-venv.outputs.cache-hit != 'true'
141+ id : cache-venv
142+ uses : actions/cache/save@v5
143+ with :
144+ path : ~/.venv
145+ key : venv-${{ env.ZEPHYR_SDK_VERSION }}
146+
131147 - name : ♻️ Initialize Zephyr Workspace
132148 id : init-west
133149 run : |
@@ -140,13 +156,6 @@ jobs:
140156 west update --narrow -o=--depth=1
141157 west zephyr-export
142158
143- - name : 📦 Cache PIP Requirements
144- id : cache-pip
145- uses : actions/cache@v5
146- with :
147- path : ~/.venv
148- key : venv-pip-${{ env.ZEPHYR_SDK_VERSION }}-${{ hashFiles('zephyr-workspace/zephyr/scripts/requirements.txt') }}
149-
150159 - name : 🐍 Install Zephyr Python Requirements
151160 id : install-pip
152161 if : steps.cache-pip.outputs.cache-hit != 'true'
@@ -237,15 +246,12 @@ jobs:
237246 key : west-workspace-${{ needs.setup.outputs.sdk-hash }}
238247 fail-on-cache-miss : true
239248
240- - name : 📦 Restore Python venv
241- id : restore-venv
249+ - name : 📦 Restore PIP Requirements
250+ id : restore-pip
242251 uses : actions/cache/restore@v5
243252 with :
244253 path : ~/.venv
245- key : venv-pip-${{ env.ZEPHYR_SDK_VERSION }}-${{ hashFiles('zephyr-workspace/zephyr/scripts/requirements.txt') }}
246- restore-keys : |
247- venv-pip-
248- venv-
254+ key : venv-pip-${{ env.ZEPHYR_SDK_VERSION }}
249255 fail-on-cache-miss : true
250256
251257 - name : ♻️ Register Zephyr Workspace
0 commit comments