mirror of
https://git.yoctoproject.org/meta-raspberrypi
synced 2026-10-19 16:57:03 +00:00
ci: prune unused sstate weekly
Nothing removes artifacts from the runner's SSTATE_DIR, so it grows without bound. Delete sstate files not touched in 30 days. bitbake touches sstate files whenever a build checks or unpacks them, so mtime tracks last use across all branches. DL_DIR is not pruned. Download stamps are only touched by do_fetch, which sstate-restored recipes skip, so their age doesn't reflect whether a rebuild would need them. Signed-off-by: Andrei Gherzan <andrei@gherzan.com>
This commit is contained in:
1 file changed
+34
@@ -0,0 +1,34 @@
|
||||
# SPDX-FileCopyrightText: Andrei Gherzan <andrei@gherzan.com>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
---
|
||||
|
||||
name: Prune caches
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 3 * * 0"
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: prune-caches
|
||||
|
||||
jobs:
|
||||
sstate:
|
||||
name: Prune unused sstate
|
||||
runs-on: [self-hosted, Linux]
|
||||
env:
|
||||
DL_DIR: /var/lib/ci/yocto/downloads
|
||||
SSTATE_DIR: /var/lib/ci/yocto/sstate
|
||||
SSTATE_MAX_AGE_DAYS: 30
|
||||
steps:
|
||||
- name: Prune sstate not used in ${{ env.SSTATE_MAX_AGE_DAYS }} days
|
||||
# bitbake touches sstate files whenever a build uses them, so mtime is
|
||||
# a reliable last-use time.
|
||||
run: |
|
||||
du -sh "$DL_DIR" "$SSTATE_DIR"
|
||||
find "$SSTATE_DIR" -type f -name 'sstate:*' \
|
||||
-mtime +"$SSTATE_MAX_AGE_DAYS" -delete
|
||||
find "$SSTATE_DIR" -mindepth 1 -type d -empty -delete
|
||||
du -sh "$SSTATE_DIR"
|
||||
Reference in new issue
Block a user