Commit b4209ba
Nix: Only write caches in main branch
For a long time we are having issues with Github Actions cache evictions when
multiple PRs change the nix setup. What happens in that case it that each of
these PRs will create it's own cache entries exceeding 5 GB for the 3 platforms
we require. As the total cache size limit is 10 GB, Github often evicted the
older cases which often is the cache from the main branch.
This will consequently slow down _all_ PRs as they have to build all
dependencies from scratch. The symptom of this is commonly the autogeneration
CI jobs taking 2 hours or more as they have to compile the cross toolchains
from scratch.
This commit fixes that for good. Caches are only written in the main branch,
and, hence, no cache evictions can occur do to PRs.
PRs changing the the nix setup will no longer be faster on second execution,
however, they still benefit from the cache from the main branch as that has
most of the packages they need anyway in most cases.
For example, a PR changing CBMC, will only have to rebuild CBMC, but can use
the cached z3 and HOL-Light.
Signed-off-by: Matthias J. Kannwischer <[email protected]>1 parent 8e74a84 commit b4209ba
2 files changed
+3
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
109 | | - | |
| 107 | + | |
| 108 | + | |
110 | 109 | | |
111 | 110 | | |
112 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
0 commit comments