Skip to content

Commit f53f0ad

Browse files
committed
[github] pre-cache llvm-project in Linux CI Docker images
Linux CI bots take a bit over 70 seconds to fully set their git repos up, always starting from scratch. This can end up being a significant percentage of their overall runtime, depending on the change they're vetting. Having a fresh llvm-project in the docker image can bring this down to about 15 seconds; if the llvm-project checkout is 5 weeks old, the number seems to be closer to 30-35 seconds. In any case, that's a meaningful savings per CI bot run, so include a pinned LLVM here.
1 parent f7fdc8d commit f53f0ad

File tree

1 file changed

+11
-0
lines changed
  • .github/workflows/containers/github-action-ci

1 file changed

+11
-0
lines changed

.github/workflows/containers/github-action-ci/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,14 @@ RUN mkdir actions-runner && \
9494
tar xzf ./actions-runner-linux-x64-$GITHUB_RUNNER_VERSION.tar.gz && \
9595
rm ./actions-runner-linux-x64-$GITHUB_RUNNER_VERSION.tar.gz
9696

97+
# Pre-cache llvm-project in these images; this works with the premerge action
98+
# to speed up runs; cloning LLVM fresh takes >1min otherwise.
99+
#
100+
# A local experiment showed an explicit `git gc --aggressive` reduced this
101+
# layer's size by ~800MB (4.1GB -> 3.3GB). Disable GC'ing
102+
# afterward, so we don't waste time trying to do that in CI.
103+
RUN \
104+
git clone https://github.com/llvm/llvm-project --tags && \
105+
cd llvm-project && \
106+
git gc --aggressive && \
107+
git config gc.auto 0

0 commit comments

Comments
 (0)