Skip to content

Commit 913a895

Browse files
committed
CI: caching: run cache check 3 times a day
Recently there is a lot of PRs/builds from internal repo branches. Repo cache has 10G pool limit & PR caches are not shared between PRs, but main branch cache is. Checking & when missing rebuilding it ensures that if internal branch PRs pushed main state out of the pool - it gets reinstituted. *afaik* there is no way to prioritize main branch cache better, since GitHub CI FIFO caches out of the pool by build time.
1 parent 67045b1 commit 913a895

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.github/workflows/caching.yml

+11
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ on:
3030
push:
3131
branches:
3232
- master
33+
schedule:
34+
# Refresh snapshot every (02+8*x):25 UTC
35+
# When cache is present it is a light check workflow with early temination.
36+
# When primary cache is not hit - runs the cache generation.
37+
# Why: GitHub repo has 10G pool & on overflow GitHub removes caches in FIFO manner.
38+
# When internal branche PRs save into the same pool -
39+
# their cache is accessible only inside of the scope of the PR.
40+
# If main cache is forced out - there are no cache shared between PRs,
41+
# which implies all PRs would start to create & save their cache.
42+
# Reinstitution of the main chache once a day allows to put it back so it gets shared across all PRs.
43+
- cron: "25 2/8 * * *"
3344

3445
env:
3546
cabalBuild: "v2-build all --enable-tests --enable-benchmarks"

0 commit comments

Comments
 (0)