Persist the self-hosted Renovate cache

Restore and save Renovate's public lookup and repository extraction cache with a SHA-pinned GitHub action. Keep private package caching disabled and report cache growth for quota monitoring.
This commit is contained in:
okxlin
2026-07-12 10:06:21 +08:00
parent 3f3057ef05
commit de60c0882d
3 changed files with 44 additions and 2 deletions
@@ -195,6 +195,23 @@ class RenovateAppVersionTests(unittest.TestCase):
self.assertIn("name: Check Docker Hub credentials", workflow)
self.assertIn("Configure DOCKERHUB_USERNAME and DOCKERHUB_TOKEN repository secrets", workflow)
def test_self_hosted_renovate_uses_a_pinned_persistent_cache(self):
workflow = (REPO_ROOT / ".github" / "workflows" / "renovate.yml").read_text(
encoding="utf-8"
)
self.assertIn(
"uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0",
workflow,
)
self.assertIn("path: /tmp/renovate-cache", workflow)
self.assertIn("${{ github.run_id }}", workflow)
self.assertIn("RENOVATE_CACHE_DIR: /tmp/renovate-cache", workflow)
self.assertIn("RENOVATE_REPOSITORY_CACHE: enabled", workflow)
self.assertIn("RENOVATE_CACHE_PRIVATE_PACKAGES: 'false'", workflow)
self.assertIn("chmod -R a+rwX /tmp/renovate-cache", workflow)
self.assertIn("du -sh /tmp/renovate-cache", workflow)
def test_hosted_and_self_hosted_renovate_have_disjoint_manager_scopes(self):
hosted = json.loads((REPO_ROOT / "renovate.json").read_text(encoding="utf-8"))
docker = json.loads(