Commit 06a7f9b
committed
ci: Cache Linux compiler output with ccache
Nothing was cached between runs, so every push recompiled all ~820
translation units from scratch in each of the three Linux jobs (two package
builds plus the sanitizer job) - and a push typically only touches a handful
of files.
Wire ccache in as a CMake compiler launcher and keep its directory in the
GitHub Actions cache. The launcher is only passed when ccache is actually on
PATH, so a distro that stops shipping it degrades to today's behaviour
instead of failing to configure; on Rocky the package comes from EPEL, which
the job already enables.
The cache directory sits inside the workspace, which is the one path spelled
the same way by actions/cache (which resolves `path:` relative to the
workspace) and by the build running inside the container, where
${{ github.workspace }} is the host's view and not the container's. It is
restored after checkout, since checkout prunes untracked files.
Each job writes an entry keyed by sha and restores by prefix, so a run always
starts from the most recent cache for its distro and arch, and a new branch
inherits main's. Capped at 500M per job to stay well inside the repository's
10G cache budget. Every job prints `ccache --show-stats` after building, so
the hit rate is visible in the log rather than inferred from the timings.
Assisted-by: Claude Code:claude-opus-5
Signed-off-by: Michael Medin <michael@medin.name>1 parent 13991a7 commit 06a7f9b
3 files changed
Lines changed: 111 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
62 | 98 | | |
63 | 99 | | |
64 | 100 | | |
| |||
108 | 144 | | |
109 | 145 | | |
110 | 146 | | |
| 147 | + | |
111 | 148 | | |
112 | 149 | | |
113 | 150 | | |
| |||
126 | 163 | | |
127 | 164 | | |
128 | 165 | | |
| 166 | + | |
129 | 167 | | |
130 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
131 | 175 | | |
132 | 176 | | |
133 | 177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
84 | 86 | | |
85 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
86 | 110 | | |
87 | 111 | | |
88 | 112 | | |
| |||
122 | 146 | | |
123 | 147 | | |
124 | 148 | | |
| 149 | + | |
125 | 150 | | |
126 | 151 | | |
127 | 152 | | |
| |||
137 | 162 | | |
138 | 163 | | |
139 | 164 | | |
| 165 | + | |
140 | 166 | | |
141 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
142 | 174 | | |
143 | 175 | | |
144 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
51 | 73 | | |
52 | 74 | | |
53 | 75 | | |
| |||
74 | 96 | | |
75 | 97 | | |
76 | 98 | | |
| 99 | + | |
77 | 100 | | |
78 | 101 | | |
79 | 102 | | |
| |||
90 | 113 | | |
91 | 114 | | |
92 | 115 | | |
93 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
94 | 125 | | |
95 | 126 | | |
96 | 127 | | |
| |||
0 commit comments