Skip to content

Commit 4353b56

Browse files
committed
ci: twister: Store ccache data in node cache
This commit updates the twister workflow to store ccache data in the zephyr-runner v2 node cache. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent c482460 commit 4353b56

File tree

1 file changed

+9
-28
lines changed

1 file changed

+9
-28
lines changed

.github/workflows/twister.yaml

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ jobs:
144144
matrix:
145145
subset: ${{fromJSON(needs.twister-build-prep.outputs.subset)}}
146146
env:
147+
CCACHE_DIR: /node-cache/ccache-zephyr
147148
BSIM_OUT_PATH: /opt/bsim/
148149
BSIM_COMPONENTS_PATH: /opt/bsim/components
149150
TWISTER_COMMON: ' --force-color --inline-logs -v -N -M --retry-failed 3 '
@@ -208,32 +209,12 @@ jobs:
208209
echo "github.base_ref: ${{ github.base_ref }}"
209210
echo "github.ref_name: ${{ github.ref_name }}"
210211
211-
- name: Prepare ccache timestamp/data
212-
id: ccache_cache_timestamp
213-
shell: cmake -P {0}
212+
- name: Set up ccache
214213
run: |
215-
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
216-
string(REPLACE "/" "_" repo ${{github.repository}})
217-
string(REPLACE "-" "_" repo2 ${repo})
218-
file(APPEND $ENV{GITHUB_OUTPUT} "repo=${repo2}\n")
219-
220-
- name: use cache
221-
id: cache-ccache
222-
uses: zephyrproject-rtos/[email protected]
223-
continue-on-error: true
224-
with:
225-
key: ${{ steps.ccache_cache_timestamp.outputs.repo }}-${{ github.ref_name }}-${{github.event_name}}-${{ matrix.subset }}-ccache
226-
path: /github/home/.cache/ccache
227-
aws-s3-bucket: ccache.zephyrproject.org
228-
aws-access-key-id: ${{ vars.AWS_CCACHE_ACCESS_KEY_ID }}
229-
aws-secret-access-key: ${{ secrets.AWS_CCACHE_SECRET_ACCESS_KEY }}
230-
aws-region: us-east-2
231-
232-
- name: ccache stats initial
233-
run: |
234-
mkdir -p /github/home/.cache
235-
test -d github/home/.cache/ccache && rm -rf /github/home/.cache/ccache && mv github/home/.cache/ccache /github/home/.cache/ccache
236-
ccache -M 10G -s
214+
mkdir -p ${CCACHE_DIR}
215+
ccache -M 10G
216+
ccache -p
217+
ccache -z -s -vv
237218
238219
- if: github.event_name == 'push'
239220
name: Run Tests with Twister (Push)
@@ -276,10 +257,10 @@ jobs:
276257
fi
277258
fi
278259
279-
- name: ccache stats post
260+
- name: Print ccache stats
261+
if: always()
280262
run: |
281-
ccache -p
282-
ccache -s
263+
ccache -s -vv
283264
284265
- name: Upload Unit Test Results
285266
if: always()

0 commit comments

Comments
 (0)