Skip to content

Commit

Permalink
CI: caching: run cache check 3 times a day
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Anton-Latukha committed Dec 19, 2021
1 parent 67045b1 commit f8312b4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/caching.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ on:
push:
branches:
- master
schedule:
# Refresh snapshot every (02+8*x):25 UTC
# When cache is present it is a light check workflow with early termination.
# When primary cache is not hit - runs the cache generation.
# Why: GitHub repo has 10G pool & on overflow GitHub removes caches in FIFO manner.
# When internal branche PRs save into the same pool -
# their cache is accessible only inside of the scope of the PR.
# If main cache is forced out - there are no cache shared between PRs,
# which implies all PRs would start to create & save their cache.
# Reinstitution of the main chache puts it back into FIFO
# & so it gets shared across all PRs.
- cron: "25 2/8 * * *"

env:
cabalBuild: "v2-build all --enable-tests --enable-benchmarks"
Expand Down

0 comments on commit f8312b4

Please # to comment.